| 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 97ece0f6a33a98bf679519fbd12e1112e291404f..e94419abf9a06c79c5d721e5d367b329e5b83cf6 100644
|
| --- a/third_party/WebKit/Source/core/html/HTMLMediaElement.cpp
|
| +++ b/third_party/WebKit/Source/core/html/HTMLMediaElement.cpp
|
| @@ -2347,8 +2347,7 @@ void HTMLMediaElement::setMuted(bool muted) {
|
| if (m_muted == muted)
|
| return;
|
|
|
| - bool wasAutoplayingMuted =
|
| - !paused() && m_muted && isLockedPendingUserGesture();
|
| + bool wasAutoplayingMuted = isAutoplayingMuted();
|
| bool wasPendingAutoplayMuted = m_autoplayVisibilityObserver && paused() &&
|
| m_muted && isLockedPendingUserGesture();
|
|
|
| @@ -2358,8 +2357,6 @@ void HTMLMediaElement::setMuted(bool muted) {
|
| m_muted = muted;
|
| m_autoplayHelper->mutedChanged();
|
|
|
| - updateVolume();
|
| -
|
| scheduleEvent(EventTypeNames::volumechange);
|
|
|
| // If an element autoplayed while muted, it needs to be unlocked to unmute,
|
| @@ -2375,6 +2372,10 @@ 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 an element was a candidate for autoplay muted but not visible, it will
|
| // have a visibility observer ready to start its playback.
|
| if (wasPendingAutoplayMuted) {
|
| @@ -3103,6 +3104,15 @@ void HTMLMediaElement::cancelledRemotePlaybackRequest() {
|
| remotePlaybackClient()->promptCancelled();
|
| }
|
|
|
| +bool HTMLMediaElement::isAutoplayingMuted() {
|
| + if (!isHTMLVideoElement() ||
|
| + !RuntimeEnabledFeatures::autoplayMutedVideosEnabled()) {
|
| + return false;
|
| + }
|
| +
|
| + return !paused() && muted() && isLockedPendingUserGesture();
|
| +}
|
| +
|
| void HTMLMediaElement::requestReload(const WebURL& newUrl) {
|
| DCHECK(webMediaPlayer());
|
| DCHECK(!m_srcObject);
|
|
|