diff --git a/doc/api/.docConfig.json b/doc/api/.docConfig.json index a607449b32..d3a8299590 100644 --- a/doc/api/.docConfig.json +++ b/doc/api/.docConfig.json @@ -53,12 +53,8 @@ "displayName": "Buffer Control" }, { - "path": "./Buffer_Information", - "displayName": "Buffer Information" - }, - { - "path": "./Content_Information", - "displayName": "Content Information" + "path": "./Playback_Information", + "displayName": "Playback Information" }, { "path": "./Static_Properties.md", diff --git a/doc/api/Buffer_Information/.docConfig.json b/doc/api/Buffer_Information/.docConfig.json deleted file mode 100644 index f28570ab09..0000000000 --- a/doc/api/Buffer_Information/.docConfig.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "pages": [ - { - "path": "./getVideoBufferGap.md", - "displayName": "getVideoBufferGap" - } - ] -} diff --git a/doc/api/Miscellaneous/Deprecated_APIs.md b/doc/api/Miscellaneous/Deprecated_APIs.md index a96ccbb5eb..6d14607624 100644 --- a/doc/api/Miscellaneous/Deprecated_APIs.md +++ b/doc/api/Miscellaneous/Deprecated_APIs.md @@ -229,7 +229,7 @@ You can replace this API by using the ### getCurrentKeySystem `getCurrentKeySystem` has been deprecated in profit of the similar -[`getKeySystemConfiguration`](../Content_Information/getKeySystemConfiguration.md) +[`getKeySystemConfiguration`](../Playback_Information/getKeySystemConfiguration.md) method. Note however that the key system string optionally returned as a `keySystem` diff --git a/doc/api/Content_Information/.docConfig.json b/doc/api/Playback_Information/.docConfig.json similarity index 50% rename from doc/api/Content_Information/.docConfig.json rename to doc/api/Playback_Information/.docConfig.json index 1d63b22e8a..60eb2e3208 100644 --- a/doc/api/Content_Information/.docConfig.json +++ b/doc/api/Playback_Information/.docConfig.json @@ -19,6 +19,26 @@ { "path": "./createDebugElement.md", "displayName": "createDebugElement" + }, + { + "path": "./getVideoBufferGap.md", + "displayName": "getVideoBufferGap" + }, + { + "path": "./isContentLoaded.md", + "displayName": "isContentLoaded" + }, + { + "path": "./isBuffering.md", + "displayName": "isBuffering" + }, + { + "path": "./isPaused.md", + "displayName": "isPaused" + }, + { + "path": "./getLastStoredContentPosition.md", + "displayName": "getLastStoredContentPosition" } ] -} +} \ No newline at end of file diff --git a/doc/api/Content_Information/createDebugElement.md b/doc/api/Playback_Information/createDebugElement.md similarity index 100% rename from doc/api/Content_Information/createDebugElement.md rename to doc/api/Playback_Information/createDebugElement.md diff --git a/doc/api/Content_Information/getKeySystemConfiguration.md b/doc/api/Playback_Information/getKeySystemConfiguration.md similarity index 100% rename from doc/api/Content_Information/getKeySystemConfiguration.md rename to doc/api/Playback_Information/getKeySystemConfiguration.md diff --git a/doc/api/Playback_Information/getLastStoredContentPosition.md b/doc/api/Playback_Information/getLastStoredContentPosition.md new file mode 100644 index 0000000000..5a00cffb66 --- /dev/null +++ b/doc/api/Playback_Information/getLastStoredContentPosition.md @@ -0,0 +1,36 @@ +# getLastStoredContentPosition + +## Description + +Returns the last stored position of the last played content, in seconds. +Returns `undefined` if no content was previously loaded. + +This method can be useful if you want to reload using `player.loadVideo()` and not +`player.reload()`, after an error for example. + +It can also be used to retrieve the position where the player was at when the error arised. + +## Syntax + +```js +const lastStoredContentPosition = player.getLastStoredContentPosition(); +``` + + - **return value** `number|undefined` + + #### Example + +```js +const lastStoredContentPosition = player.getLastStoredContentPosition(); + +if (lastStoredContentPosition !== undefined) { + player.loadVideo({ + // ... + startAt: { + position: lastStoredContentPosition, + }, + }); +} +``` + + diff --git a/doc/api/Content_Information/getUrl.md b/doc/api/Playback_Information/getUrl.md similarity index 100% rename from doc/api/Content_Information/getUrl.md rename to doc/api/Playback_Information/getUrl.md diff --git a/doc/api/Buffer_Information/getVideoBufferGap.md b/doc/api/Playback_Information/getVideoBufferGap.md similarity index 100% rename from doc/api/Buffer_Information/getVideoBufferGap.md rename to doc/api/Playback_Information/getVideoBufferGap.md diff --git a/doc/api/Playback_Information/isBuffering.md b/doc/api/Playback_Information/isBuffering.md new file mode 100644 index 0000000000..9353130cb2 --- /dev/null +++ b/doc/api/Playback_Information/isBuffering.md @@ -0,0 +1,16 @@ +# isBuffering + +## Description + +Returns `true` if the player is buffering. + +The method relies solely on the state of the player, and is a shortcut for +`["BUFFERING", "SEEKING", "LOADING", "RELOADING"].includes(player.getPlayerState())`. + +## Syntax + +```js +const isBuffering = player.isBuffering(); +``` + + - **return value** `boolean` diff --git a/doc/api/Playback_Information/isContentLoaded.md b/doc/api/Playback_Information/isContentLoaded.md new file mode 100644 index 0000000000..c8728792af --- /dev/null +++ b/doc/api/Playback_Information/isContentLoaded.md @@ -0,0 +1,17 @@ +# isContentLoaded + +## Description + +Returns `true` if a content is loaded. If it is, the player is ready to play and you can +use APIs interacting with the current content such as `seekTo` or `setAudioTrack`. + +The method relies solely on the state of the player, and is a shortcut for +`!(["LOADING", "RELOADING", "STOPPED"].includes(player.getPlayerState()))`. + +## Syntax + +```js +const isContentLoaded = player.isContentLoaded(); +``` + + - **return value** `boolean` diff --git a/doc/api/Content_Information/isLive.md b/doc/api/Playback_Information/isLive.md similarity index 100% rename from doc/api/Content_Information/isLive.md rename to doc/api/Playback_Information/isLive.md diff --git a/doc/api/Playback_Information/isPaused.md b/doc/api/Playback_Information/isPaused.md new file mode 100644 index 0000000000..16b640ba1e --- /dev/null +++ b/doc/api/Playback_Information/isPaused.md @@ -0,0 +1,18 @@ +# isPaused + +## Description + +Returns the play/pause status of the player, that can be used for example to display a play/pause button: + - when the player is (re)loading, returns the scheduled play/pause condition + for when loading is over, + - in other states, returns the `