Hacker News new | ask | show | jobs
by fluential 1832 days ago
You can do background play in Safari iOS by switching to desktop mode, press play, lock the phone and then click again to play from lock screen / outside safari. Alternatively friendly does also background play.
1 comments

This is tangentially related, but Google has been blocking iOS native PiP mode on YouTube on iPhones on the website.

Here's a bookmarklet (you must create and edit an existing bookmark with the contents below, else you will get an error) that will pop out a YouTube video on iOS into a PiP video when run. Simply click on the Bookmarks while on the YouTube page and select it.

This allows you to play the videos in the background by swiping the PiP player off to the side.

Disclaimer I do not remember where I got it, only that it seems to work for me.

javascript:(function()%7Blet%20v%20%3D%20document.querySelector('video')%3Bv.addEventListener('webkitpresentationmodechanged'%2C%20(e)%3D%3Ee.stopPropagation()%2C%20true)%3BsetTimeout(()%3D%3Ev.webkitSetPresentationMode('picture-in-picture')%2C%203000)%3Bcompletion()%7D)()

How does Google manage to block iOS PiP and why doesn’t Apple write some workaround in its Safari engine?