UZPlayer(selector, options) → {UZPlayer}

new UZPlayer(selector, options) → {UZPlayer}

Create an player by selector of element

Parameters:
Name Type Description
selector string

Selector of element tag.

options object

Configuration

Returns:
UZPlayer -

Returns a UZPlayer object

See:

Namespaces

PlaybackState

Methods

bufferedPercent() → {number}

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

Returns:
number -

0 means none, 1 means all.

destroy()

Turn off all event, clear the UZPlayer properties

getAutoPlay() → {boolean}

Get the autoplay attribute.

Returns:
boolean -

The current value of autoplay when getting

getCurrentLevel() → {number|undefined}

Get the level of video quality

Returns:
number | undefined -

returns the current level of video quality when getting

getCurrentTime() → {number}

Get the current time in seconds

Returns:
number -

returns the current time when getting

getDuration() → {number}

Get the duration in seconds

Returns:
number -

Returns the duration

getFullscreen() → {boolean}

Check if the player is in fullscreen mode

Returns:
boolean -

true if fullscreen is on and getting; false if fullscreen is off and getting

getPlaybackState() → {UZPlayer#PlaybackState}

Get the current playback state of the media

Returns:
UZPlayer#PlaybackState -

The current current playback state when getting

getPlayPercentage() → {number}

Get the play percentage of the media

Returns:
number -

The play percentage when getting, in range 0~100

getVolume() → {number}

Get the current volume of the media

Returns:
number -

The current volume as a percent when getting

initLive(entityId, entityId, entityId, callback)

Call initialize VOD.

Parameters:
Name Type Description
entityId string

The entityId

entityId string

The streamName

entityId string

The region

callback function

The callback function

initVOD(entityId, callback)

Call initialize VOD.

Parameters:
Name Type Description
entityId string

The entityId

callback function

The callback function

onEnded(callback)

Callback when the end of the media resource is reached.

Parameters:
Name Type Description
callback function

The callback function

onError(callback)

Callback when playback error

Parameters:
Name Type Description
callback function

The callback function

onFullscreen(callback)

Callback when fullscreen state changed

Parameters:
Name Type Description
callback function

The callback function

onLevel(callback)

Callback when the video quality change manualy

Parameters:
Name Type Description
callback function

The callback function

onLoad(callback)

Callback when the player start to load media

Parameters:
Name Type Description
callback function

The callback function

onPause(callback)

Callback when playback changed to PAUSED

Parameters:
Name Type Description
callback function

The callback function

See:

onPlay(callback)

Callback when playback changed to PLAYING

Parameters:
Name Type Description
callback function

The callback function

See:

onPlaybackState(callback)

Callback when playback changed

Parameters:
Name Type Description
callback function

The callback function

See:

onQualities(callback)

Callback when the list qualities of video change

Parameters:
Name Type Description
callback function

The callback function

onVolume(callback)

Callback when volume changed

Parameters:
Name Type Description
callback function

The callback function

onWaiting(callback)

Callback when playback changed to WAITING

Parameters:
Name Type Description
callback function

The callback function

See:

pause()

Pause media playback

play()

Start media playback

qualities() → {array}

Get the video qualites

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

setAutoPlay(value)

Set the autoplay attribute.

Parameters:
Name Type Description
value boolean

The new value:

   - true means that we should autoplay
   - false means that we should not autoplay

setCurrentLevel(levelopt)

Set the level of video quality

Parameters:
Name Type Attributes Description
level number <optional>

Level to change

setCurrentTime(timeopt)

Set the current time in seconds

Parameters:
Name Type Attributes Description
time number <optional>

Time for seek to

setFullscreen(fullscreen)

Set fullscreen to on/off

Parameters:
Name Type Description
fullscreen boolean

Set fullscreen

   - true enter fullscreen
   - false exit fullscreen

setMute(muted)

Turn mute on or off

Parameters:
Name Type Description
muted boolean

Turn mute on or off:

   - true to mute
   - false to unmute

setPlayPercentage(percentageopt)

Set the play percentage of the media

Parameters:
Name Type Attributes Description
percentage number <optional>

The new percentage, in range 0~100:

    - 0 is seek to 0%
    - 10 is seek to 10%
    - ...

setVolume(percentAsDecimalopt)

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%

toggleFullscreen()

Toggle fullscreen to on/off

toggleMute()

Toggle muted state to on/off