Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(596)

Unified Diff: Source/core/html/HTMLMediaElement.cpp

Issue 1297983002: Update poster code as per https://html.spec.whatwg.org/#show-poster-flag (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: clean up Created 5 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/core/html/HTMLMediaElement.h ('k') | Source/core/html/HTMLVideoElement.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/html/HTMLMediaElement.cpp
diff --git a/Source/core/html/HTMLMediaElement.cpp b/Source/core/html/HTMLMediaElement.cpp
index ef4a05ad0d62be0329b56a7988629cce0241fb62..3a10a5bebbc09153eecb4796e618d6f59a3d6165 100644
--- a/Source/core/html/HTMLMediaElement.cpp
+++ b/Source/core/html/HTMLMediaElement.cpp
@@ -332,7 +332,6 @@ HTMLMediaElement::HTMLMediaElement(const QualifiedName& tagName, Document& docum
, m_deferredLoadState(NotDeferred)
, m_deferredLoadTimer(this, &HTMLMediaElement::deferredLoadTimerFired)
, m_webLayer(nullptr)
- , m_displayMode(Unknown)
, m_cachedTime(std::numeric_limits<double>::quiet_NaN())
, m_fragmentEndTime(std::numeric_limits<double>::quiet_NaN())
, m_pendingActionFlags(0)
@@ -727,7 +726,7 @@ void HTMLMediaElement::prepareForLoad()
m_haveFiredLoadedData = false;
m_completelyLoaded = false;
m_havePreparedToPlay = false;
- m_displayMode = Unknown;
+ setShowPoster(true);
// 1 - Abort any already-running instance of the resource selection algorithm for this element.
m_loadState = WaitingForSource;
@@ -853,7 +852,7 @@ void HTMLMediaElement::selectMediaResource()
m_loadState = WaitingForSource;
setShouldDelayLoadEvent(false);
m_networkState = NETWORK_EMPTY;
- updateDisplayState();
+ updateDisplayState(false);
WTF_LOG(Media, "HTMLMediaElement::selectMediaResource(%p), nothing to load", this);
return;
@@ -944,8 +943,7 @@ void HTMLMediaElement::loadResource(const KURL& url, ContentType& contentType, c
startProgressEventTimer();
- // Reset display mode to force a recalculation of what to show because we are resetting the player.
- setDisplayMode(Unknown);
+ setShowPoster(true);
setPlayerPreload();
@@ -989,7 +987,7 @@ void HTMLMediaElement::loadResource(const KURL& url, ContentType& contentType, c
// If there is no poster to display, allow the media engine to render video frames as soon as
// they are available.
- updateDisplayState();
+ updateDisplayState(false);
if (layoutObject())
layoutObject()->updateFromElement();
@@ -1241,7 +1239,7 @@ void HTMLMediaElement::waitForSourceChange()
// 6.18 - Set the element's delaying-the-load-event flag to false. This stops delaying the load event.
setShouldDelayLoadEvent(false);
- updateDisplayState();
+ updateDisplayState(false);
if (layoutObject())
layoutObject()->updateFromElement();
@@ -1280,7 +1278,7 @@ void HTMLMediaElement::noneSupported()
// 9 - Abort these steps. Until the load() method is invoked or the src attribute is changed,
// the element won't attempt to load another resource.
- updateDisplayState();
+ updateDisplayState(false);
if (layoutObject())
layoutObject()->updateFromElement();
@@ -1366,7 +1364,7 @@ void HTMLMediaElement::mediaLoadingFailed(WebMediaPlayer::NetworkState error)
&& m_loadState == LoadingFromSrcAttr)
noneSupported();
- updateDisplayState();
+ updateDisplayState(false);
if (mediaControls())
mediaControls()->reset();
}
@@ -1569,7 +1567,7 @@ void HTMLMediaElement::setReadyState(ReadyState state)
}
if (shouldUpdateDisplayState) {
- updateDisplayState();
+ updateDisplayState(false);
if (mediaControls())
mediaControls()->refreshClosedCaptionsButtonVisibility();
}
@@ -1711,7 +1709,7 @@ void HTMLMediaElement::finishSeek()
// 17 - Queue a task to fire a simple event named seeked at the element.
scheduleEvent(EventTypeNames::seeked);
- setDisplayMode(Video);
+ setShowPoster(false);
}
HTMLMediaElement::ReadyState HTMLMediaElement::readyState() const
@@ -2846,7 +2844,7 @@ void HTMLMediaElement::repaint()
if (m_webLayer)
m_webLayer->invalidate();
- updateDisplayState();
+ updateDisplayState(false);
if (layoutObject())
layoutObject()->setShouldDoFullPaintInvalidation();
}
@@ -2959,7 +2957,7 @@ void HTMLMediaElement::updatePlayState()
this, boolString(shouldBePlaying), boolString(isPlaying));
if (shouldBePlaying) {
- setDisplayMode(Video);
+ setShowPoster(false);
invalidateCachedTime();
if (!isPlaying) {
« no previous file with comments | « Source/core/html/HTMLMediaElement.h ('k') | Source/core/html/HTMLVideoElement.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698