Summary: | [iOS] HTMLMediaSession should set AudioSession category | ||||||
---|---|---|---|---|---|---|---|
Product: | WebKit | Reporter: | Eric Carlson <eric.carlson> | ||||
Component: | Media | Assignee: | Eric Carlson <eric.carlson> | ||||
Status: | RESOLVED FIXED | ||||||
Severity: | Normal | CC: | commit-queue, esprehn+autocc, glenn, gyuyoung.kim, jer.noble | ||||
Priority: | P2 | ||||||
Version: | 528+ (Nightly build) | ||||||
Hardware: | Unspecified | ||||||
OS: | Unspecified | ||||||
Attachments: |
|
Description
Eric Carlson
2014-01-16 13:08:44 PST
Created attachment 221406 [details]
Proposed patch
Comment on attachment 221406 [details] Proposed patch View in context: https://bugs.webkit.org/attachment.cgi?id=221406&action=review > Source/WebCore/html/HTMLMediaSession.cpp:58 > +#if PLATFORM(IOS) > +static void initializeAudioSession() > +{ > + static bool wasAudioSessionInitialized; > + if (wasAudioSessionInitialized) > + return; > + > + wasAudioSessionInitialized = true; > + if (!WebCore::applicationIsMobileSafari()) > + return; > + > + AudioSession::sharedSession().setCategory(AudioSession::MediaPlayback); > +} > +#endif Why do we only want to do this on iOS (and only in MobileSafari)? > Source/WebCore/html/HTMLMediaSession.cpp:71 > +#if PLATFORM(IOS) > + initializeAudioSession(); > +#endif I would rather we always call this, and have it do nothing on platforms that don't need it. (In reply to comment #2) > (From update of attachment 221406 [details]) > View in context: https://bugs.webkit.org/attachment.cgi?id=221406&action=review > > > Source/WebCore/html/HTMLMediaSession.cpp:58 > > +#if PLATFORM(IOS) > > +static void initializeAudioSession() > > +{ > > + static bool wasAudioSessionInitialized; > > + if (wasAudioSessionInitialized) > > + return; > > + > > + wasAudioSessionInitialized = true; > > + if (!WebCore::applicationIsMobileSafari()) > > + return; > > + > > + AudioSession::sharedSession().setCategory(AudioSession::MediaPlayback); > > +} > > +#endif > > Why do we only want to do this on iOS (and only in MobileSafari)? > AudioSession only has category support on iOS. We only set the category in MobileSafari because apps using a UIWebView may need to use another category, and can do so with the UIWebView. > > Source/WebCore/html/HTMLMediaSession.cpp:71 > > +#if PLATFORM(IOS) > > + initializeAudioSession(); > > +#endif > > I would rather we always call this, and have it do nothing on platforms that don't need it. > OK, I will fix this in a follow-up. (In reply to comment #3) > (In reply to comment #2) > > I would rather we always call this, and have it do nothing on platforms that don't need it. > > > OK, I will fix this in a follow-up. By which I meant "I will fix this when I check in". Committed r162221: http://trac.webkit.org/changeset/162221 |