getCurrentPeriod
Description
Returns information on the currentPeriods being played.
The value returned by this method is either null, for when no content is currently being
played or when it is unknown, or an object with the following properties:
-
start(number): The starting position at which the Period starts, in seconds. -
end(number|undefined): The position at which the Period ends, in seconds.undefinedeither if not known or if the Period has no end yet (e.g. for live contents, the end might not be known for now). -
id(string):idfor this Period, allowing to call track and Representation selection APIs (such assetAudioTrackandlockVideoRepresentationsfor example) even if that Period is not currently playing.
Syntax
const currentPeriod = rxPlayer.getCurrentPeriod();
-
return value
Object|null: Information on the current Period being played.nulleither if no content is currently playing or if the currentPeriodis unknown.