Aside from home screen widgets, Picture in Picture mode is one of the most thrilling upgrades to the iPhone with iOS 14. You will use it to watch minimized copies of videos on top of other games, allowing you to multitask like a pro. However, if the YouTube picture-in-picture (PiP) not working on iOS 14. Worry not! Learn here how to create a YouTube PiP shortcut for Safari on iPhone without installing the PiP shortcut app.
Unfortunately, YouTube is not one of the video streaming providers that has made this option available by default. The official YouTube app for iOS and iPadOS does not include the PIP feature, and although you may unlock it with jailbreak tweaks, many users will be hesitant to jailbreak their iOS and iPadOS devices.
How to Create a YouTube PiP Shortcut for Safari on iPhone
Thanks to CodeEverywhere, there’s now another clever hack that uses a snippet of JavaScript and no additional plugins to bypass YouTube’s Picture in Picture block on its mobile platform.
Meanwhile, there’s a way to download the PiP shortcut for YouTube on iPhone. Since many people face problems while downloading and applying. However, here you will the easiest way to watch YouTube videos on iPhone Safari in picture-in-picture mode by creating a simple shortcut.
So, here’s how to create a YouTube PiP shortcut for iOS 14:
- Open the Shortcuts app on your iPhone. Tap the + icon at the top right-hand corner and select Add Action.
- Tap the Web option on the following screen and select Run JavaScript on Web Page.
- Tap the blue words Web Page next to Run JavaScript on, then select Shortcut Input.
- Remove the existing JavaScript code in the shortcut window and paste in the following code and tap Next.
let v = document.querySelector(‘video’);
v.addEventListener(‘webkitpresentationmodechanged’, (e)=>e.stopPropagation(), true);
setTimeout(()=>v.webkitSetPresentationMode(‘picture-in-picture’), 3000);
completion()
- Type the shortcut name like YouTube PiP and click Done.
- Tap the three dots icon in the top-right corner of the screen and also on the next screen.
- Turn on Show in Share Sheet.
- Tap Share Sheet Types, then select Deselect All and tap Safari web pages.
- Return to the Details screen, then tap Done.
How to Use the Picture-in-Picture for YouTube on iPhone
- Open the Safari web browser and go to YouTube’s mobile website.
- Play any YouTube video and then tap the share icon at the bottom of the page.
- Select the YouTube PiP shortcut that we created before.
- Now, enjoy the picture-in-picture mode on your iPhone.
Credit
A huge thanks to CodeEverywhere, with this trick that uses a snippet of JavaScript with no additional plugins to suppress the Picture in Picture block that YouTube has introduced to its mobile platform.
Meanwhile, there’s also an alternative way to enable Picture in Picture YouTube Safari. Click here for more details. That’s it. This is how you can create a YouTube PiP shortcut for Safari on iPhone without installing the PiP shortcut app.
Read More: