### start() Source: https://docs.videojs.com/spatialnavigation Starts the spatial navigation by adding a keydown event listener to the video container. This method ensures that the event listener is added only once. ```APIDOC ## start() ### Description Starts the spatial navigation by adding a keydown event listener to the video container. This method ensures that the event listener is added only once. ``` -------------------------------- ### play() Source: https://docs.videojs.com/tech Starts playback of the media source. ```APIDOC ## play() ### Description Starts playback of the media source. ### Source * tech/tech.js, line 503 ### See Also * {Html5#play} ``` -------------------------------- ### ResizeManager Example: Disable Resize Manager Source: https://docs.videojs.com/resizemanager Example demonstrating how to disable the ResizeManager component for a player. ```APIDOC ## Example: Disable Resize Manager ```javascript const player = videojs('#vid', { resizeManager: false }); ``` ``` -------------------------------- ### seekableStart() Source: https://docs.videojs.com/livetracker A helper method to get the player's seekable start time, returning 0 if not applicable. ```APIDOC ## seekableStart() ### Description A helper to get the player seekable start so that we don't have to null check everywhere. ### Returns - **number** - The earliest seekable start or 0. ``` -------------------------------- ### Localization Data Example Source: https://docs.videojs.com/controlbar Example of a localization data structure for the control bar, mapping English strings to localized versions. ```json | { | "progress bar timing: currentTime={1} duration={2}": "{1} of {2}" | } ``` -------------------------------- ### Localization JSON Example Source: https://docs.videojs.com/customcontrolspacer Example of a JSON structure for localization, mapping English strings with tokens to their localized versions. ```json | { ---|--- | "progress bar timing: currentTime={1} duration={2}": "{1} of {2}" | } ``` -------------------------------- ### Get or Set Video Source Source: https://docs.videojs.com/player Allows getting or setting the video source for the player. It's recommended to use SourceObjects for better source selection. If no source is provided, it acts as a getter. ```javascript src(sourceopt) ``` -------------------------------- ### new SpatialNavigation(player) Source: https://docs.videojs.com/spatialnavigation Constructs a SpatialNavigation instance with initial settings. Sets up the player instance, and prepares the spatial navigation system. ```APIDOC ## new SpatialNavigation(player) ### Description Constructs a SpatialNavigation instance with initial settings. Sets up the player instance, and prepares the spatial navigation system. ### Parameters #### Path Parameters - **player** (Player) - Required - The Video.js player instance to which the spatial navigation is attached. ``` -------------------------------- ### duration Source: https://docs.videojs.com/player Gets or sets the length of the video in seconds. When getting, it returns the duration; when setting, it takes an optional number of seconds. Note that the duration may not be known until the video starts playing. ```APIDOC ## duration(seconds?) ### Description Gets or sets the length of the video in seconds. When getting, it returns the duration; when setting, it takes an optional number of seconds. Note that the duration may not be known until the video starts playing. ### Method GET/SET ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body * **seconds** (number) - Optional - The duration of the video to set in seconds. ### Request Example ```json // Get duration player.duration() // Set duration player.duration(120) ``` ### Response #### Success Response (200) * **duration** (number|undefined) - The duration of the video in seconds when getting, or undefined when setting. #### Response Example ```json 120 ``` ``` -------------------------------- ### defaultMuted() Source: https://docs.videojs.com/html5 Gets the value of the `defaultMuted` attribute from the media element, indicating whether the media should start muted. ```APIDOC ## defaultMuted() ### Description Gets the value of the `defaultMuted` attribute from the media element. `defaultMuted` indicates whether the media should start muted or not. This only changes the default state of the media; `muted` and `defaultMuted` can have different values. `Html5#muted` indicates the current state. ### Returns - **boolean**: True if the media should start muted, false otherwise. ### Source * tech/html5.js, line 1464 ``` -------------------------------- ### startTracking() Source: https://docs.videojs.com/livetracker Initiates the tracking of live playback. ```APIDOC ## startTracking() ### Description Start tracking live playback. ``` -------------------------------- ### new Tech(options?, ready?) Source: https://docs.videojs.com/tech Creates an instance of the Tech class. It accepts optional player options and a callback function to be executed when the Tech is ready. ```APIDOC ## Constructor: new Tech(options?, ready?) ### Description Create an instance of this Tech. ### Parameters * `options` (Object, ) - The key/value store of player options. * `ready` (function, ) - Callback function to call when the `HTML5` Tech is ready. ``` -------------------------------- ### Manage Default Muted State Source: https://docs.videojs.com/player Gets or sets the initial muted state for the player. This affects whether the video starts muted. ```javascript var myPlayer = videojs('some-player-id'); myPlayer.src("http://www.example.com/path/to/video.mp4"); // get, should be false console.log(myPlayer.defaultMuted()); // set to true myPlayer.defaultMuted(true); // get should be true console.log(myPlayer.defaultMuted()); ``` -------------------------------- ### Initialize Plugins with Options Source: https://docs.videojs.com/tutorial-options.html Automatically initialize plugins with custom options during player setup. Note that the initialization order is not guaranteed when using this method. ```javascript videojs('my-player', { plugins: { foo: {bar: true}, boo: {baz: false} } }); ``` ```javascript var player = videojs('my-player'); player.foo({bar: true}); player.boo({baz: false}); ``` -------------------------------- ### breakpoints Source: https://docs.videojs.com/player Get or set breakpoints on the player. Calling this method with an object or `true` will remove any previous custom breakpoints and start from the defaults again. ```APIDOC ## breakpoints(breakpointsopt) ### Description Get or set breakpoints on the player. Calling this method with an object or `true` will remove any previous custom breakpoints and start from the defaults again. ### Method Not specified (assumed to be a JavaScript method call) ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None ### Parameters - **breakpoints** (Object | boolean) - Optional - If an object is given, it can be used to provide custom breakpoints. If `true` is given, will set default breakpoints. If this argument is not given, will simply return the current breakpoints. ### Response #### Success Response - **Object** - The current breakpoints configuration. ### Request Example ```javascript // Get breakpoints let currentBreakpoints = player.breakpoints(); // Set default breakpoints player.breakpoints(true); // Set custom breakpoints player.breakpoints({ '320px': { 'width': 320, 'height': 180 }, '640px': { 'width': 640, 'height': 360 } }); ``` ### Response Example ```json { "320px": {"width": 320, "height": 180}, "640px": {"width": 640, "height": 360} } ``` ``` -------------------------------- ### autoplay() Source: https://docs.videojs.com/html5 Gets the value of the `autoplay` attribute from the media element, indicating whether the media should start playing automatically as soon as it's ready. ```APIDOC ## autoplay() ### Description Get the value of `autoplay` from the media element. `autoplay` indicates that the media should start to play as soon as the page is ready. ### Returns - **boolean** - The value of `autoplay` from the media element. True indicates that the media should start as soon as the page loads. False indicates that the media should not start as soon as the page loads. ``` -------------------------------- ### Html5 Constructor Source: https://docs.videojs.com/html5 Creates an instance of the HTML5 Tech. This is the primary way to initialize the HTML5 media controller. ```APIDOC ## new Html5(options?, ready?) ### Description Create an instance of this Tech. ### Parameters #### Parameters - **options** (Object) - Optional - The key/value store of player options. - **ready** (function) - Optional - Callback function to call when the `HTML5` Tech is ready. ``` -------------------------------- ### Example SourceObject and SourceString Source: https://docs.videojs.com/global Demonstrates the structure for defining video sources, which can be an object with src and type, or a simple string URL. ```javascript var SourceObject = {src: 'http://ex.com/video.mp4', type: 'video/mp4'}; ``` ```javascript var SourceString = 'http://example.com/some-video.mp4'; ``` -------------------------------- ### defaultPlaybackRate() Source: https://docs.videojs.com/html5 Gets the default playback rate of the media element. This indicates the rate at which the media is set to play back, not the current playback rate after playback has started. ```APIDOC ## defaultPlaybackRate() ### Description Get the value of `defaultPlaybackRate` from the media element. `defaultPlaybackRate` indicates the rate at which the media is currently playing back. This value will not indicate the current `playbackRate` after playback has started, use Html5#playbackRate for that. ### Returns The value of `defaultPlaybackRate` from the media element. A number indicating the current playback speed of the media, where 1 is normal speed. * Type: number ``` -------------------------------- ### Get or Set User Active State Source: https://docs.videojs.com/player Gets or sets the user's active state. Setting the state also fires 'useractive' or 'userinactive' events. Returns the current value when getting, and nothing when setting. ```javascript userActive(boolopt) ``` -------------------------------- ### load Source: https://docs.videojs.com/player Begin loading the src data for the player. ```APIDOC ## load() ### Description Begin loading the src data. ``` -------------------------------- ### Get or Set Player Dimensions Source: https://docs.videojs.com/player Allows getting or setting the 'width' or 'height' of the player component. ```javascript player.dimension('width'); player.dimension('height', 300); player.dimension('width', '100%'); ``` -------------------------------- ### ready Event Source: https://docs.videojs.com/subtitlesbutton This event is triggered when a `Component` has finished its initialization and is ready for use. It signifies that all setup tasks are complete. ```APIDOC ## ready ### Description Triggered when a `Component` is ready. ### Type: * Event ``` -------------------------------- ### setupSourceset(tech) Source: https://docs.videojs.com/global Sets up the 'sourceset' handling for the Html5 tech, patching relevant element properties and methods to detect source changes. ```APIDOC ## setupSourceset(tech) ### Description setup `sourceset` handling on the `Html5` tech. This function patches the following element properties/functions: * `src` - to determine when `src` is set * `setAttribute()` - to determine when `src` is set * `load()` - this re-triggers the source selection algorithm, and can cause a sourceset. If there is no source when we are adding `sourceset` support or during a `load()` we also patch the functions listed in `firstSourceWatch`. ### Parameters #### Path Parameters - None #### Query Parameters - None #### Request Body - None ### Parameters - **tech** (Html5) - The tech to patch. ``` -------------------------------- ### setInterval(fn, interval) Source: https://docs.videojs.com/playprogressbar Creates a function that gets run every `x` milliseconds. This function is a wrapper around `window.setInterval`. It gets cleared via Component#clearInterval when Component#dispose gets called, and the function callback will be a Component~GenericCallback. ```APIDOC ## setInterval(fn, interval) ### Description Creates a function that gets run every `x` milliseconds. This function is a wrapper around `window.setInterval`. There are a few reasons to use this one instead though. 1. It gets cleared via Component#clearInterval when Component#dispose gets called. 2. The function callback will be a Component~GenericCallback ### Parameters Name| Type| Description ---|---|--- `fn`| Component~GenericCallback| The function to run every `x` seconds. `interval`| number| Execute the specified function every `x` milliseconds. ### Returns Returns an id that can be used to identify the interval. It can also be be used in Component#clearInterval to clear the interval. Type: number ``` -------------------------------- ### createMenu() Source: https://docs.videojs.com/captionsbutton Create the menu and add all items to it. ```APIDOC ## createMenu() ### Description Create the menu and add all items to it. ### Returns The constructed menu. Type: Menu ``` -------------------------------- ### new AudioTrackList(tracksopt) Source: https://docs.videojs.com/audiotracklist Creates a new instance of the AudioTrackList class. It can be initialized with an optional array of AudioTrack objects. ```APIDOC ## new AudioTrackList(tracksopt) ### Description Create an instance of this class. ### Parameters #### Path Parameters - **tracks** (Array.) - Optional - A list of `AudioTrack` to instantiate the list with. ``` -------------------------------- ### name() Source: https://docs.videojs.com/volumepanel Get the `Component`s name. The name gets used to reference the `Component` and is set during registration. Overrides Component#name. ```APIDOC ## name() ### Description Get the `Component`s name. The name gets used to reference the `Component` and is set during registration. ### Returns The name of this `Component`. * **Type**: string ``` -------------------------------- ### Get or Set Current Time Source: https://docs.videojs.com/player Use this method to get the current playback time in seconds or seek to a specific time. ```javascript player.currentTime(); player.currentTime(10.5); ``` -------------------------------- ### play() Source: https://docs.videojs.com/player Attempts to begin playback at the first opportunity. ```APIDOC ## play() ### Description Attempt to begin playback at the first opportunity. ### Method POST ### Endpoint N/A (Method Call) ### Parameters None ### Request Example ```json {} ``` ### Response #### Success Response (200) * **playPromise** (Promise|undefined) - Returns a promise if the browser supports Promises. This promise will be resolved on the return value of play. #### Response Example ```json { "playPromise": "[Promise Object]" } ``` ``` -------------------------------- ### Component Constructor Source: https://docs.videojs.com/component Initializes a new Component instance, attaching it to a player and configuring its options. ```APIDOC ## new Component(player, options?, ready?) ### Description Creates an instance of this class. ### Parameters * **player** (Player) - The `Player` that this class should be attached to. * **options** (Object, optional) - The key/value store of component options. * **ready** (ReadyCallback, optional) - Function that gets called when the `Component` is ready. ### Properties * **children** (Array., optional) - An array of children objects to initialize this component with. Children objects have a name property that will be used if more than one component of the same type needs to be added. * **className** (string, optional) - A class or space separated list of classes to add the component. * **ready** (ReadyCallback, optional) - Function that gets called when the `Component` is ready. ``` -------------------------------- ### name() Source: https://docs.videojs.com/currenttimedisplay Get the Component's name. The name gets used to reference the Component and is set during registration. Inherited from Component. ```APIDOC ## name() ### Description Get the `Component`s name. The name gets used to reference the `Component` and is set during registration. ### Returns - **string**: The name of this `Component`. ``` -------------------------------- ### readyState() Source: https://docs.videojs.com/html5 Gets the current ready state of the media element. This indicates how much of the media has been loaded and is available for playback. ```APIDOC ## readyState() ### Description Get the value of `readyState` from the media element. `readyState` indicates the current state of the media element. ### Returns The value of `readyState` from the media element. This will be a number from the list in the description. ### Type number ### Ready States * 0: HAVE_NOTHING * 1: HAVE_METADATA * 2: HAVE_CURRENT_DATA * 3: HAVE_FUTURE_DATA * 4: HAVE_ENOUGH_DATA ``` -------------------------------- ### Localize Function Usage Example Source: https://docs.videojs.com/customcontrolspacer Demonstrates how to use the localize function with a string, tokens, and a default value for token replacement. ```javascript | this.localize('progress bar timing: currentTime={1} duration{2}', ---|--- | [this.player_.currentTime(), this.player_.duration()], | '{1} of {2}'); ``` -------------------------------- ### on Source: https://docs.videojs.com/spatialnavigation Adds an event listener to an instance of an EventTarget. An event listener is a function that will get called when an event with a certain name gets triggered. ```APIDOC ## on(type, fn) ### Description Adds an `event listener` to an instance of an `EventTarget`. An `event listener` is a function that will get called when an event with a certain name gets triggered. ### Parameters #### Path Parameters - **type** (string|Array.) - An event name or an array of event names. - **fn** (function) - The function to call with `EventTarget`s ### Overrides - EventTarget#on ``` -------------------------------- ### ready(fn) Source: https://docs.videojs.com/volumelevel Binds a callback function to be executed when the Component reaches its ready state. If the Component is already ready, the function is invoked immediately. ```APIDOC ## ready(fn) ### Description Bind a listener to the component's ready state. Different from event listeners in that if the ready event has already happened it will trigger the function immediately. ### Method POST (or PUT, depending on convention for event binding) ### Endpoint N/A (Method Call) ### Parameters #### Path Parameters - None #### Query Parameters - None #### Request Body - **fn** (ReadyCallback) - Function that gets called when the `Component` is ready. ### Response #### Success Response (200) - None (Callback is executed) ### Response Example ```javascript // Example usage: myComponent.ready(function() { console.log('Component is ready!'); }); ``` ``` -------------------------------- ### show() Source: https://docs.videojs.com/transientbutton Makes the button visible. The button will remain visible for the `initialDisplay` time (default 4s) and will reappear with user activity. ```APIDOC ## show() ### Description Shows the button. The button will remain visible for the `initialDisplay` time, which defaults to 4 seconds, and will reappear upon user activity. ### Method POST ### Endpoint /show ``` -------------------------------- ### height Source: https://docs.videojs.com/medialoader Gets or sets the height of the component. Accepts a number or string with units (e.g., 'px', '%') for setting, and returns the current height when getting. ```APIDOC ## height(numopt, skipListenersopt) ### Description Get or set the height of the component based upon the CSS styles. See Component#dimension for more detailed information. ### Parameters #### Path Parameters * **num** (number) - Optional - The height that you want to set postfixed with '%', 'px' or nothing. * **skipListeners** (boolean) - Optional - Skip the componentresize event trigger. ### Returns The height when getting, zero if there is no height. Type: number | undefined ``` -------------------------------- ### currentTime Source: https://docs.videojs.com/player Gets or sets the current playback time of the video in seconds. When getting, it returns the current time. When setting, it seeks the video to the specified time. ```APIDOC ## currentTime(secondsopt) ### Description Get or set the current time (in seconds). ### Method GET/SET ### Endpoint player.currentTime ### Parameters #### Path Parameters - None #### Query Parameters - None #### Request Body - **seconds** (number) - Optional - The time to seek to in seconds. ### Request Example ```json { "example": "player.currentTime(10)" } ``` ### Response #### Success Response (200) - **currentTime** (number) - The current time in seconds when getting. - **Nothing** - When setting. #### Response Example ```json { "example": "10" } ``` ``` -------------------------------- ### Localize Method Usage Example Source: https://docs.videojs.com/loadingspinner Demonstrates how to use the `localize` method to translate a string with token replacements, providing a default value if needed. ```javascript | this.localize('progress bar timing: currentTime={1} duration{2}', ---|--- | [this.player_.currentTime(), this.player_.duration()], | '{1} of {2}'); ``` -------------------------------- ### Getting or Setting the Logging Level Source: https://docs.videojs.com/module-create-logger-createlogger-log Gets or sets the current logging level. If a string matching a key from module:log.levels is provided, it acts as a setter. ```javascript level(lvlopt) ``` -------------------------------- ### new Menu(player, optionsopt) Source: https://docs.videojs.com/menu Creates an instance of the Menu class. This is the constructor for the Menu component, used to initialize a new menu instance attached to a player. ```APIDOC ## new Menu(player, optionsopt) ### Description Create an instance of this class. ### Parameters * **player** (Player) - The player that this component should attach to. * **options** (Object) - Optional. An object of option names and values. ``` -------------------------------- ### one Source: https://docs.videojs.com/spatialnavigation This function will add an event listener that gets triggered only once. After the first trigger it will get removed. This is like adding an event listener with EventTarget#on that calls EventTarget#off on itself. ```APIDOC ## one(type, fn) ### Description This function will add an `event listener` that gets triggered only once. After the first trigger it will get removed. This is like adding an `event listener` with EventTarget#on that calls EventTarget#off on itself. ### Parameters #### Path Parameters - **type** (string|Array.) - An event name or an array of event names. - **fn** (function) - The function to be called once for each event name. ### Overrides - EventTarget#one ``` -------------------------------- ### setupSourcesetHandling_ Source: https://docs.videojs.com/html5 Modifies the media element to enable detection of source changes and fires a `sourceset` event immediately after the source has been updated. ```APIDOC ## setupSourcesetHandling_() ### Description Modify the media element so that we can detect when the source is changed. Fires `sourceset` just after the source has changed ``` -------------------------------- ### width Source: https://docs.videojs.com/currenttimedisplay Gets or sets the width of the component. The width can be set using CSS-compatible units like '%', 'px', or unitless values. Returns the current width when getting. ```APIDOC ## width(numopt, skipListenersopt) → {number|undefined} ### Description Get or set the width of the component based upon the CSS styles. See Component#dimension for more detailed information. ### Parameters #### Path Parameters * **num** (number | string) - Optional - The width that you want to set postfixed with '%', 'px' or nothing. * **skipListeners** (boolean) - Optional - Skip the componentresize event trigger. ### Returns The width when getting, zero if there is no width. ### Type number | undefined ``` -------------------------------- ### Example of Sub-Logger Output Source: https://docs.videojs.com/module-create-logger-createlogger-log Demonstrates the output format when using a sub-logger. The output includes the component name followed by the logged message. ```javascript | mylogger('foo'); | // > VIDEOJS: player: foo ``` -------------------------------- ### stepForward() Source: https://docs.videojs.com/seekbar Moves the playback forward quickly, intended for keyboard-only users. ```APIDOC ## stepForward() ### Description Move more quickly fast forward for keyboard-only users ``` -------------------------------- ### SkipBackward Button Configuration Example Source: https://docs.videojs.com/skipbackward Example of how to configure the SkipBackward button within the control bar options. This sets the backward skip interval to 5 seconds. ```javascript options: {controlBar: {skipButtons: {backward: 5}}} ``` -------------------------------- ### initTrackListeners() Source: https://docs.videojs.com/tech Turn on listeners for VideoTrackList, AudioTrackList, and TextTrackList events. ```APIDOC ## initTrackListeners() ### Description Turn on listeners for VideoTrackList, AudioTrackList, and TextTrackList events. This adds EventTarget~EventListeners for `addtrack`, and `removetrack`. ### Fires: - Tech#event:audiotrackchange - Tech#event:videotrackchange - Tech#event:texttrackchange ``` -------------------------------- ### ready Source: https://docs.videojs.com/errordisplay Triggered when a `Component` is ready. ```APIDOC ## ready ### Description Triggered when a `Component` is ready. ### Type * Event ``` -------------------------------- ### isAudio Source: https://docs.videojs.com/player Gets or sets the audio flag for the player. When getting, it returns a boolean indicating if the player is an audio player. When setting, it accepts a boolean to define the player's audio status. ```APIDOC ## isAudio(boolopt) → {boolean|undefined} ### Description Gets or sets the audio flag. ### Parameters #### Path Parameters - **bool** (boolean) - Optional - `true` signals that this is an audio player - `false` signals that this is not an audio player ### Returns - The current value of isAudio when getting - Nothing when setting ### Type boolean | undefined ``` -------------------------------- ### handleLateInit_ Source: https://docs.videojs.com/html5 This function will be triggered if the loadstart event has already fired, before videojs was ready. It fires another loadstart so that videojs can catchup. This method is part of the HTML5 tech. ```APIDOC ## handleLateInit_() ### Description This will be triggered if the loadstart event has already fired, before videojs was ready. Two known examples of when this can happen are: 1. If we're loading the playback object after it has started loading 2. The media is already playing the (often with autoplay on) then This function will fire another loadstart so that videojs can catchup. ### Fires * Tech#event:loadstart ### Returns - **undefined** - returns nothing. ``` -------------------------------- ### videoTracks Source: https://docs.videojs.com/player Gets the VideoTrackList. ```APIDOC ## videoTracks() ### Description Get the VideoTrackList. ### Returns - the current video track list ``` -------------------------------- ### LiveTracker Constructor Source: https://docs.videojs.com/livetracker Creates an instance of the LiveTracker class, attaching it to a player and accepting optional configuration options. ```APIDOC ## new LiveTracker(player, options) ### Description Creates an instance of this class. ### Parameters #### Path Parameters - **player** (Player) - Required - The `Player` that this class should be attached to. - **options** (Object) - Optional - The key/value store of player options. #### Properties - **trackingThreshold** (number) - Optional - Default: 20 - Number of seconds of live window (seekableEnd - seekableStart) that media needs to have before the liveui will be shown. - **liveTolerance** (number) - Optional - Default: 15 - Number of seconds behind live that we have to be before we will be considered non-live. Note that this will only be used when playing at the live edge. This allows large seekable end changes to not effect whether we are live or not. ``` -------------------------------- ### audioTracks Source: https://docs.videojs.com/player Get the AudioTrackList of the player. ```APIDOC ## audioTracks() ### Description Get the AudioTrackList. ### Method Not specified (assumed to be a JavaScript method call) ### Parameters None ### Response #### Success Response - **AudioTrackList** - The current audio track list. ### Request Example ```javascript let audioTracks = player.audioTracks(); ``` ### Response Example ```json { "length": 1, "0": { "id": "audio-track-1", "kind": "main", "label": "English", "language": "en" } } ``` ``` -------------------------------- ### new VolumeControl(player, options) Source: https://docs.videojs.com/volumecontrol Creates an instance of the VolumeControl class, attaching it to a specific player and accepting optional configuration settings. ```APIDOC ## new VolumeControl(player, options) ### Description Creates an instance of this class. ### Parameters * **player** (Player) - The `Player` that this class should be attached to. * **options** (Object) - Optional. The key/value store of player options. ``` -------------------------------- ### getTagSettings Source: https://docs.videojs.com/player Gets tag settings for a player. ```APIDOC ## getTagSettings(tag) ### Description Gets tag settings. ### Parameters #### Path Parameters - **tag** (Element) - Required - The player tag ### Returns - An object containing all of the settings for a player tag ``` -------------------------------- ### ControlBar Constructor Source: https://docs.videojs.com/controlbar Initializes a new instance of the ControlBar. ```APIDOC ## new ControlBar() ### Description Initializes a new instance of the ControlBar. ### Source * control-bar/control-bar.js, line 34 ### Extends * Component ``` -------------------------------- ### videoWidth Source: https://docs.videojs.com/player Gets the current video width. ```APIDOC ## videoWidth() ### Description Get video width. ### Returns - current video width ``` -------------------------------- ### createMenu() Source: https://docs.videojs.com/chaptersbutton Constructs a menu specifically for chapter tracks. ```APIDOC ## createMenu() ### Description Create menu from chapter track. ### Returns New menu for the chapter buttons. Type: Menu ``` -------------------------------- ### videoHeight Source: https://docs.videojs.com/player Gets the current video height. ```APIDOC ## videoHeight() ### Description Get video height. ### Returns - current video height ``` -------------------------------- ### ready(fn) Source: https://docs.videojs.com/progresscontrol Binds a listener to the component's ready state. If the component is already ready, the function is triggered immediately. ```APIDOC ## ready(fn) ### Description Bind a listener to the component's ready state. Different from event listeners in that if the ready event has already happened it will trigger the function immediately. ### Method Not specified (assumed to be a method call on a component instance) ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None ### Parameters - **fn** (ReadyCallback) - Required - Function that gets called when the `Component` is ready. ### Returns None ``` -------------------------------- ### TextTrackSettings.children Source: https://docs.videojs.com/texttracksettings Gets an array of all child components. ```APIDOC ## children() ### Description Get an array of all child components. ### Returns * **Array** - The children. ``` -------------------------------- ### children Source: https://docs.videojs.com/seektolive Get an array of all child components. ```APIDOC ## children() ### Description Get an array of all child components. ### Returns The children ### Type Array ``` -------------------------------- ### name() Source: https://docs.videojs.com/offtexttrackmenuitem Gets the component's name. ```APIDOC ## name() → {string} ### Description Gets the `Component`s name. The name gets used to reference the `Component` and is set during registration. ### Returns The name of this `Component`. ``` -------------------------------- ### TrackList Constructor Source: https://docs.videojs.com/tracklist Creates an instance of the TrackList class, initializing it with a provided list of tracks. ```APIDOC ## new TrackList(tracks) ### Description Creates an instance of the TrackList class. ### Parameters #### Path Parameters - **tracks** (Array) - Required - A list of tracks to initialize the list with. ``` -------------------------------- ### MuteToggle.children Source: https://docs.videojs.com/mutetoggle Get an array of all child components. ```APIDOC ## children() ### Description Get an array of all child components. ### Returns The children (Array) ### Overrides Button#children ### Source `component.js`, line 477 ``` -------------------------------- ### VolumeLevelTooltip Constructor Source: https://docs.videojs.com/volumeleveltooltip Creates an instance of the VolumeLevelTooltip class. This component is attached to a player and can be configured with options. ```APIDOC ## new VolumeLevelTooltip(player, options) ### Description Creates an instance of this class. ### Parameters * **player** (Player) - The Player that this class should be attached to. * **options** (Object) - Optional. The key/value store of player options. ``` -------------------------------- ### ready Source: https://docs.videojs.com/controlbar Binds a callback function to be executed when the component is ready. If the component is already ready, the function is executed immediately. ```APIDOC ## ready(fn) ### Description Binds a listener to the component's ready state. If the ready event has already occurred, the function will be triggered immediately. ### Parameters * **fn** (ReadyCallback) - The function to execute when the `Component` is ready. ``` -------------------------------- ### height Source: https://docs.videojs.com/loadingspinner Gets or sets the height of the component. ```APIDOC ## height(numopt, skipListenersopt) ### Description Get or set the height of the component based upon the CSS styles. See Component#dimension for more detailed information. ### Parameters #### Path Parameters - **num** (number | string) - Optional - The height that you want to set postfixed with '%', 'px' or nothing. - **skipListeners** (boolean) - Optional - Skip the componentresize event trigger ### Returns The height when getting, zero if there is no height Type: number | undefined ``` -------------------------------- ### width Source: https://docs.videojs.com/durationdisplay Gets or sets the width of the component. ```APIDOC ## width(numopt, skipListenersopt) → {number|undefined} ### Description Get or set the width of the component based upon the CSS styles. ### Parameters #### Parameters - **num** (number | string) - Optional - The width that you want to set postfixed with '%', 'px' or nothing. - **skipListeners** (boolean) - Optional - Skip the componentresize event trigger. ### Returns The width when getting, zero if there is no width. Type: number | undefined ``` -------------------------------- ### AudioTrackMenuItem.children Source: https://docs.videojs.com/audiotrackmenuitem Gets an array of all child components. ```APIDOC ## children() ### Description Get an array of all child components. ### Returns The children. Type: Array ``` -------------------------------- ### TextTrackSettingsFont Constructor Source: https://docs.videojs.com/texttracksettingsfont Creates an instance of the TextTrackSettingsFont class. It takes the player instance and an optional options object as parameters. ```APIDOC ## new TextTrackSettingsFont(player, options) ### Description Creates an instance of this class. ### Parameters * **player** (Player) - The `Player` that this class should be attached to. * **options** (Object, optional) - The key/value store of player options. ### Properties * **content** (ContentDescriptor, optional) - Provide customized content for this modal. * **fieldSets** (Array, optional) - Array that contains the configurations for the selects. * **selectConfigs** (Object, optional) - Object with the following properties that are the select configurations: backgroundColor, backgroundOpacity, color, edgeStyle, fontFamily, fontPercent, textOpacity, windowColor, windowOpacity. it passes to 'TextTrackFieldset'. ``` -------------------------------- ### hasStarted(request) Source: https://docs.videojs.com/player Adds or removes the 'vjs-has-started' class to the player's element based on the provided boolean value. ```APIDOC ## hasStarted(request) → {boolean} ### Description Add/remove the vjs-has-started class ### Parameters: Name| Type| Description ---|---|--- `request`| boolean| * true: adds the class - false: remove the class ### Returns: the boolean value of hasStarted_ ``` -------------------------------- ### volume Source: https://docs.videojs.com/player Gets or sets the current volume of the media. ```APIDOC ## volume(percentAsDecimalopt) ### Description Get or set the current volume of the media. ### Parameters #### Path Parameters - **percentAsDecimal** (number) - Optional - The new volume as a decimal percent: - 0 is muted/0%/off - 1.0 is 100%/full - 0.5 is half volume or 50% ### Returns - The current volume as a percent when getting - Nothing when setting ``` -------------------------------- ### enable() Source: https://docs.videojs.com/chaptersbutton Enable the `MenuButton`, allowing it to be clicked. ```APIDOC ## enable() ### Description Enable the `MenuButton`. Allow it to be clicked. ``` -------------------------------- ### TextTrackSettings Constructor Source: https://docs.videojs.com/texttracksettings Creates an instance of the TextTrackSettings class, attaching it to a given Player. ```APIDOC ## new TextTrackSettings(player, options) ### Description Creates an instance of this class. ### Parameters * **player** (Player) - The `Player` that this class should be attached to. * **options** (Object) - Optional. The key/value store of player options. ``` -------------------------------- ### scrubbing() Source: https://docs.videojs.com/tech Gets whether the video is currently being scrubbed. ```APIDOC ## scrubbing() ### Description Get whether we are scrubbing or not. ### Source - tech/tech.js, line 524 ### See - {Html5#scrubbing} ``` -------------------------------- ### length Source: https://docs.videojs.com/tracklist Gets the current number of tracks in the TrackList. ```APIDOC ## length ### Description The current number of `Track`s in this TrackList. ### Type - number ``` -------------------------------- ### handlePlay() Source: https://docs.videojs.com/livetracker Handles the first 'play' event on the player, ensuring the playback seeks to the live edge. ```APIDOC ## handlePlay() ### Description Handle the first play on the player, and make sure that we seek right to the live edge. ``` -------------------------------- ### preload(value) Source: https://docs.videojs.com/player Get or set the preload attribute. ```APIDOC ## preload(value) ### Description Get or set the preload attribute. ### Parameters Name| Type| Attributes| Description ---|---|---|--- `value`| 'none' | 'auto' | 'metadata'| | | Preload mode to pass to techSource ### Returns: * The preload attribute value when getting - Nothing when setting Type: string | undefined ``` -------------------------------- ### open() Source: https://docs.videojs.com/errordisplay Opens the modal dialog. ```APIDOC ## open() ### Description Opens the modal. ### Method N/A (JavaScript method) ### Parameters N/A ### Request Example N/A ### Response Fires: * ModalDialog#event:beforemodalopen * ModalDialog#event:modalopen ### Response Example N/A ``` -------------------------------- ### getMedia() Source: https://docs.videojs.com/player Gets a clone of the current Player~MediaObject for this player. ```APIDOC ## getMedia() ### Description Gets a clone of the current Player~MediaObject for this player. If the `loadMedia` method has not been used, will attempt to return a Player~MediaObject based on the current state of the player. ### Returns - A clone of the current Player~MediaObject. ### Type Player~MediaObject ``` -------------------------------- ### localize(string, tokens, defaultValue) Source: https://docs.videojs.com/volumepanel Localize a string given the string in english. If tokens are provided, it'll try and run a simple token replacement on the provided string. The tokens it looks for look like `{1}` with the index being 1-indexed into the tokens array. If a `defaultValue` is provided, it'll use that over `string`, if a value isn't found in provided language files. This is useful if you want to have a descriptive key for token replacement but have a succinct localized string and not require `en.json` to be included. Currently, it is used for the progress bar timing. Overrides Component#localize. ```APIDOC ## localize(string, tokens, defaultValue) ### Description Localize a string given the string in english. If tokens are provided, it'll try and run a simple token replacement on the provided string. The tokens it looks for look like `{1}` with the index being 1-indexed into the tokens array. If a `defaultValue` is provided, it'll use that over `string`, if a value isn't found in provided language files. This is useful if you want to have a descriptive key for token replacement but have a succinct localized string and not require `en.json` to be included. Currently, it is used for the progress bar timing. ### Parameters #### Path Parameters * **string** (string) - The string to localize and the key to lookup in the language files. * **tokens** (Array.) - Optional - If the current item has token replacements, provide the tokens here. * **defaultValue** (string) - Optional - Defaults to `string`. Can be a default value to use for token replacement if the lookup key is needed to be separate. ### Returns The localized string or if no localization exists the english string. * **Type**: string ``` -------------------------------- ### DescriptionsButton Constructor Source: https://docs.videojs.com/descriptionsbutton Creates an instance of the DescriptionsButton class. This button is used to toggle and select descriptions within the video.js player. ```APIDOC ## new DescriptionsButton(player, options?, ready?) ### Description Creates an instance of this class. ### Parameters * **player** (Player) - The `Player` that this class should be attached to. * **options** (Object, optional) - The key/value store of player options. * **ready** (function, optional) - The function to call when this component is ready. ``` -------------------------------- ### getPercent Source: https://docs.videojs.com/seekbar Gets the current percentage of media that has been played. ```APIDOC ## getPercent() ### Description Get the percentage of media played so far. ### Returns The percentage of media played so far (0 to 1). Type: number ``` -------------------------------- ### length Source: https://docs.videojs.com/texttrackcuelist Gets the current number of TextTrackCues in the TextTrackCueList. ```APIDOC ## length ### Description The current number of `TextTrackCue`s in the TextTrackCueList. ### Type * number ``` -------------------------------- ### ready(fn) Source: https://docs.videojs.com/menu Binds a listener to the component's ready state. If the component is already ready, the function is triggered immediately. This method overrides the base Component#ready method. ```APIDOC ## ready(fn) ### Description Bind a listener to the component's ready state. Different from event listeners in that if the ready event has already happened it will trigger the function immediately. ### Parameters Name| Type| Description ---|---|--- `fn`| ReadyCallback| Function that gets called when the `Component` is ready. ### Overrides * Component#ready ### Source * component.js, line 851 ``` -------------------------------- ### name() Source: https://docs.videojs.com/fullscreentoggle Gets the component's registered name. ```APIDOC ## name() → {string} ### Description Get the `Component`s name. The name gets used to reference the `Component` and is set during registration. ### Returns The name of this `Component`. ``` -------------------------------- ### loadMedia Source: https://docs.videojs.com/player Populate the player using a MediaObject and call a callback function when the player is ready. ```APIDOC ## loadMedia(media, ready) ### Description Populate the player using a MediaObject. ### Parameters #### Path Parameters - **media** (Player~MediaObject) - A media object. - **ready** (function) - A callback to be called when the player is ready. ```