Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
fe46689
commit 2e0beb5
Showing
4 changed files
with
59 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
# getLivePosition | ||
|
||
## Description | ||
|
||
Returns the position in seconds in the current media corresponding to live | ||
content. | ||
|
||
Returns `null` if no content is currently loaded or if the current content is | ||
not considered a live content. | ||
|
||
Returns `undefined` if we cannot know the position corresponding to live | ||
content currently. | ||
|
||
Note that the live position is technically different than the maximum position | ||
returned by [`getMaximumPosition`](./getMaximumPosition.md): | ||
|
||
- `getMaximumPosition` returns the maximum position with content that may be | ||
loaded. It may be further than the live position if future content is | ||
already available (e.g. ad breaks already present in a Manifest) or may | ||
be sooner if the live position is not yet available. | ||
|
||
- `getLivePosition` just gives the information on the position which is | ||
intended to correspond to the live content. | ||
|
||
## Syntax | ||
|
||
```js | ||
const livePosition = player.getMaximumPosition(); | ||
``` | ||
|
||
- **return value** `number|null|undefined`: position for the live content, in | ||
seconds. | ||
`null` if no content is loaded or if the current loaded content is | ||
not considered as a live content. | ||
`undefined` if that live position is currently unknown. | ||
|
||
## Example | ||
|
||
```js | ||
// playing 5 seconds before the live | ||
player.seekTo({ | ||
position: player.getLivePosition() - 5, | ||
}); | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters