Player
Attributes
- See also
- Graph
-
- Supertypes
Members list
Value members
Concrete methods
Add a remote text track
Add a remote text track
Value parameters
- options
-
Options for remote text track
Attributes
Add a text track In addition to the W3C settings we allow adding additional info through options. http://www.w3.org/html/wg/drafts/html/master/embedded-content-0.html#dom-media-addtexttrack
Add a text track In addition to the W3C settings we allow adding additional info through options. http://www.w3.org/html/wg/drafts/html/master/embedded-content-0.html#dom-media-addtexttrack
Value parameters
- kind
-
Captions, subtitles, chapters, descriptions, or metadata
- label
-
Optional label
- language
-
Optional language
Attributes
Get/Set the aspect ratio
Get/Set the aspect ratio
Value parameters
- ratio
-
Aspect ratio for player
Attributes
Get or set the autoplay attribute.
Get or set the autoplay attribute.
Value parameters
- value
-
Boolean to determine if video should autoplay
Attributes
Get a TimeRange object with the times of the video that have been downloaded If you just want the percent of the video that's been downloaded, use bufferedPercent.
Get a TimeRange object with the times of the video that have been downloaded If you just want the percent of the video that's been downloaded, use bufferedPercent.
Attributes
- Returns
-
TimeRange object
Get the percent (as a decimal) of the video that's been downloaded. 0 means none, 1 means all. (This method isn't in the HTML5 spec, but it's very convenient)
Get the percent (as a decimal) of the video that's been downloaded. 0 means none, 1 means all. (This method isn't in the HTML5 spec, but it's very convenient)
Attributes
- Returns
-
The end of the last buffered time range
- Example
-
var howMuchIsDownloaded = myPlayer.bufferedPercent();
Check whether the player can play a given mimetype
Check whether the player can play a given mimetype
Value parameters
- `type`
-
The mimetype to check
Attributes
Get or set whether or not the controls are showing.
Get or set whether or not the controls are showing.
Value parameters
- bool
-
Set controls to showing or not
Attributes
- Returns
-
Controls are showing
Create the component's DOM element
Create the component's DOM element
Attributes
Returns the fully qualified URL of the current source value e.g. http://mysite.com/video.mp4
Can be used in conjuction with currentType to assist in rebuilding the current source object.
Returns the fully qualified URL of the current source value e.g. http://mysite.com/video.mp4
Can be used in conjuction with currentType to assist in rebuilding the current source object.
Attributes
Get the current time (in seconds)
Get the current time (in seconds)
Attributes
- Returns
-
The time in seconds, when not setting
- Example
-
var whereYouAt = myPlayer.currentTime();
Set the current time (in seconds)
Set the current time (in seconds)
Value parameters
- seconds
-
The time to seek to
Attributes
- Returns
-
Self, when the current time is set
- Example
-
myPlayer.currentTime(120); // 2 minutes into the video
Get the current source type e.g. video/mp4. This can allow you rebuild the current source object so that you could load the same source and tech later.
Get the current source type e.g. video/mp4. This can allow you rebuild the current source object so that you could load the same source and tech later.
Attributes
Get/set dimension for player
Get/set dimension for player
Value parameters
- dimension
-
Either width or height
- value
-
Value for dimension
Attributes
- Returns
-
Height when getting
Get the length in time of the video in seconds
Get the length in time of the video in seconds
Value parameters
- seconds
-
Duration when setting
Attributes
- Returns
-
The duration of the video in seconds when getting
- Note
-
The video must have started loading before the duration can be known, and in the case of Flash, may not be known until the video starts playing.
Returns whether or not the player is in the "ended" state.
Returns whether or not the player is in the "ended" state.
Attributes
- Returns
-
True if the player is in the ended state, false if not.
When fullscreen isn't supported we can stretch the video container to as wide as the browser will let us.
When fullscreen isn't supported we can stretch the video container to as wide as the browser will let us.
Attributes
Set the current MediaError
Set the current MediaError
Value parameters
- err
-
A MediaError or a String/Number to be turned into a MediaError
Attributes
- Returns
-
Player
Get the current MediaError
Get the current MediaError
Attributes
- Returns
-
MediaError or
null
Exit full window
Exit full window
Attributes
Return the video to its normal size after having been in full screen mode
Return the video to its normal size after having been in full screen mode
Attributes
Add/remove the vjs-fluid class
Add/remove the vjs-fluid class
Value parameters
- bool
-
Value of true adds the class, value of false removes the class
Attributes
Check for call to either exit full window or full screen on ESC key
Check for call to either exit full window or full screen on ESC key
Value parameters
- event
-
Event to check for key press
Attributes
Get object for cached values.
Get object for cached values.
Attributes
Check if the player is in fullscreen mode
Check if the player is in fullscreen mode
Attributes
- Note
-
As of the latest HTML5 spec, isFullscreen is no longer an official property and instead document.fullscreenElement is used. But isFullscreen is still a valuable property for internal player workings.
Tell the player it's in fullscreen
Tell the player it's in fullscreen
Value parameters
- isFS
-
Update the player's fullscreen state
Attributes
- Returns
-
Self
The player's language code
The player's language code
Attributes
- Returns
-
The locale string when getting
The player's language code
The player's language code
Value parameters
- code
-
The locale string
Attributes
- Returns
-
Self when setting
- Note
-
The language should be set in the player options if you want the the controls to be built with a specific language. Changing the lanugage later will not update controls text.
Get the player's language dictionary Merge every time, because a newly added plugin might call videojs.addLanguage() at any time Languages specified directly in the player options have precedence
Get the player's language dictionary Merge every time, because a newly added plugin might call videojs.addLanguage() at any time Languages specified directly in the player options have precedence
Attributes
- Returns
-
Array of languages
Begin loading the src data.
Begin loading the src data.
Attributes
- Returns
-
Returns the player
Get the loop attribute on the video element.
Get the loop attribute on the video element.
Attributes
- Returns
-
The loop attribute value when getting
Set the loop attribute on the video element.
Set the loop attribute on the video element.
Value parameters
- value
-
Boolean to determine if video should loop
Attributes
- Returns
-
Returns the player when setting
Get the current muted state
Get the current muted state
Attributes
Turn mute on or off
Turn mute on or off
Value parameters
- value
-
True to mute, false to unmute
Attributes
- Returns
-
Returns the player when setting
Returns the current state of network activity for the element, from the codes in the list below.
Returns the current state of network activity for the element, from the codes in the list below.
- NETWORK_EMPTY (numeric value 0) The element has not yet been initialised. All attributes are in their initial states.
- NETWORK_IDLE (numeric value 1) The element's resource selection algorithm is active and has selected a resource, but it is not actually using the network at this time.
- NETWORK_LOADING (numeric value 2) The user agent is actively trying to download data.
- NETWORK_NO_SOURCE (numeric value 3) The element's resource selection algorithm is active, but it has not yet found a resource to use.
Attributes
Check if the player is paused
Check if the player is paused
Attributes
Sets the current playback rate. A playback rate of 1.0 represents normal speed and 0.5 would indicate half-speed playback, for instance.
Sets the current playback rate. A playback rate of 1.0 represents normal speed and 0.5 would indicate half-speed playback, for instance.
Value parameters
- rate
-
New playback rate to set.
Attributes
Gets the current playback rate. A playback rate of 1.0 represents normal speed and 0.5 would indicate half-speed playback, for instance.
Gets the current playback rate. A playback rate of 1.0 represents normal speed and 0.5 would indicate half-speed playback, for instance.
Attributes
Set the poster image source url
Set the poster image source url
Value parameters
- src
-
Poster image source URL
Attributes
Get the poster image source url
Get the poster image source url
Attributes
- Returns
-
Poster image source URL
Set the preload attribute
Set the preload attribute
Value parameters
- value
-
Boolean to determine if preload should be used
Attributes
Get the preload attribute
Get the preload attribute
Attributes
Returns a value that expresses the current state of the element with respect to rendering the current playback position, from the codes in the list below.
Returns a value that expresses the current state of the element with respect to rendering the current playback position, from the codes in the list below.
- HAVE_NOTHING (numeric value 0) No information regarding the media resource is available.
- HAVE_METADATA (numeric value 1) Enough of the resource has been obtained that the duration of the resource is available.
- HAVE_CURRENT_DATA (numeric value 2) Data for the immediate current playback position is available.
- HAVE_FUTURE_DATA (numeric value 3) Data for the immediate current playback position is available, as well as enough data for the user agent to advance the current playback position in the direction of playback.
- HAVE_ENOUGH_DATA (numeric value 4) The user agent estimates that enough data is available for playback to proceed uninterrupted.
Attributes
Calculates how much time is left.
Calculates how much time is left.
Attributes
Get an array of remote html track elements
Get an array of remote html track elements
Attributes
Get an array of remote text tracks
Get an array of remote text tracks
Attributes
Remove a remote text track
Remove a remote text track
Value parameters
- track
-
Remote text track to remove
Attributes
Report user activity
Report user activity
Value parameters
- event
-
Event object
Attributes
Increase the size of the video to full screen In some browsers, full screen is not supported natively, so it enters "full window mode", where the video fills the browser window. In browsers and devices that support native full screen, sometimes the browser's default controls will be shown, and not the Video.js custom skin. This includes most mobile devices (iOS, Android) and older versions of Safari.
Increase the size of the video to full screen In some browsers, full screen is not supported natively, so it enters "full window mode", where the video fills the browser window. In browsers and devices that support native full screen, sometimes the browser's default controls will be shown, and not the Video.js custom skin. This includes most mobile devices (iOS, Android) and older versions of Safari.
Attributes
Reset the player. Loads the first tech in the techOrder, and calls reset
on the tech
.
Reset the player. Loads the first tech in the techOrder, and calls reset
on the tech
.
Attributes
Value parameters
- isScrubbing
-
True/false the user is scrubbing
Attributes
Returns whether or not the user is "scrubbing". Scrubbing is when the user has clicked the progress bar handle and is dragging it along the progress bar.
Returns whether or not the user is "scrubbing". Scrubbing is when the user has clicked the progress bar handle and is dragging it along the progress bar.
Attributes
Returns the TimeRanges of the media that are currently available for seeking to.
Returns the TimeRanges of the media that are currently available for seeking to.
Attributes
Returns whether or not the player is in the "seeking" state.
Returns whether or not the player is in the "seeking" state.
Attributes
Select source based on tech-order or source-order Uses source-order selection if options.sourceOrder
is truthy. Otherwise, defaults to tech-order selection
Select source based on tech-order or source-order Uses source-order selection if options.sourceOrder
is truthy. Otherwise, defaults to tech-order selection
Value parameters
- sources
-
The sources for a media asset
Attributes
- Returns
-
Object of source and tech order, otherwise false
The source function updates the video source. There are three types of variables you can pass as the argument.
The source function updates the video source. There are three types of variables you can pass as the argument.
- URL String: A URL to the the video file. Use this method if you are sure the current playback technology (HTML5/Flash) can support the source you provide. Currently only MP4 files can be used in both HTML5 and Flash.
- Source Object (or element): A javascript object containing information about the source file. Use this method if you want the player to determine if it can support the file using the type information.
- Array of Source Objects: To provide multiple versions of the source so that it can be played using HTML5 across browsers you can use an array of source objects. Video.js will detect which version is supported and load that file.
Value parameters
- source
-
The source URL, object, or array of sources
Attributes
- Returns
-
The player when setting
Attributes
- Returns
-
The current video source when getting
Check to see if fullscreen is supported
Check to see if fullscreen is supported
Attributes
Return a reference to the current tech. It will only return a reference to the tech if given an object with the IWillNotUseThisInPlugins property on it. This is try and prevent misuse of techs by plugins.
Return a reference to the current tech. It will only return a reference to the tech if given an object with the IWillNotUseThisInPlugins property on it. This is try and prevent misuse of techs by plugins.
Attributes
- Returns
-
The Tech
Get an array of associated text tracks. captions, subtitles, chapters, descriptions
Get an array of associated text tracks. captions, subtitles, chapters, descriptions
Attributes
- Returns
-
Array of track objects
- See also
Converts track info to JSON
Converts track info to JSON
Attributes
- Returns
-
JSON object of options
Update styles of the player element (height, width and aspect ratio)
Update styles of the player element (height, width and aspect ratio)
Attributes
Set if user is active
Set if user is active
Value parameters
- bool
-
Value when setting
Attributes
Get if user is active
Get if user is active
Attributes
- Returns
-
Value if user is active user when getting
Get video height
Get video height
Attributes
Get video width
Get video width
Attributes
Set the current volume of the media 0 is off (muted), 1.0 is all the way up, 0.5 is half way.
Set the current volume of the media 0 is off (muted), 1.0 is all the way up, 0.5 is half way.
Value parameters
- percentAsDecimal
-
The new volume as a decimal percent
Attributes
Get the current volume of the media 0 is off (muted), 1.0 is all the way up, 0.5 is half way.
Get the current volume of the media 0 is off (muted), 1.0 is all the way up, 0.5 is half way.
Attributes
Inherited methods
Attributes
- Inherited from:
- Component
Attributes
- Inherited from:
- Component
Attributes
- Inherited from:
- Component
Attributes
- Inherited from:
- Component
Attributes
- Inherited from:
- Component
Attributes
- Inherited from:
- Component
Attributes
- Inherited from:
- Component
Attributes
- Inherited from:
- Component
Attributes
- Inherited from:
- Component
Attributes
- Inherited from:
- Component
Attributes
- Inherited from:
- Component
Attributes
- Inherited from:
- Component
Attributes
- Inherited from:
- Component
Attributes
- Inherited from:
- Object
Attributes
- Inherited from:
- Component
Attributes
- Inherited from:
- Object
Attributes
- Inherited from:
- Component
Attributes
- Inherited from:
- Component
Attributes
- Inherited from:
- Component
Attributes
- Inherited from:
- Object
Attributes
- Inherited from:
- Component
Attributes
- Inherited from:
- Component
Attributes
- Inherited from:
- Component
Attributes
- Inherited from:
- Component
Attributes
- Inherited from:
- Object
Attributes
- Inherited from:
- Component
Attributes
- Inherited from:
- Component
Attributes
- Inherited from:
- Object