You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on May 10, 2024. It is now read-only.
Websites like youtube do not support Background play or Picture-In-Picture.
Want to be able to play videos (background audio) on lock screen and picture in picture when on the home-screen.
Implementation Details
Picture-In-Picture needs the webkitpresentationmodechanged event blocked from propagating/bubbling.
Background-Mode is trickier as Webkit itself calls pause on the HTMLMediaElement so you need to resume playback. However, websites like youtube also break playback even if it were fixed in youtube, by listening to the visibilitychange event and pausing the HTMLMediaElement.
User Experience
Play a video on a website
Background the browser
Should still play.
Lock the device.
Should still play.
Pause and then play again on the lock-screen; should work.
The text was updated successfully, but these errors were encountered:
Brave already can do PiP for youtube if you are a youtube premium subscriber in the browser since Brave is built on Webkit. Background play will be interesting, are there other browsers allowed to do this?
Brave already can do PiP for youtube if you are a youtube premium subscriber in the browser since Brave is built on Webkit. Background play will be interesting, are there other browsers allowed to do this?
Hi :)
I am aware of the Youtube Premium subscription. Same for a few other websites and apps that block OS functionality behind a subscription service.
Youtube (and others) is not supposed to charge for features such as PIP or Background play as these are native to the OS (not sure why Apple allows them to do it). This is in direct contradiction to (as far as I can tell):
3.2.2 Unacceptable
(ii) Monetizing built-in capabilities provided by the hardware or operating system, such as Push Notifications, the camera, or the gyroscope; or Apple services, such as Apple Music access or iCloud storage.
Picture in Picture and Background modes work on all other websites by default, as it is a WebKit feature (you are correct) and OS level feature (iOS 13+ or 14+ for PIP). However, websites like youtube explicitly disable it on purpose and puts it behind Youtube Premium or whichever website subscription.
This ticket and the Pull-Request associated with it, is to fix it -- to allow it to work on ALL sites with or without paying for "premium".
Currently, there are no other third-party browsers that allow background play or PIP as far as I am aware (correct me if I'm wrong :) ). I know that Safari iOS does support Background Play and WebRTC background streaming on iOS 14.5+, but this is not available to third-party browsers yet (specifically the WebRTC background streaming).
Feature Overview
Implementation Details
webkitpresentationmodechanged
event blocked from propagating/bubbling.pause
on theHTMLMediaElement
so you need toresume
playback. However, websites likeyoutube
also break playback even if it were fixed in youtube, by listening to thevisibilitychange
event and pausing theHTMLMediaElement
.User Experience
The text was updated successfully, but these errors were encountered: