Get Picture-in-Picture Mode Working in YouTube Safari on iOS 14
So, what are the requirements to force YouTube PiP mode to work in Apple Safari? Well, you have to create a custom shortcut using the Shortcuts app. Once you have created and customized the YouTube PiP mode shortcut on your iOS device, it’s business as usual. Now that, you have got the sneak peek into how this hack works, it’s time to get going with quick steps!
Create YouTube PiP Mode Shortcut Using Shortcuts App Play YouTube Video in Picture-in-Picture Mode Using Safari
Create YouTube PiP Mode Shortcut Using Shortcuts App
First off, open Shortcuts app on your iPhone or iPad and tap on the “+” button at the top right corner of the screen.
Now, tap on the Add Action button.
Next, choose Web.
Next, select “Run JavaScript on Web Page” under Safari section.
Tap on Web Page option which is right next to Run JavaScript and choose Shortcut Input in the menu.
Up next, remove the JavaScript that shows up in the shortcut window. Then, paste the one given below. After that, tap on the three dots at the top right corner of the screen. let v = document.querySelector(‘video’); v.addEventListener(‘webkitpresentationmodechanged’, (e)=>e.stopPropagation(), true); setTimeout(()=>v.webkitSetPresentationMode(‘picture-in-picture’), 3000); completion()
Give a suitable name to your shortcut.
Next, turn on the switch for “Show in Share Sheet” and then tap on “Share Sheet Types”.
Next up, tap on Deselect All at the top right corner of the screen and choose Safari web pages.
Tap on the back button at the top left corner of the screen and then hit the Done button. You will need to tap on Done again to finish.
Play YouTube Video in Picture-in-Picture Mode Using Safari
After you have created the YouTube PiP mode shortcut, playing videos in the PiP mode via Safari is quite simple.
- Now, choose YouTube PiP shortcut which you have just created in the action sheet.
Note:
A popup may appear asking you to give YouTube PiP access to youtube.com. Tap on Allow to proceed.
That’s pretty much it! Now, it’s time to relish the video while still carrying out other tasks like messaging or taking note.
Enjoy Playing YouTube Videos in PiP Mode Via Safari on Your iPhone or iPad
So, that’s how you can force YouTube PiP mode to work in iOS 14 Safari. Though I am still hoping for an official way to arrive sooner than later, I am glad to have such a handy workaround as long as it works. What’s your take on this tip? Has it worked on your device? Feel free to share your thoughts in the comments below. By the way, how smooth has been your run with iOS 14? If you are yet to get the most out of it, then check out our guides for customizing iOS 14 widgets, creating unique app icons, and making custom home screen widgets.