new module:vLite/Player/PlayerYoutube(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
getCurrentTime() → {Float|Integer}
Get the player current time
- Source:
Returns:
Current time of the video
- Type
- Float | Integer
getDuration() → {Float|Integer}
Get the player duration
- Source:
Returns:
Duration of the video
- Type
- Float | Integer
getInstance() → {Object}
Get the player instance
- Source:
Returns:
Youtube API instance
- Type
- Object
initYoutubePlayer()
Initialize the Youtube player
- Source:
methodMute()
Mute method of the player
- Source:
methodPause()
Pause method of the player
- Source:
methodPlay()
Play method of the player
- Source:
methodUnMute()
Unmute method of the player
- Source:
onPlayerReady(data)
Function executed when the player is ready
Parameters:
| Name | Type | Description |
|---|---|---|
data |
Object | Youtube datas from the player API |
- Source:
onPlayerStateChange(e)
Function executed when the player state changed
Parameters:
| Name | Type | Description |
|---|---|---|
e |
Object | Event listener datas |
- Source:
onProgressChanged(e)
Function executed on the video progress changed
Parameters:
| Name | Type | Description |
|---|---|---|
e |
Object | Event listener datas |
- Source:
removeInstance()
Remove the Youtube instance
- Source:
setCurrentTime(Current)
Set the new current time for the player
Parameters:
| Name | Type | Description |
|---|---|---|
Current |
Float | Integer | time video |
- Source: