<async> new Video()
Represents a Video. Constructor is private. Use CoreControls.Document#getVideo to retrieve the instance.
Methods
-
<inner> deleteAnnotations(annotations)
-
Deletes the passed in annotations from the video object. They will no longer be rendered on any frame.
Parameters:
Name Type Description annotations
Array The array of annotations to delete. -
<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> getDuration()
-
Returns the duration of the video. Guaranteed to be correct when the readyState of the video is greater than 0. https://developer.mozilla.org/en-US/docs/Web/API/HTMLMediaElement/readyState
Returns:
- Type
- number
-
<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 a specific time in the video. The value must be in milliseconds. Returns:
The resulting frame number.- Type
- number
-
<inner> getReadyState()
-
Returns the video readystate https://developer.mozilla.org/en-US/docs/Web/API/HTMLMediaElement/readyState
Returns:
- 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 a specific time in the video. The value must be in milliseconds.