[quote='819235021, jimmykuo, /thread/819235, /profile/jimmykuo'] Is there any way to programmatically enter PIP from inline playback when a WKWebView app goes to background? Or is this intentionally restricted by WebKit to fullscreen-only transitions? [/quote] Without user interaction, such as a button press, transitioning to PiP automatically would require AVPlayerViewController to be implemented in the inline video. The issue here is playsinline does not hand the video off to AVPlayerViewController. Once the inline video uses AVPlayerViewController, you can implement automatic switching to PiP by enabling canStartPictureInPictureAutomaticallyFromInline. This is mentioned in Adopting Picture in Picture in a Standard Player As for your testing: visibilitychange is not considered user interaction. Only begin PiP playback in response to user interaction and never programmatically. For example, webkitSetPresentationMode will trigger PiP if it is set as the action of a button. In the situations where the video do
Topic:
Safari & Web
SubTopic:
General
Tags: