| 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 5a63b92a411057bd6934052df59836e6eadb1078..9bc2246e4ea01c0dfbb5554fa31969bafe85af2a 100644
|
| --- a/third_party/WebKit/Source/core/html/HTMLMediaElement.cpp
|
| +++ b/third_party/WebKit/Source/core/html/HTMLMediaElement.cpp
|
| @@ -2285,6 +2285,7 @@ void HTMLMediaElement::setMuted(bool muted)
|
| return;
|
|
|
| bool wasAutoplayingMuted = !paused() && m_muted && isLockedPendingUserGesture();
|
| + bool wasPendingAutoplayMuted = m_autoplayVisibilityObserver && paused() && m_muted && isLockedPendingUserGesture();
|
|
|
| if (UserGestureIndicator::processingUserGesture())
|
| unlockUserGesture();
|
| @@ -2311,6 +2312,13 @@ void HTMLMediaElement::setMuted(bool muted)
|
| recordAutoplayUnmuteStatus(AutoplayUnmuteActionSuccess);
|
| }
|
| }
|
| +
|
| + // 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) {
|
| + m_autoplayVisibilityObserver->stop();
|
| + m_autoplayVisibilityObserver = nullptr;
|
| + }
|
| }
|
|
|
| void HTMLMediaElement::updateVolume()
|
|
|