Bug 35327 - supportsMuting() Should be internal interface between MediaPlayer and MediaPlayerPrivate
Summary: supportsMuting() Should be internal interface between MediaPlayer and MediaPl...
Alias: None
Product: WebKit
Classification: Unclassified
Component: Media (show other bugs)
Version: 528+ (Nightly build)
Hardware: All All
: P2 Normal
Assignee: Nobody
Depends on:
Reported: 2010-02-23 21:40 PST by Nick Young
Modified: 2010-02-24 21:25 PST (History)
2 users (show)

See Also:

Initial Patch (3.25 KB, patch)
2010-02-23 21:52 PST, Nick Young
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
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!

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.