Index: third_party/WebKit/Source/core/html/shadow/MediaControls.cpp |
diff --git a/third_party/WebKit/Source/core/html/shadow/MediaControls.cpp b/third_party/WebKit/Source/core/html/shadow/MediaControls.cpp |
index 6fcf2642e672bbb9fa145f243b43bcf7045fa993..ee06e67b169c75f739f3c041dec6a96c2ce1d66d 100644 |
--- a/third_party/WebKit/Source/core/html/shadow/MediaControls.cpp |
+++ b/third_party/WebKit/Source/core/html/shadow/MediaControls.cpp |
@@ -205,6 +205,7 @@ MediaControls::MediaControls(HTMLMediaElement& mediaElement) |
m_hideTimerBehaviorFlags(IgnoreNone), |
m_isMouseOverControls(false), |
m_isPausedForScrubbing(false), |
+ m_hasNeverBeenPlayed(true), |
m_resizeObserver(ResizeObserver::create( |
mediaElement.document(), |
new MediaControlsResizeObserverCallback(this))), |
@@ -845,6 +846,11 @@ void MediaControls::onDurationChange() { |
} |
void MediaControls::onPlay() { |
+ if (m_hasNeverBeenPlayed) { |
+ m_timeline->recordWidthOnFirstPlay(); |
+ m_hasNeverBeenPlayed = false; |
+ } |
mlamouri (slow - plz ping)
2017/03/30 21:43:00
Would it make sense to have this in onLoadedMetada
johnme
2017/03/31 13:47:23
Moved to a new onPlayed event as discussed.
|
+ |
updatePlayState(); |
m_timeline->setPosition(mediaElement().currentTime()); |
updateCurrentTimeDisplay(); |