Safari 10 introduces picture in picture. The button is there for html5 video standard controls, but how do I trigger it by javascript?
Apple says:
If you use custom HTML5 video controls, you can add Picture in Picture functionality using the JavaScript presentation mode API.
With no further references.
In the Safari app on your Mac, navigate to the web video you want to play. Click and hold the Audio button in the Smart Search field or in a tab. Choose Enter Picture in Picture. You can drag the window to any corner of the screen and the window stays put, even if you switch desktop spaces.
PiPifier is a native macOS 10.12 Safari extension that lets you use every HTML5 video in Picture in Picture mode. If you have an HTML5 video playing on any website like Youtube just press the PiPifier icon in Safari's toolbar to enable Picture-In-Picture for this video.
Restart Your iPhone. If the video player app supports PIP mode, but not working, then try to reboot your iPhone. It could be due to some minor software glitch that making you going through this issue. And simply restarting the device can resolve the issue.
Turning picture-in-picture ON To turn on, tap Allow picture-in-picture. General. Toggle picture-in-picture to on .
Use Javascript to activate the picture-in-picture mode. It will run by this way.
document.querySelector("video").webkitSetPresentationMode("picture-in-picture")
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With