Create a new video.js-based position source.
Configuration options
Whether to loop when reaching the end boundary.
When true, the source resets to position 0 and continues.
When false, the source emits 'end' boundary and deactivates.
For sources where looping is not applicable (e.g., mouse position), this property has no effect.
Whether to loop when reaching the end boundary.
When true, the source resets to position 0 and continues.
When false, the source emits 'end' boundary and deactivates.
For sources where looping is not applicable (e.g., mouse position), this property has no effect.
Current state of the position source
Deactivate the source and reset position.
Overrides base to also reset video currentTime.
Destroy the position source and release all resources.
After calling destroy, the source cannot be reused. Removes event listeners, closes connections, clears timers.
ProtecteddoPerform source-specific cleanup.
Called by destroy(). Override to release resources, unbind listeners, etc.
ProtecteddoPerform source-specific initialization.
Called by init(). Override to load resources, bind listeners, etc.
ProtectedemitEmit a boundary event to all registered callbacks.
The boundary type ('start' or 'end')
Get the container element.
jQuery-wrapped container element
Get the video duration.
Duration in seconds from video.js player
Get the current position.
Current position in seconds (or source-specific units)
Register a callback for when the source becomes active.
Called once each time the source transitions to the active state.
This is equivalent to "first frame" semantics - for RAF sources it's
the first tick, for video sources it's when playback actually starts.
Function called when source becomes active
Register a callback for boundary events.
Called when position reaches a boundary (start or end).
For looping sources, 'end' is emitted before reset.
Function receiving the boundary type
Register a callback for when the container is ready.
Function called when container is ready
Register a callback for position updates.
Called whenever the position changes while the source is active. Frequency depends on the source type (e.g., RAF tick, video timeupdate).
Function receiving the current position
Seek to a specific position in the video.
Target position in seconds
Actual position after seek
ProtectedsetSet the current position and emit to callbacks.
Only emits if the source is active.
New position value
ProtectedstartStart emitting position updates.
Called when transitioning to active state.
Override to start timers, begin listening to events, etc.
ProtectedstopStop emitting position updates.
Called when transitioning from active to suspended or inactive.
Override to stop timers, pause listening, etc.
Suspend the position source, preserving current position.
Transitions state from active to suspended.
Position updates stop but position is preserved for later resumption.
Video.js-based position source.
Wraps a video.js player to provide position updates based on video playback. Implements
IPositionSource,ISeekable, andIContainerProvider.Example