Class: shaka.media.VideoWrapper

Constructor

new VideoWrapper(videonon-null, onSeek, startTime)

Creates a new VideoWrapper that manages setting current time and playback rate. This handles seeks before content is loaded and ensuring the video time is set properly. This doesn't handle repositioning within the presentation window.
Parameters:
Name Type Description
video HTMLMediaElement
onSeek function() Called when the video seeks.
startTime number The time to start at.
Implements:
Source:

Classes

PlayheadMover

Members

(private) onSeek_ :function()

Type:
  • function()
Source:

(private) started_ :boolean

Type:
  • boolean
Source:

(private) startTime_ :number

Type:
  • number
Source:

Methods

delaySetStartTime_(startTime)

If the media element is not ready, we can't set |currentTime|. To work around this we will listen for the "loadedmetadata" event so that we can set the start time once the element is ready.
Parameters:
Name Type Description
startTime number
Source:

getTime() → {number}

Gets the video's current (logical) position.
Source:
Returns:
Type
number

(export) release()

Request that this object release all internal references.
Implements:
Source:

(private) setStartTime_(startTime)

Set the start time for the content. The given start time will be ignored if the content does not start at 0.
Parameters:
Name Type Description
startTime number
Source:

setTime(time)

Sets the current time of the video.
Parameters:
Name Type Description
time number
Source:

(private) startListeningToSeeks_()

Add the listener for seek-events. This will call the externally-provided |onSeek| callback whenever the media element seeks.
Source: