I have a simple test page with a video element in it:
<div id=target style="border: solid;">
<video src="http://movies.apple.com/movies/us/apple/ipoditunes/2007/touch/ads/apple_ipodtouch_touch_r640-9cie.mov" autoplay controls></video>
I set the page's media volume to 0 with WKPageSetMediaVolume(0). But I can still hear the video playing.
Looking at HTMLMediaElement::updateVolume(), it looks like the volume multiplier is only applied if m_volumeInitialized is true, and in this case it's not.
Looks like this was broken in http://trac.webkit.org/changeset/154970.
Removing the "if (m_volumeInitialized)" check in HTMLMediaElement::updateVolume will fix this problem, and I don't *think* it will change the GStreamer behavior because MediaPlayerPrivateGStreamerBase::setStreamVolumeElement does nothing unless m_volumeInitialized is true (HTMLMediaElement::mediaPlayerPlatformVolumeConfigurationRequired).
Sorry for the breakage :(
Looking at r154970 too, I agree with Eric that it should be enough to remove the "if (m_volumeInitialized)" test from ::updateVolume()
Created attachment 240225 [details]
Please let me know if there's a way to write a test for this.
(In reply to comment #5)
> Created attachment 240225 [details]
> Please let me know if there's a way to write a test for this.
I don't think there is a way to add a test for this change, because any problems will only happen to users of the GTK port with some versions of pulse audio.
You might be able to add a test for Page::setMediaVolume to ensure that it isn't broken in the future, but that will require fairly invasive changes so I am not sure it is worth while.
Eric and Philippe: thanks for your help!