Summary: | Introduce a new abstract class called AudioProducer and keep a set of AudioProducers rather than the active MediaSessions in Document | ||||||
---|---|---|---|---|---|---|---|
Product: | WebKit | Reporter: | Ada Chan <adachan> | ||||
Component: | Media | Assignee: | Ada Chan <adachan> | ||||
Status: | RESOLVED FIXED | ||||||
Severity: | Normal | CC: | adachan, buildbot, calvaris, commit-queue, eric.carlson, esprehn+autocc, glenn, gyuyoung.kim, jer.noble, kangil.han, philipj, rniwa, sergio | ||||
Priority: | P2 | ||||||
Version: | 528+ (Nightly build) | ||||||
Hardware: | Unspecified | ||||||
OS: | Unspecified | ||||||
Attachments: |
|
Description
Ada Chan
2014-10-27 15:39:54 PDT
Created attachment 240517 [details]
Patch
Comment on attachment 240517 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=240517&action=review > Source/WebCore/html/HTMLMediaElement.cpp:6028 > +bool HTMLMediaElement::isPlayingAudio() > +{ > + return m_mediaSession->hasMediaCharacteristics(MediaSession::MediaCharacteristicAudible) && m_mediaSession->state() == MediaSession::Playing; > +} Nit: why ask the session when it will just call back into HTMLMediaElement? Something like "return hasAudio() && isPlaying()" should be equivalent. (In reply to comment #2) > Comment on attachment 240517 [details] > Patch > > View in context: > https://bugs.webkit.org/attachment.cgi?id=240517&action=review > > > Source/WebCore/html/HTMLMediaElement.cpp:6028 > > +bool HTMLMediaElement::isPlayingAudio() > > +{ > > + return m_mediaSession->hasMediaCharacteristics(MediaSession::MediaCharacteristicAudible) && m_mediaSession->state() == MediaSession::Playing; > > +} > > Nit: why ask the session when it will just call back into HTMLMediaElement? > Something like "return hasAudio() && isPlaying()" should be equivalent. I changed it to call hasAudio() directly. I'm still querying m_mediaSession's state here for now because HTMLMediaElement::m_playing is not updated to the correct value yet when MediaSession::setState() is called (which triggers Document::updateIsPlayingAudio() to be called). I've filed https://bugs.webkit.org/show_bug.cgi?id=138153. That bug will cover removing Remove MediaSessionClient::hasMediaCharacteristics() and MediaSessionClient::mediaStateDidChange(). As part of that change, I'll call Document::updateIsPlayingAudio() after HTMLMediaElement::m_playing has been updated, and then I can change HTMLMediaElement::isPlayingAudio() to call isPlaying() directly. Committed: http://trac.webkit.org/changeset/175273 |