Class: Video

Video


<async> new Video()

Represents a Video. Constructor is private. Use CoreControls.Document#getVideo to retrieve the instance.
See:

Methods


<async, inner> extractFrames(frameNumbers)

Returns an array of the canvases for the frame numbers passed in. If a second call is made, then the previous call will return immediately and may not have all the canvases.
Parameters:
Name Type Description
frameNumbers Array An array of all the frame numbers to retrieve canvases for.
Returns:
An array form some or all the canvases for the frame numbers passed in. If you want to guarantee all the canvases from one call then wait for the promise to finish before making another call.
Type
Promise.<Array>

<inner> getAllAnnotations()

Returns all annotations for all frames in the video.
Returns:
An array of all annotations.
Type
Array

<inner> getElement()

Returns the underlying HTML5 video element
Returns:
Type
object

<inner> getFormattedCurrentTime()

Returns a string representing the curretn seeked to time. Formatted as hh:mm:ss.
Returns:
A string representing the curretn seeked to time. Formatted as hh:mm:ss.
Type
string

<inner> getFormattedTime(seconds)

Returns a string representing the passed in seconds. Formatted as hh:mm:ss.
Parameters:
Name Type Description
seconds number
Returns:
A string representing the passed in seconds. Formatted as hh:mm:ss.
Type
string

<inner> getFrameFromTime(time)

Returns the conversion of a time stamp to a frame number.
Parameters:
Name Type Description
time number A number representing the milliseconds elapsed between 1 January 1970 00:00:00 UTC and the given date.
Returns:
The resulting frame number.
Type
number

<inner> getTimeFromFrame(frame)

Returns the conversion of a frame number to a time stamp (in milliseconds).
Parameters:
Name Type Description
frame number The frame number to convert.
Returns:
The resulting time.
Type
number

<inner> getTotalFrames()

Returns the total number of frames in the video.
Returns:
The total number of frames in the video.
Type
number

<inner> hasAnnotation()

Returns true if the frame number passed in has at least one annotation associated with it. Returns false otherwise.
Returns:
Type
boolean

<inner> updateAnnotationsToTime(newTime)

Renders the saved annotations on the annotation canvas at the passed in time
Parameters:
Name Type Description
newTime number A number representing the milliseconds elapsed between 1 January 1970 00:00:00 UTC and the given date.