UZ.Player(id) → {Player}

new Player(id) → {Player}

Create an player by id of iframe

Parameters:
Name Type Description
id String

Id of iframe tag.

Returns:
Player -

Returns a Player object

Members

iframe :Element

The iframe DOM element used for init options

Methods

addRemoteTextTrack(options) → {HTMLTrackElement}

Create an emulated TextTrack for use by addRemoteTextTrack

This is intended to be overridden by classes that inherit from Tech in order to create native or custom TextTracks.

Parameters:
Name Type Description
options Object

The object should contain the options to initialize the TextTrack with.

Properties
Name Type Attributes Description
kind string <optional>

TextTrack kind (subtitles, captions, descriptions, chapters, or metadata).

label string <optional>

Label to identify the text track

language string <optional>

Two letter language abbreviation.

Returns:
HTMLTrackElement -

The track element that gets created.

aspectRatio(ratioopt) → {string|undefined}

A getter/setter for the Player's aspect ratio.

Parameters:
Name Type Attributes Description
ratio string <optional>

The value to set the `Player's aspect ratio to.

Returns:
string | undefined -
  • The current aspect ratio of the Player when getting.
      - undefined when setting

autoplay(valueopt) → {string}

Get or set the autoplay attribute.

Parameters:
Name Type Attributes Description
value boolean <optional>
  • true means that we should autoplay
     - false means that we should not autoplay
Returns:
string -

The current value of autoplay when getting

bufferedPercent() → {number}

Get the percent (as a decimal) of the video that's been downloaded

Returns:
number -

0 means none, 1 means all.

canPlayType(type) → {string}

Check whether the player can play a given mimetype

Parameters:
Name Type Description
type string

The mimetype to check

Returns:
string -

'probably', 'maybe', or '' (empty string)

See:

controls(boolopt) → {boolean}

Get or set whether or not the controls are showing.

Parameters:
Name Type Attributes Description
bool boolean <optional>
  • true to turn controls on
     - false to turn controls off
Fires:
  • Player#event:controlsenabled
Returns:
boolean -

The current value of controls when getting

currentLevel(levelopt) → {number|undefined}

Get/Set the level of video quality

Parameters:
Name Type Attributes Description
level number <optional>

Level to change

Returns:
number | undefined -

returns the current level of video quality when getting

currentTime(timeopt) → {number|undefined}

Get/Set the current time

Parameters:
Name Type Attributes Description
time string <optional>

Time for seek to

Returns:
number | undefined -

returns the current time when getting

dispose()

Turn off all event polyfills, clear the Players properties

Fires:
  • Player#event:dispose

duration() → {number|undefined}

Get the duration

Returns:
number | undefined -

returns the duration

enterFullWindow()

When fullscreen isn't supported we can stretch the video container to as wide as the browser will let us.

Fires:
  • Player#event:enterFullWindow

exitFullscreen()

Return the video to its normal size after having been in full screen mode

Fires:
  • Player#event:fullscreenchange

exitFullWindow()

Exit full window

Fires:
  • Player#event:exitFullWindow

height(valueopt) → {number}

A getter/setter for the Player's height. Returns the player's configured value. To get the current height use currentheight().

Parameters:
Name Type Attributes Description
value number <optional>

The value to set the Player's heigth to.

Returns:
number -

The current height of the Player when getting.

isFullscreen(isFSopt) → {boolean}

Check if the player is in fullscreen mode or tell the player that it is or is not in fullscreen mode.

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.

Parameters:
Name Type Attributes Description
isFS boolean <optional>

Set the players current fullscreen state

Returns:
boolean -
  • true if fullscreen is on and getting
      - false if fullscreen is off and getting

language(codeopt) → {string}

The player's language code 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.

Parameters:
Name Type Attributes Description
code string <optional>

the language code to set the player to

Returns:
string -

The current language code when getting

load()

Begin loading the src data.

loop(valueopt) → {string}

Get or set the loop attribute on the video element.

Parameters:
Name Type Attributes Description
value boolean <optional>
  • true means that we should loop the video
     - false means that we should not loop the video
Returns:
string -

The current value of loop when getting

muted(mutedopt) → {boolean}

Get the current muted state, or turn mute on or off

Parameters:
Name Type Attributes Description
muted boolean <optional>
  • true to mute
     - false to unmute
Returns:
boolean -
  • true if mute is on and getting
      - false if mute is off and getting

off(type, fn)

Removes an event listener for a specific event from an instance of Player. This makes it so that the event listener will no longer get called when the named event happens.

Parameters:
Name Type Description
type string | Array.<string>

An event name or an array of event names.

fn EventListener

The function to remove.

on(type, fn)

Adds an event listener to an instance of an Player. An event listener is a function that will get called when an event with a certain name gets triggered.

Parameters:
Name Type Description
type string | Array.<string>

An event name or an array of event names.

fn EventListener

The function to call.

See:

pause() → {Player}

Pause the video playback

Returns:
Player -

A reference to the player object this function was called on

paused() → {boolean}

Check if the player is paused or has yet to play

Returns:
boolean -
  • false: if the media is currently playing
      - true: if media is not currently playing

play() → {Promise|undefined}

start media playback

Returns:
Promise | undefined -

Returns a Promise if the browser returns one, for most browsers this will return undefined.

playbackRate(rateopt) → {number}

Gets or sets the current playback rate. A playback rate of 1.0 represents normal speed and 0.5 would indicate half-speed playback, for instance.

Parameters:
Name Type Attributes Description
rate number <optional>

New playback rate to set.

Returns:
number -

The current playback rate when getting or 1.0

See:

playsinline(valueopt) → {string|Player}

Set or unset the playsinline attribute. Playsinline tells the browser that non-fullscreen playback is preferred.

Parameters:
Name Type Attributes Description
value boolean <optional>
  • true means that we should try to play inline by default
     - false means that we should use the browser's default playback mode,
       which in most cases is inline. iOS Safari is a notable exception
       and plays fullscreen by default.
Returns:
string | Player -
  • the current value of playsinline
      - the player when setting
See:

poster(srcopt) → {string}

Get or set the poster image source url

Parameters:
Name Type Attributes Description
src string <optional>

Poster image source URL

Fires:
  • Player#event:posterchange
Returns:
string -

The current value of poster when getting

preload(valueopt) → {string}

Get or set the preload attribute

Parameters:
Name Type Attributes Description
value boolean <optional>
  • true means that we should preload
     - false maens that we should not preload
Returns:
string -

The preload attribute value when getting

qualities() → {array}

Get the video qualites

Returns:
array -
  • Array of object which have key label to display

remainingTime() → {number}

Calculates how much time is left in the video. Not part of the native video API.

Returns:
number -

The time remaining in seconds

requestFullscreen()

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.

Fires:
  • Player#event:fullscreenchange

reset()

Reset the player. Loads the first tech in the techOrder, and calls reset on the tech`.

src(sourceopt) → {string|undefined}

Get or set the video source.

Parameters:
Name Type Attributes Description
source Tech~SourceObject | Array.<Tech~SourceObject> | string <optional>

A SourceObject, an array of SourceObjects, or a string referencing a URL to a media source. It is highly recommended that an object or array of objects is used here, so that source selection algorithms can take the type into account.

   If not provided, this method acts as a getter.
Returns:
string | undefined -

If the source argument is missing, returns the current source URL. Otherwise, returns nothing/undefined.

volume(percentAsDecimalopt) → {number}

Get or set the current volume of the media

Parameters:
Name Type Attributes Description
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:
number -

The current volume as a percent when getting

width(valueopt) → {number}

A getter/setter for the Player's width. Returns the player's configured value. To get the current width use currentWidth().

Parameters:
Name Type Attributes Description
value number <optional>

The value to set the Player's width to.

Returns:
number -

The current width of the Player when getting.