Bug 188127

Summary: [iOS] Don't deactivate audio session
Product: WebKit Reporter: Eric Carlson <eric.carlson>
Component: MediaAssignee: Eric Carlson <eric.carlson>
Status: RESOLVED FIXED    
Severity: Normal CC: commit-queue, darin, jonlee, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: Other   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Patch none

Description Eric Carlson 2018-07-27 15:53:44 PDT
r233435 includes a change that deactivates the shared audio session when there are no more active media elements. This is a good in WK2 because it allows other applications to resume playing audio when WebKit stops playing, but it is potentially bad in WK1 where the host app may also be playing audio. Remove the code for now.
Comment 1 Eric Carlson 2018-07-27 15:55:28 PDT
<rdar://problem/42544143>
Comment 2 Eric Carlson 2018-07-27 16:11:21 PDT
Created attachment 345966 [details]
Patch
Comment 3 Jon Lee 2018-07-27 16:57:36 PDT
Comment on attachment 345966 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=345966&action=review

> Source/WebCore/platform/audio/PlatformMediaSessionManager.cpp:-167
> -#endif

Can we write a test for this?
Comment 4 WebKit Commit Bot 2018-07-27 17:24:09 PDT
Comment on attachment 345966 [details]
Patch

Clearing flags on attachment: 345966

Committed r234339: <https://trac.webkit.org/changeset/234339>
Comment 5 WebKit Commit Bot 2018-07-27 17:24:11 PDT
All reviewed patches have been landed.  Closing bug.
Comment 6 Darin Adler 2018-07-28 15:28:56 PDT
Comment on attachment 345966 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=345966&action=review

> Source/WebCore/ChangeLog:12
> +        r233435 includes a change that deactivates the shared audio session when there are no more
> +        active media sessions. This is a good in WK2 because it allows other applications to resume
> +        playing audio when WebKit stops playing, but it is potentially bad in WK1 where the host
> +        app may also be playing audio.

So why didn’t we keep it for WK2?
Comment 7 Eric Carlson 2018-07-28 17:12:52 PDT
Comment on attachment 345966 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=345966&action=review

>> Source/WebCore/ChangeLog:12
>> +        app may also be playing audio.
> 
> So why didn’t we keep it for WK2?

I filed rdar://42678977 to add it back for WK2, but there are potential issues we need to investigate first (eg. rdar://42672521, rdar://42267132).
Comment 8 Eric Carlson 2019-01-07 13:22:23 PST
(In reply to Eric Carlson from comment #7)
> Comment on attachment 345966 [details]
> Patch
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=345966&action=review
> 
> >> Source/WebCore/ChangeLog:12
> >> +        app may also be playing audio.
> > 
> > So why didn’t we keep it for WK2?
> 
> I filed rdar://42678977 to add it back for WK2, but there are potential
> issues we need to investigate first (eg. rdar://42672521, rdar://42267132).

Fixed in bug 193188.