diff --git a/implementation-status.md b/implementation-status.md index bdfc663..804d335 100644 --- a/implementation-status.md +++ b/implementation-status.md @@ -20,7 +20,6 @@ Feature/Platform | Desktop | Android | `document.exitPictureInPicture()` | 68 | 105 | `PictureInPictureWindow.width\|height` | 68 | 105 | `PictureInPictureWindow.onresize` | 68 | 105 | -`video.autoPictureInPicture` | 👷 | | Media Session controls support | 74 | 105 | Tip: Chrome channel releases are tracked at [https://googlechromelabs.github.io/current-versions/](https://googlechromelabs.github.io/current-versions/). diff --git a/index.bs b/index.bs index 4825c43..886ae8d 100644 --- a/index.bs +++ b/index.bs @@ -187,9 +187,8 @@ are same origin-domain with origin. ## Request Picture-in-Picture ## {#request-pip} -When the request Picture-in-Picture algorithm with |video|, -|userActivationRequired| and |playingRequired| is invoked, the user agent MUST -run the following steps: +When the request Picture-in-Picture algorithm with |video| is invoked, +the user agent MUST run the following steps: 1. If Picture-in-Picture support is `false`, throw a {{NotSupportedError}} and abort these steps. @@ -202,22 +201,21 @@ run the following steps: these steps. 5. OPTIONALLY, if |video|'s {{HTMLVideoElement/disablePictureInPicture}} is true, throw an {{InvalidStateError}} and abort these steps. -6. If |userActivationRequired| is `true` and the relevant global object +6. If {{pictureInPictureElement}} is `null` and the relevant global object of this does not have transient activation, throw a {{NotAllowedError}} and abort these steps. 7. If |video| is {{pictureInPictureElement}}, abort these steps. -8. If |playingRequired| is `true` and |video| is {{paused}}, abort these steps. -9. Set {{pictureInPictureElement}} to |video|. -10. Let Picture-in-Picture window be a new instance of +8. Set {{pictureInPictureElement}} to |video|. +9. Let Picture-in-Picture window be a new instance of {{PictureInPictureWindow}} associated with {{pictureInPictureElement}}. -11. Append relevant settings object's origin to +10. Append relevant settings object's origin to initiators of active Picture-in-Picture sessions. -12. Queue a task to fire an event named +11. Queue a task to fire an event named {{enterpictureinpicture}} using {{PictureInPictureEvent}} at the |video| with its {{bubbles}} attribute initialized to `true` and its {{PictureInPictureEvent/pictureInPictureWindow}} attribute initialized to Picture-in-Picture window. -13. If {{pictureInPictureElement}} is fullscreenElement, it is +12. If {{pictureInPictureElement}} is fullscreenElement, it is RECOMMENDED to exit fullscreen. It is RECOMMENDED that video frames are not rendered in the page and in the @@ -269,8 +267,8 @@ Picture-in-Picture algorithm. Some pages may want to disable Picture-in-Picture mode for a video element; for example, they may want to prevent the user agent from suggesting a -Picture-in-Picture context menu or to request Picture-in-Picture automatically -in some cases. To support these use cases, a new {{disablePictureInPicture}} +Picture-in-Picture context menu in some cases. +To support these use cases, a new {{disablePictureInPicture}} attribute is added to the list of content attributes for video elements. The {{disablePictureInPicture}} IDL attribute MUST reflect the content @@ -288,43 +286,6 @@ the user agent SHOULD run these steps: 2. If |video| is {{pictureInPictureElement}}, run the exit Picture-in-Picture algorithm. -## Auto Picture-in-Picture ## {#auto-pip} - -Some pages may want to automatically enter and leave Picture-in-Picture for -a video element; for example, video meeting web apps would benefit from -some automatic Picture-in-Picture behavior when the user switches back and forth -between the web app and other applications/tabs. -To support these use cases, a new {{autoPictureInPicture}} attribute is -added to the list of content attributes for video elements. - -The {{autoPictureInPicture}} IDL attribute MUST reflect the content -attribute of the same name. - -The autoPictureInPictureElement is the video element, among all -video elements with the {{autoPictureInPicture}} attribute currently set, -whose {{autoPictureInPicture}} attribute was set most recently. Note that the -autoPictureInPictureElement can have the {{disablePictureInPicture}} -attribute set. In that case, as expected, it won't be allowed to enter -Picture-in-Picture mode in the request Picture-in-Picture algorithm. - -When the visibility state of a top-level browsing context value -switches from "visible" to "hidden", the user agent MAY run these steps: - -1. If autoPictureInPictureElement is `null`, abort these steps. -2. If {{pictureInPictureElement}} is set, abort these steps. -3. Let |video| be autoPictureInPictureElement. -4. Let |userActivationRequired| be `false`. -5. Let |playingRequired| be `true`. -6. Run the request Picture-in-Picture algorithm with |video|, - |userActivationRequired|, and |playingRequired|. - -When the visibility state of a top-level browsing context value -switches from "hidden" to "visible", the user agent MAY run these steps: - -1. If autoPictureInPictureElement is `null`, abort these steps. -2. If {{pictureInPictureElement}} is autoPictureInPictureElement, run - the exit Picture-in-Picture algorithm. - ## Interaction with Fullscreen ## {#fullscreen} It is RECOMMENDED to run the exit Picture-in-Picture algorithm when the @@ -381,7 +342,6 @@ partial interface HTMLVideoElement { attribute EventHandler onenterpictureinpicture; attribute EventHandler onleavepictureinpicture; - [CEReactions] attribute boolean autoPictureInPicture; [CEReactions] attribute boolean disablePictureInPicture; }; @@ -391,14 +351,10 @@ return a new promise |promise| and run the following steps in parallel: 1. Let |video| be the video element on which the method was invoked. -2. Let |userActivationRequired| be `true` if {{pictureInPictureElement}} is - `null`. It is `false` otherwise. -3. Let |playingRequired| be `false`. -4. Run the request Picture-in-Picture algorithm with |video|, - |userActivationRequired|, and |playingRequired|. -5. If the previous step threw an exception, reject |promise| with that +2. Run the request Picture-in-Picture algorithm with |video|. +3. If the previous step threw an exception, reject |promise| with that exception and abort these steps. -6. Return |promise| with the Picture-in-Picture window associated with +4. Return |promise| with the Picture-in-Picture window associated with {{pictureInPictureElement}}. ## Extensions to Document ## {#document-extensions}