Chromium Code Reviews| 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 441ee5b55a8b6e020d888087c1062bc553bea0e0..bf72ca0499e69b0bf99442d9f11d7ecc1269eeee 100644 |
| --- a/third_party/WebKit/Source/core/html/HTMLMediaElement.cpp |
| +++ b/third_party/WebKit/Source/core/html/HTMLMediaElement.cpp |
| @@ -2260,6 +2260,9 @@ void HTMLMediaElement::setMuted(bool muted) |
| { |
| DVLOG(MEDIA_LOG_LEVEL) << "setMuted(" << (void*)this << ", " << boolString(muted) << ")"; |
| + if (UserGestureIndicator::processingUserGesture()) |
| + unlockUserGesture(); |
| + |
| if (m_muted == muted) |
| return; |
| @@ -2274,6 +2277,10 @@ void HTMLMediaElement::setMuted(bool muted) |
| Platform::current()->recordAction(UserMetricsAction("Media_Playback_Mute_Off")); |
| scheduleEvent(EventTypeNames::volumechange); |
| + |
| + // Pause the element when unmuting if there was no user gesture. |
|
mlamouri (slow - plz ping)
2016/06/09 17:43:16
nit: s/if there was no user gesture./if the elemen
|
| + if (!muted && isGestureNeededForPlayback()) |
| + pause(); |
| } |
| void HTMLMediaElement::updateVolume() |