Calling WebCore::Page::setMediaVolume(0) does not mute videos as expected.
authoradachan@apple.com <adachan@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 22 Oct 2014 00:17:46 +0000 (00:17 +0000)
committeradachan@apple.com <adachan@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 22 Oct 2014 00:17:46 +0000 (00:17 +0000)
https://bugs.webkit.org/show_bug.cgi?id=137305

Reviewed by Darin Adler.

This was broken in http://trac.webkit.org/changeset/154970. To fix this (but not break
GStreamer), remove the "if (m_volumeInitialized)" check before updating the MediaPlayer's
volume to the value multiplied with the Page's mediaVolume. This should not affect GStreamer's
behavior because MediaPlayerPrivateGStreamerBase::setStreamVolumeElement does nothing unless
m_volumeInitialized is true.

* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::updateVolume):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@175003 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Source/WebCore/ChangeLog
Source/WebCore/html/HTMLMediaElement.cpp

index 2c05a7d..d04f92d 100644 (file)
@@ -1,3 +1,19 @@
+2014-10-21  Ada Chan  <adachan@apple.com>
+
+        Calling WebCore::Page::setMediaVolume(0) does not mute videos as expected.
+        https://bugs.webkit.org/show_bug.cgi?id=137305
+
+        Reviewed by Darin Adler.
+
+        This was broken in http://trac.webkit.org/changeset/154970. To fix this (but not break
+        GStreamer), remove the "if (m_volumeInitialized)" check before updating the MediaPlayer's
+        volume to the value multiplied with the Page's mediaVolume. This should not affect GStreamer's
+        behavior because MediaPlayerPrivateGStreamerBase::setStreamVolumeElement does nothing unless
+        m_volumeInitialized is true.
+
+        * html/HTMLMediaElement.cpp:
+        (WebCore::HTMLMediaElement::updateVolume):
+
 2014-10-21  Jer Noble  <jer.noble@apple.com>
 
         [EME][Mac] Update to match new AVStreamSession API and requirements.
index 1daab18..204d20c 100644 (file)
@@ -4477,8 +4477,7 @@ void HTMLMediaElement::updateVolume()
         }
 
         m_player->setMuted(shouldMute);
-        if (m_volumeInitialized)
-            m_player->setVolume(m_volume * volumeMultiplier);
+        m_player->setVolume(m_volume * volumeMultiplier);
     }
 
     if (hasMediaControls())