Bug 173932

Summary: [iOS] Allow WKWebView clients to play audio in the background
Product: WebKit Reporter: Chris Dumez <cdumez>
Component: MediaAssignee: Chris Dumez <cdumez>
Status: RESOLVED FIXED    
Severity: Normal CC: barraclough, eric.carlson, jer.noble, jonlee, rniwa, sam, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Patch rniwa: review+

Description Chris Dumez 2017-06-28 12:07:02 PDT
Allow MobileSafari to play audio in the background by taking a process assertion whenever a WebPage is audible.
Comment 1 Chris Dumez 2017-06-28 12:07:27 PDT
<rdar://problem/32851547>
Comment 2 Chris Dumez 2017-06-28 12:26:47 PDT
Created attachment 314052 [details]
Patch
Comment 3 Sam Weinig 2017-06-28 14:18:18 PDT
Comment on attachment 314052 [details]
Patch

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

> Source/WebKit2/ChangeLog:10
> +        Allow MobileSafari to play audio in the background by taking a process assertion
> +        whenever a WebPage is audible.

Does this behavior make sense for all iOS WebKit clients?
Comment 4 Chris Dumez 2017-06-28 14:32:43 PDT
(In reply to Sam Weinig from comment #3)
> Comment on attachment 314052 [details]
> Patch
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=314052&action=review
> 
> > Source/WebKit2/ChangeLog:10
> > +        Allow MobileSafari to play audio in the background by taking a process assertion
> > +        whenever a WebPage is audible.
> 
> Does this behavior make sense for all iOS WebKit clients?

This is fixing a regression in iOS 11. Previously, we would use mediaserverd and apps using WebViews could play audio in the background. In iOS11 however, we do the networking by ourselves instead of using mediaserverd, and we need to keep the NetworkProcess alive as well to maintain feature-parity.

Despite the bug title, this is not and is not intended to be specific to MobileSafari.
Comment 5 Ryosuke Niwa 2017-06-28 16:14:34 PDT
Comment on attachment 314052 [details]
Patch

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

> Source/WebKit2/ChangeLog:3
> +        [iOS] Allow MobileSafari to play audio in the background

Please fix the bug title accordingly since this applies to WKWebView clients other than MobileSafari.
Comment 6 Chris Dumez 2017-06-28 16:22:33 PDT
Committed r218902: <http://trac.webkit.org/changeset/218902>