Our iOS app plays Apple Music catalog videos using MusicKit JS v3 in WKWebView. We use a WebView, with the current video visible. Tests are on an iPhone 16e running iOS 26.6.2, built with SDK 27.1.
Inline playback and PiP are allowed, background audio is enabled, and the system’s automatic PiP setting is on.
A real button click calling video.requestPictureInPicture() successfully opens PiP, which continues playing when returning to the Home Screen.
However, leaving the app without opening PiP manually produces audio only.
We tested both public video PiP APIs, including an early request from UIScene.willDeactivateNotification. In the latest trace, AVKit reports a visible, supported and eligible source, then reads ForegroundInactive and immediately reports “Failed to start picture in picture.”
The video briefly reports PiP mode before returning inline; no PiP window appears.
Our WebKit audio session also changes from ambient to auto on deactivation; its contribution has not been isolated.
- Is automatic inline PiP supported for MusicKit JS videos in WKWebView?
- Is there a supported configuration or initialization hook to prepare it while the scene is still active? We do not own WebKit’s underlying controller to set
canStartPictureInPictureAutomaticallyFromInline. - What lifecycle and audio-session setup does Apple recommend? If this behavior is unexpected, which minimal reproduction and diagnostics would help DTS investigate?