Videos presented from UIWebView don't respect MPRemoteCommandCenter

Originator:tom.irving
Number:rdar://29159762 Date Originated:8/11/2016
Status:Open Resolved:
Product:iOS Product Version:9 and above
Classification:UI/Usability Reproducible:Always
 
Area:
WebKit

Summary:
When an AVPlayerViewController is presented from a UIWebView, after dismissal, the lock screen / command center will play the dismissed video even if the app plays separate audio via AVPlayer or similar.

In the case of the app playing audio in addition to the video presented by UIWebView, the video is re-presented and the audio plays along side the other AVPlayer audio

Steps to Reproduce:
See example app:
1. Launch app, music begins to play
2. Drag open the control center and pause the audio
3. Dismiss control center
4. Launch YouTube video after it loads in the UIWebView
5. Dismiss YouTube video
6. Drag open the control center and hit play

Expected Results:
The app's audio continues playing (radio stream)

Actual Results:
The dismissed AVPlayerViewController presented by the UIWebView is re-presented and begins playing the YouTube video as well as playing the radio stream.

Version:
iOS 9 and above

Notes:
Additionally, the UIWebView doesn't send an Audio Interrupt to give the app a chance to stop / restart its own audio. Notifications on UIWindowDidBecomeVisibleNotification and UIWindowDidBecomeHiddenNotification are required to catch the presentation and dismissal of the video controller from UIWebView

Configuration:
All iOS devices

Attachments:
'WebViewAVPlayerBug.zip' was successfully uploaded.

Comments


Please note: Reports posted here will not necessarily be seen by Apple. All problems should be submitted at bugreport.apple.com before they are posted here. Please only post information for Radars that you have filed yourself, and please do not include Apple confidential information in your posts. Thank you!