Bug 173932 - [iOS] Allow WKWebView clients to play audio in the background
Summary: [iOS] Allow WKWebView clients to play audio in the background
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Media (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Chris Dumez
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2017-06-28 12:07 PDT by Chris Dumez
Modified: 2017-06-28 16:22 PDT (History)
7 users (show)

See Also:


Attachments
Patch (2.46 KB, patch)
2017-06-28 12:26 PDT, Chris Dumez
rniwa: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
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>