| Index: third_party/WebKit/Source/core/html/HTMLMediaElement.cpp
|
| diff --git a/third_party/WebKit/Source/core/html/HTMLMediaElement.cpp b/third_party/WebKit/Source/core/html/HTMLMediaElement.cpp
|
| index d1a8bdf5736319ee04f4d0c88e9b32c2d014af0b..833fef54fe0611793710a84245bee3cf1008c16a 100644
|
| --- a/third_party/WebKit/Source/core/html/HTMLMediaElement.cpp
|
| +++ b/third_party/WebKit/Source/core/html/HTMLMediaElement.cpp
|
| @@ -1090,7 +1090,6 @@ void HTMLMediaElement::loadResource(const WebMediaPlayerSource& source,
|
|
|
| if (fastHasAttribute(mutedAttr))
|
| m_muted = true;
|
| - updateVolume();
|
|
|
| DCHECK(!m_mediaSource);
|
|
|
| @@ -2419,7 +2418,9 @@ void HTMLMediaElement::setVolume(double vol, ExceptionState& exceptionState) {
|
| }
|
|
|
| m_volume = vol;
|
| - updateVolume();
|
| +
|
| + if (webMediaPlayer())
|
| + webMediaPlayer()->setVolume(effectiveMediaVolume());
|
| scheduleEvent(EventTypeNames::volumechange);
|
| }
|
|
|
| @@ -2461,7 +2462,8 @@ void HTMLMediaElement::setMuted(bool muted) {
|
|
|
| // This is called after the volumechange event to make sure isAutoplayingMuted
|
| // returns the right value when webMediaPlayer receives the volume update.
|
| - updateVolume();
|
| + if (webMediaPlayer())
|
| + webMediaPlayer()->setVolume(effectiveMediaVolume());
|
|
|
| // If an element was a candidate for autoplay muted but not visible, it will
|
| // have a visibility observer ready to start its playback.
|
| @@ -2471,14 +2473,6 @@ void HTMLMediaElement::setMuted(bool muted) {
|
| }
|
| }
|
|
|
| -void HTMLMediaElement::updateVolume() {
|
| - if (webMediaPlayer())
|
| - webMediaPlayer()->setVolume(effectiveMediaVolume());
|
| -
|
| - if (mediaControls())
|
| - mediaControls()->updateVolume();
|
| -}
|
| -
|
| double HTMLMediaElement::effectiveMediaVolume() const {
|
| if (m_muted)
|
| return 0;
|
| @@ -3327,7 +3321,7 @@ void HTMLMediaElement::updatePlayState() {
|
| // media engine was setup. The media engine should just stash the rate
|
| // and muted values since it isn't already playing.
|
| webMediaPlayer()->setRate(playbackRate());
|
| - updateVolume();
|
| + webMediaPlayer()->setVolume(effectiveMediaVolume());
|
| webMediaPlayer()->play();
|
| m_autoplayHelper->playbackStarted();
|
| }
|
| @@ -3801,14 +3795,6 @@ bool HTMLMediaElement::isInteractiveContent() const {
|
| return fastHasAttribute(controlsAttr);
|
| }
|
|
|
| -void HTMLMediaElement::defaultEventHandler(Event* event) {
|
| - if (event->type() == EventTypeNames::focusin) {
|
| - if (mediaControls())
|
| - mediaControls()->mediaElementFocused();
|
| - }
|
| - HTMLElement::defaultEventHandler(event);
|
| -}
|
| -
|
| DEFINE_TRACE(HTMLMediaElement) {
|
| visitor->trace(m_playedTimeRanges);
|
| visitor->trace(m_asyncEventQueue);
|
|
|