Constructor
new LiveTracker(player, optionsopt)
Creates an instance of this class.
Name | Type | Attributes | Description | |||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
player | Player | The | ||||||||||||||||
options | Object | <optional> | The key/value store of player options. Properties
|
- Source
Methods
atLiveEdge() → {boolean}
Determines if currentTime is at the live edge and won't fall behind on each seekableendchange
- Source
Whether playback is at the live edge
- Type:
- boolean
behindLiveEdge() → {boolean}
If we are currently behind the live edge, aka currentTime will be behind on a seekableendchange
- Source
If we are behind the live edge
- Type:
- boolean
dispose()
Dispose of liveTracker
- Source
handleDurationchange()
handle a durationchange event on the player and start/stop tracking accordingly.
- Source
handleFirstTimeupdate()
handle the first timeupdate on the player if it wasn't already playing when live tracker started tracking.
- Source
handlePlay()
handle the first play on the player, and make sure that we seek right to the live edge.
- Source
handleSeeked()
Keep track of what time a seek starts, and listen for seeked to find where a seek ends.
- Source
isLive() → {boolean}
Determines if the player is live, only checks if this component is tracking live playback or not
- Source
Whether liveTracker is tracking
- Type:
- boolean
isTracking()
Whether live tracker is currently tracking or not.
- Source
liveCurrentTime() → {number}
get what we expect the live current time to be
- Source
The expected live current time
- Type:
- number
liveWindow() → {number}
Get the live time window aka the amount of time between seekable start and live current time.
- Source
The amount of seconds that are seekable in the live video.
- Type:
- number
nextSeekedFromUser()
The next seeked event is from the user. Meaning that any seek
2s behind live will be considered behind live for real and liveTolerance will be ignored.
- Source
pastSeekEnd() → {number}
The number of seconds that have occurred after seekable end changed. This will be reset to 0 once seekable end changes.
- Source
Seconds past the current seekable end
- Type:
- number
reset_()
Stop tracking, and set all internal variables to their initial value.
- Source
seekToLiveEdge()
Seek to the live edge if we are behind the live edge
- Source
seekableEnd() → {number}
A helper to get the player seekable end so that we don't have to null check everywhere
- Source
The furthest seekable end or Infinity.
- Type:
- number
seekableStart() → {number}
A helper to get the player seekable start so that we don't have to null check everywhere
- Source
The earliest seekable start or 0.
- Type:
- number
startTracking()
start tracking live playback
- Source
stopTracking()
stop tracking live playback
- Source
toggleTracking()
start/stop tracking
- Source
trackLive_()
all the functionality for tracking when seek end changes and for tracking how far past seek end we should be
- Source