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 7d88fc290a96ebbcab97133b577b56a7a49b07f2..79681ec8c51f0de70f99218df24faf649d969344 100644 |
--- a/third_party/WebKit/Source/core/html/HTMLMediaElement.cpp |
+++ b/third_party/WebKit/Source/core/html/HTMLMediaElement.cpp |
@@ -2292,10 +2292,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, |
// otherwise, it will be paused. |
if (wasAutoplayingMuted) { |
@@ -2309,6 +2305,10 @@ void HTMLMediaElement::setMuted(bool muted) { |
} |
} |
+ updateVolume(); |
+ |
+ scheduleEvent(EventTypeNames::volumechange); |
foolip
2016/10/10 11:33:07
This will change the order of events from volumech
mlamouri (slow - plz ping)
2016/10/31 15:27:41
Just to clarify, do you want me to revert the chan
foolip
2016/11/01 16:12:21
Maintaining the event order seems best, yeah.
|
+ |
// 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) { |
@@ -3018,6 +3018,14 @@ void HTMLMediaElement::cancelledRemotePlaybackRequest() { |
remotePlaybackClient()->promptCancelled(); |
} |
+bool HTMLMediaElement::isAutoplayingMuted() { |
+ if (!isHTMLVideoElement() || |
+ !RuntimeEnabledFeatures::autoplayMutedVideosEnabled()) |
+ return false; |
+ |
+ return muted() && isLockedPendingUserGesture(); |
foolip
2016/10/10 11:33:07
This will return true even if not actually playing
mlamouri (slow - plz ping)
2016/10/31 15:27:41
That was on purpose but I've added a check to make
|
+} |
+ |
void HTMLMediaElement::requestReload(const WebURL& newUrl) { |
DCHECK(webMediaPlayer()); |
DCHECK(!m_srcObject); |