Bug 35327

Summary: supportsMuting() Should be internal interface between MediaPlayer and MediaPlayerPrivate
Product: WebKit Reporter: Nick Young <nicholas.young>
Component: MediaAssignee: Nobody <webkit-unassigned>
Status: RESOLVED FIXED    
Severity: Normal CC: commit-queue, eric.carlson
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: All   
OS: All   
Attachments:
Description Flags
Initial Patch none

Description Nick Young 2010-02-23 21:40:05 PST
At the moment there is a bug with supportsMuting() under the following scenario:

1. setMuted() is called on the HTMLMediaElement before the MediaPlayer is constructed in loadResource().
m_muted in HTMLMediaElement is set to true, but nothing else of interest happens.

2. The MediaPlayer is contructed during loadResource and updateVolume() is called.
updateVolume() assumes that supportsMuting() == false, and sets the volume of the MediaPlayer to 0 (because m_muted is true).

3. MediaPlayer loads a media engine which supports muting. Subsequent calls to supportsMuting() will return true.

4. Attempting to unmute the media element at this point is unsuccessful. MediaPlayer::m_muted changes, but MediaPlayer::m_volume is still zero.

This can be solved by making sure that HTMLMediaElement::updateVolume() checks for supportsMuting(), and moving the call to updateVolume() in loadResource() to after the call to load() (i.e. Media Engine Selection).

HOWEVER, I don't believe this is the correct solution. Why are we exposing supportsMuting() to HTMLMediaElement at all?
This should be interface which exists only between MediaPlayer and MediaPlayerPrivate.

Patch forthcoming.
Comment 1 Nick Young 2010-02-23 21:52:47 PST
Created attachment 49356 [details]
Initial Patch

Cleaner interface. Solves a bug.

Win-Win :-)
Comment 2 Eric Carlson 2010-02-24 07:17:38 PST
Comment on attachment 49356 [details]
Initial Patch

Very nice, thank you!

r=me
Comment 3 WebKit Commit Bot 2010-02-24 19:34:40 PST
Comment on attachment 49356 [details]
Initial Patch

Clearing flags on attachment: 49356

Committed r55213: <http://trac.webkit.org/changeset/55213>
Comment 4 WebKit Commit Bot 2010-02-24 19:34:43 PST
All reviewed patches have been landed.  Closing bug.