Expand all

InlinePlayer

All JS for loading an actual video.js player for MediaWiki

No matter how the player is loaded, it should eventually go through this class to make sure our customizations are properly applied. This should not have any loaders/hooks itself.

Constructor

new InlinePlayer(element, options) #

Parameters:

Name Type Description
element HTMLMediaElement
options videojs.Options

for the video.js player

Source:

Properties

audioConfig :videojs.Optionsstatic #

videoJS player options specific to audio playback These options are merged into the final config for the player during initialize()

Type:

Source:

videoJS player options specific to audio playback These options are merged into the final config for the player during initialize()

globalConfig :videojs.Optionsstatic #

videoJS player options shared by all uses These options are merged into the final config for the player during initialize()

Type:

Source:

videoJS player options shared by all uses These options are merged into the final config for the player during initialize()

html5techOpt :Objectstatic #

videoJS options for the videojs Html5 Tech plugin. These options are merged into the final config for the player during initialize()

Text tracks are not preloaded because we may have a large number of subtitles which never get used, and it's expensive to load them all.

More consistent subtitle rendering is available due to disabling native text tracks.

Disabling native audio tracks avoids accidentally exposing the Opus audio tracks in HTTP Live Streaming playlists on Safari, which can't actually play them and breaks things if you switch to them

Type:

  • Object
Source:
videoJS options for the videojs Html5 Tech plugin.

videoConfig :videojs.Optionsstatic #

videoJS player options specific to videos These options are merged into the final config for the player during initialize()

Type:

Source:

videoJS player options specific to videos These options are merged into the final config for the player during initialize()

Methods

extractResolutions() → {Array.<number>} #

Extract the list of resolutions from the HTMLSourceElements contained within the HTMLMediaElement.

Also sets translated labels and the extracted res as attributes 'label' and 'res' on the HTMLSourceElements, for use by the resolution switcher plugin

Source:

Returns:

Type
Array.<number>

Extract the list of resolutions from the HTMLSourceElements contained within the HTMLMediaElement.

infuse() → {JQueryPromise.<videojs.Player>} #

Takes the HTMLMediaElement of the InlinePlayer and infuses it with JS (videoJS) to enrich the element.

Source:

Returns:

Type
JQueryPromise.<videojs.Player>

Takes the HTMLMediaElement of the InlinePlayer and infuses it with JS (videoJS) to enrich the element.

selectDefaultTrack() #

Select a default text track to enable based on user language with fallback to content language

Source:

Select a default text track to enable based on user language with fallback to content language