Youtube PIP script not working outside the page #6

Closed
opened 2025-04-27 21:44:22 +02:00 by deepakdahiya · 4 comments

Hi, I was trying the youtubePictureInPicture script to bring back PIP in chromium browser, the script triggers the PIP perfectly but I am seeing the following issues:-

  1. The PIP window is part of the browser rather than being a separate PIP outside the app. I prefer this and wasn't even sure thats feasible in android chromium. But the window do not have video/audio controls but normal PIP control ie a button to make the video full screen.
  2. The PIP window moves from the app to normal PIP windows at the bottom right corner if we close the app but the video and audio stop working.
  3. When we are in the browser and change page like clicking on youtube home, the PIP stays in the youtube website as mentioned in point 1 but again the video and audio pauses.

Is this an expected behaviour? If no is there anything can be done with the script to fix those? I will continue investigating the issue so happy to get any guidance on this matter.

Thanks you

Hi, I was trying the [youtubePictureInPicture script](https://git.kaki87.net/KaKi87/userscripts/src/branch/master/youtubePictureInPicture/main.user.js) to bring back PIP in chromium browser, the script triggers the PIP perfectly but I am seeing the following issues:- 1. The PIP window is part of the browser rather than being a separate PIP outside the app. I prefer this and wasn't even sure thats feasible in android chromium. But the window do not have video/audio controls but normal PIP control ie a button to make the video full screen. 2. The PIP window moves from the app to normal PIP windows at the bottom right corner if we close the app but the video and audio stop working. 3. When we are in the browser and change page like clicking on youtube home, the PIP stays in the youtube website as mentioned in point 1 but again the video and audio pauses. Is this an expected behaviour? If no is there anything can be done with the script to fix those? I will continue investigating the issue so happy to get any guidance on this matter. Thanks you
Owner

Hi,

in chromium browser [...] The PIP window is part of the browser

How are you able to install the userscript on Chromium browser for Android ?

I'm using it on Kiwi browser, and as you can see on the screenshot from the README, the PIP window is not part of the browser.

if we close the app [...] the video and audio stop working

That's also a limitation from YouTube, and there is a separate userscript to bypass it : Video Background Play Fix

Hi, > in chromium browser [...] The PIP window is part of the browser How are you able to install the userscript on Chromium browser for Android ? I'm using it on Kiwi browser, and as you can see on the screenshot from the [README](https://git.kaki87.net/KaKi87/userscripts/src/branch/master/youtubePictureInPicture), the PIP window is not part of the browser. > if we close the app [...] the video and audio stop working That's also a limitation from YouTube, and there is a separate userscript to bypass it : [Video Background Play Fix](https://greasyfork.org/en/scripts/371641-video-background-play-fix)
Author

How are you able to install the userscript on Chromium browser for Android ?

Sorry I meant I am building on a fork of chromium so I am testing the script by injecting directly in the chromium build

I'm using it on Kiwi browser, and as you can see on the screenshot from the README, the PIP window is not part of the browser.

Right, I suspect the behaviour I am seeing on my browser may be due to the fact that PIP is being triggered from inside the website rather than PIP being triggered from Java layer of the android app. I'll continue looking into this and get back to you. Anyways I prefer that it is inside the browser as that can potentially lead to better UX.

That's also a limitation from YouTube, and there is a separate userscript to bypass it : Video Background Play Fix

Thank you for the link, ill try this out and see if that resolves the issue for me.

> How are you able to install the userscript on Chromium browser for Android ? Sorry I meant I am building on a fork of chromium so I am testing the script by injecting directly in the chromium build > I'm using it on Kiwi browser, and as you can see on the screenshot from the README, the PIP window is not part of the browser. Right, I suspect the behaviour I am seeing on my browser may be due to the fact that PIP is being triggered from inside the website rather than PIP being triggered from Java layer of the android app. I'll continue looking into this and get back to you. Anyways I prefer that it is inside the browser as that can potentially lead to better UX. > That's also a limitation from YouTube, and there is a separate userscript to bypass it : Video Background Play Fix Thank you for the link, ill try this out and see if that resolves the issue for me.
Author

Hi @KaKi87 I did some investigation and realised that the PIP player is not in the youtube but its the normal PIP player, the only difference is that the creation of that PIP player is not closing my app so it looks like the PIP player is part of the browser rather than usual PIP.

I also tested the background play back and the script is working perfectly.

Hi @KaKi87 I did some investigation and realised that the PIP player is not in the youtube but its the normal PIP player, the only difference is that the creation of that PIP player is not closing my app so it looks like the PIP player is part of the browser rather than usual PIP. I also tested the background play back and the script is working perfectly.
Owner

the creation of that PIP player is not closing my app

Oh, yeah, that's normal, you can also see the same behavior on my README screenshot.

the script is working perfectly

Alright !

> the creation of that PIP player is not closing my app Oh, yeah, that's normal, you can also see the same behavior on my README screenshot. > the script is working perfectly Alright !
Sign in to join this conversation.
No milestone
No project
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: KaKi87/userscripts#6
No description provided.