Class: module:vLite/Player

module:vLite/Player(selector, options, callback)

new module:vLite/Player(selector, options, callback)

Instanciate the constructor

Parameters:
Name Type Description
selector String | Object

CSS selector or query selector

options Object

Player options

callback function

Callback function executed when the player is ready

Source:

Methods

(static) checkSupportFullScreen()

Check fullscreen support API on different browsers and cached prefixs

Source:

(static) formatVideoTime(time)

Convert video time second to 00:00 display

Parameters:
Name Type Description
time Float | Integer

Current time

Source:

afterPlayPause()

Function executed after the play or pause method

Source:

bindEvents()

Create event listeners All listeners are created on class properties to facilitate the deletion of events

Source:

buildPlayer()

Build the DOM of the player

Source:

destroy()

Destroy the player Remove event listeners, player instance and player HTML

Source:

exitFullscreen()

Exit fullscreen after user action

Source:

fastForward(e)

Trigger the video fast forward (front and rear)

Parameters:
Name Type Description
e Object

Event listener datas

Source:

isTouch() → {Boolean}

Check if browser support touch event

Source:
Returns:

Touch event support

Type
Boolean

loading(state)

Update the loader status

Parameters:
Name Type Description
state Boolean

Status of the loader

Source:

mute()

Mute the volume on the video

Source:

onKeyup(e)

Function executed on keyup event listener Toggle the video on spacebar press

Parameters:
Name Type Description
e Object

Event listener datas

Source:

onMousemove()

Function executed on mousemove event listener Toggle controls display on mousemove event

Source:

onVideoEnded()

Function executed when is video is ended

Source:

pause()

Pause the video

Source:

play()

Play the video

Source:

playerIsReady()

Function executed when the player is ready

Source:

requestFullscreen()

Request fullscreen after user action

Source:

seekTo(newTime)

Update the current time of the video

Parameters:
Name Type Description
newTime Float | Integer

New current time of the video

Source:

toggleFullscreen()

Toggle the fullscreen of the video

Source:

togglePlayPause()

Function executed to toggle the video status (play, pause)

Source:

toggleVolume()

Toggle the volume on the video

Source:

unBindEvents()

Unbind event listeners

Source:

unMute()

Toggle the volume on the video

Source:

updateCurrentTime()

Update current time displaying in the control bar and the width of the progress bar

Source:

updateDuration()

Update player duration

Source: