Bug 220879

Summary: [iOS] Set background playback restriction for WebAudio
Product: WebKit Reporter: Eric Carlson <eric.carlson>
Component: MediaAssignee: Eric Carlson <eric.carlson>
Status: RESOLVED FIXED    
Severity: Normal CC: ews-watchlist, glenn, jer.noble, philipj, sergio, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Patch
none
Patch for landing none

Eric Carlson
Reported 2021-01-22 15:17:08 PST
WebAudio does not play in the background on iOS both because audio doesn't play when the category is set to `AVAudioSessionCategoryAmbient`, and because the AudioContext is paused when the web process is forwarded the `UIApplicationWillResignActiveNotification` notification. This notification isn't forwarded when the WebView is hosted in SafariViewController so the AudioContext is not paused, so it resumes playing when the application is foregrounded even if the view controller is not in the foreground.
Attachments
Patch (6.92 KB, patch)
2021-01-22 15:39 PST, Eric Carlson
no flags
Patch for landing (7.78 KB, patch)
2021-01-23 09:58 PST, Eric Carlson
no flags
Eric Carlson
Comment 1 2021-01-22 15:18:13 PST
Eric Carlson
Comment 2 2021-01-22 15:39:02 PST
Eric Carlson
Comment 3 2021-01-23 09:58:12 PST
Created attachment 418227 [details] Patch for landing
EWS
Comment 4 2021-01-23 12:31:42 PST
Committed r271779: <https://trac.webkit.org/changeset/271779> All reviewed patches have been landed. Closing bug and clearing flags on attachment 418227 [details].
Note You need to log in before you can comment on or make changes to this bug.