Chromium Code Reviews| 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 c7685babd45c0dc954c0a852c454b8367de70065..a9133111dd5d151aa9bfcde0de79bff7e8aab72b 100644 |
| --- a/third_party/WebKit/Source/core/html/shadow/MediaControls.cpp |
| +++ b/third_party/WebKit/Source/core/html/shadow/MediaControls.cpp |
| @@ -705,6 +705,21 @@ void MediaControls::onTimeUpdate() { |
| makeTransparent(); |
| } |
| +void MediaControls::onDurationChange() { |
| + m_timeline->setDuration(mediaElement().duration()); |
| + updateCurrentTimeDisplay(); |
| + |
| + // 'durationchange' might be called in a paused state. The controls should not |
| + // become transparent in that case. |
| + if (mediaElement().paused()) { |
| + makeOpaque(); |
| + return; |
| + } |
| + |
| + if (isVisible() && shouldHideMediaControls()) |
| + makeTransparent(); |
|
mlamouri (slow - plz ping)
2016/12/13 20:00:00
I don't think you need to do all the transparency
Zhiqiang Zhang (Slow)
2016/12/13 20:13:20
Done.
|
| +} |
| + |
| void MediaControls::onPlay() { |
| updatePlayState(); |
| m_timeline->setPosition(mediaElement().currentTime()); |