diff --git a/files/en-us/web/api/document/exitpictureinpicture/index.md b/files/en-us/web/api/document/exitpictureinpicture/index.md index 5be70fd2980c06d..f8c067c592e4f39 100644 --- a/files/en-us/web/api/document/exitpictureinpicture/index.md +++ b/files/en-us/web/api/document/exitpictureinpicture/index.md @@ -30,6 +30,11 @@ A {{jsxref("Promise")}}, which is resolved once the {{Glossary("user agent")}} h finished exiting picture-in-picture mode. If an error occurs while attempting to exit fullscreen mode, the `catch()` handler for the promise is called. +### Exceptions + +- `InvalidStateError` {{domxref("DOMException")}} + - : Thrown if `document.pictureInPictureElement` is `null`. + ## Examples This example causes the current document to exit picture-in-picture mode whenever the diff --git a/files/en-us/web/api/htmlvideoelement/requestpictureinpicture/index.md b/files/en-us/web/api/htmlvideoelement/requestpictureinpicture/index.md index 04529704d1642b8..267d04ec2bf593a 100644 --- a/files/en-us/web/api/htmlvideoelement/requestpictureinpicture/index.md +++ b/files/en-us/web/api/htmlvideoelement/requestpictureinpicture/index.md @@ -34,8 +34,14 @@ object that can be used to listen when a user will resize that floating window. ### Exceptions +- `NotSupportedError` {{domxref("DOMException")}} + - : Thrown if the feature is not supported (for example, disabled by a user preference or by a platform limitation). - `SecurityError` {{domxref("DOMException")}} - - : Use of this feature was blocked by a [Permissions Policy](/en-US/docs/Web/HTTP/Permissions_Policy). + - : Thrown if the feature is blocked by a [Permissions Policy](/en-US/docs/Web/HTTP/Permissions_Policy). +- `InvalidStateError` {{domxref("DOMException")}} + - : Thrown if the video element's `readState` is `HAVE_NOTHING`, or if the video element has no video track, or if the video element's `disablePictureInPicture` attribute is `true`. +- `NotAllowedError` {{domxref("DOMException")}} + - : Thrown if `document.pictureInPictureElement` is `null` and the document does not have {{Glossary("transient activation")}}. ## Security diff --git a/files/en-us/web/api/pictureinpictureevent/pictureinpictureevent/index.md b/files/en-us/web/api/pictureinpictureevent/pictureinpictureevent/index.md index f9606c4fd97cbf6..154dbf74a88a5ea 100644 --- a/files/en-us/web/api/pictureinpictureevent/pictureinpictureevent/index.md +++ b/files/en-us/web/api/pictureinpictureevent/pictureinpictureevent/index.md @@ -8,8 +8,7 @@ browser-compat: api.PictureInPictureEvent.PictureInPictureEvent {{APIRef("Picture-in-Picture API")}} -The **`PictureInPictureEvent()`** constructor returns a new {{domxref("PictureInPictureEvent")}} object with an optional {{domxref("EventTarget")}}. -When the event has both a source and a destination, the `relatedTarget` value must be set to the other target. +The **`PictureInPictureEvent()`** constructor returns a new {{domxref("PictureInPictureEvent")}} object. ## Syntax @@ -20,11 +19,11 @@ new PictureInPictureEvent(type, options) ### Parameters - `type` - - : A string representing the name of the event. + - : A string representing the name of the event. It is case-sensitive and browsers set it to `enterpictureinpicture`, `leavepictureinpicture`, or `resize`. - `options` - : An object that, _in addition of the properties defined in {{domxref("Event/Event", "Event()")}}_, can have the following properties: - - `relatedTarget` {{optional_inline}} - - : The related {{domxref("EventTarget")}}, or `null` (its default value). + - `pictureInPictureWindow` + - : A {{domxref("PictureInPictureWindow")}}. ### Return value diff --git a/files/en-us/web/api/pictureinpictureevent/pictureinpicturewindow/index.md b/files/en-us/web/api/pictureinpictureevent/pictureinpicturewindow/index.md new file mode 100644 index 000000000000000..3f09372e03fbdf9 --- /dev/null +++ b/files/en-us/web/api/pictureinpictureevent/pictureinpicturewindow/index.md @@ -0,0 +1,27 @@ +--- +title: "PictureInPictureEvent: pictureInPictureWindow property" +short-title: pictureInPictureWindow +slug: Web/API/PictureInPictureEvent/pictureInPictureWindow +page-type: web-api-instance-property +browser-compat: api.PictureInPictureEvent.pictureInPictureWindow +--- + +{{APIRef("Picture-in-Picture API")}} + +The read-only **`pictureInPictureWindow`** property of the {{domxref("PictureInPictureEvent")}} interface returns the {{domxref("PictureInPictureWindow")}} the event relates to. + +## Value + +A {{domxref("PictureInPictureWindow")}}. + +## Specifications + +{{Specifications}} + +## Browser compatibility + +{{Compat}} + +## See also + +- [Picture-in-Picture API](/en-US/docs/Web/API/Picture-in-Picture_API) diff --git a/files/en-us/web/api/pictureinpicturewindow/height/index.md b/files/en-us/web/api/pictureinpicturewindow/height/index.md index 20ee056697ccb00..7678cd5ccacdee8 100644 --- a/files/en-us/web/api/pictureinpicturewindow/height/index.md +++ b/files/en-us/web/api/pictureinpicturewindow/height/index.md @@ -8,9 +8,7 @@ browser-compat: api.PictureInPictureWindow.height {{APIRef("Picture-in-Picture API")}} -The read-only {{domxref("PictureInPictureWindow")}} property -**`height`** returns the height of the floating video window -in pixels. +The read-only **`height`** property of the {{domxref("PictureInPictureWindow")}} interface returns the height of the floating video window in pixels. ## Syntax @@ -20,8 +18,7 @@ pictureInPictureWindow.height ### Value -An integer value indicating the height of the floating video window in pixels. This -property is read-only, and has no default value. +An integer value indicating the height of the floating video window in pixels if the Picture-in-Picture window is open. Otherwise, it returns `0`. ## Specifications diff --git a/files/en-us/web/api/pictureinpicturewindow/width/index.md b/files/en-us/web/api/pictureinpicturewindow/width/index.md index 86eeabd6c0b28d5..a433eee86cd588e 100644 --- a/files/en-us/web/api/pictureinpicturewindow/width/index.md +++ b/files/en-us/web/api/pictureinpicturewindow/width/index.md @@ -8,9 +8,7 @@ browser-compat: api.PictureInPictureWindow.width {{APIRef("Picture-in-Picture API")}} -The read-only {{domxref("PictureInPictureWindow")}} property -**`width`** returns the width of the floating video window in -pixels. +The read-only **`width`** property of the {{domxref("PictureInPictureWindow")}} inbterface returns the width of the floating video window in pixels. ## Syntax @@ -20,8 +18,7 @@ pictureInPictureWindow.width ### Value -An integer value indicating the width of the floating video window in pixels. This -property is read-only, and has no default value. +An integer value indicating the width of the floating video window in pixels if the Picture-in-Picture window is open. Otherwise, it returns `0`. ## Specifications