PlayerEvent
On this page
- PlayerEvent ⇐
Class
- PlayerEvent()
- “sourceChangeRequest” (source, previousSource)
- “sourceChangeSuccess” (source)
- “sourceChangeError” (error)
- “stateChanged” (newState, oldState, [reason])
- “contentProtectionClear”
- “contentProtectionGranted”
- “contentProtectionDenied” (error)
- “audioTrackChange”
- “videoTrackChange”
- “subtitleTrackChange”
- “formatChanged”
- “programChange” (program)
- “channelSignalGot”
- “channelSignalLost” (error)
- “channelDecodeFailure”
- “streamReady”
- “drmLoadingError” (code)
- “connectionRecovered”
- “connectionLost”
- “parentalLock” (error)
- “parentalUnlock”
- “adultLock”
- “adultUnlock”
- “channelLock” (error)
- “channelUnlock”
- “timeshiftStarted” (data)
- “timeshiftStopped”
- “playPositionChange” (data)
- “playSpeedChange” (data)
- “unknownError” (error)
- pipEnabled
- pipDisabled
- pipEnter
- pipExit
- adEvent
PlayerEvent ⇐ Class
Kind: static class
Extends: Class
- .PlayerEvent ⇐
Class
- new PlayerEvent()
- instance
- “sourceChangeRequest” (source, previousSource)
- “sourceChangeSuccess” (source)
- “sourceChangeError” (error)
- “stateChanged” (newState, oldState, [reason])
- “contentProtectionClear”
- “contentProtectionGranted”
- “contentProtectionDenied” (error)
- “audioTrackChange”
- “videoTrackChange”
- “subtitleTrackChange”
- “formatChanged”
- “programChange” (program)
- “channelSignalGot”
- “channelSignalLost” (error)
- “channelDecodeFailure”
- “streamReady”
- “drmLoadingError” (code)
- “connectionRecovered”
- “connectionLost”
- “parentalLock” (error)
- “parentalUnlock”
- “adultLock”
- “adultUnlock”
- “channelLock” (error)
- “channelUnlock”
- “timeshiftStarted” (data)
- “timeshiftStopped”
- “playPositionChange” (data)
- “playSpeedChange” (data)
- “unknownError” (error)
- static
PlayerEvent()
A static class that exposes all the event used by the players and their features
“sourceChangeRequest” (source, previousSource)
Triggered when a request has been made to change the source.
The source is reputed as valid, as defined by checkSource
method. See: AbstractPlayer with inherited function MPlayer#checkSource
Kind: event emitted by PlayerEvent
Param | Type | Description |
---|---|---|
source | AbstractSource | The targeted source (which is not yet played but is valid) |
previousSource | AbstractSource | The previousSource |
“sourceChangeSuccess” (source)
Triggered when the source has been changed successfully.
Kind: event emitted by PlayerEvent
Param | Type | Description |
---|---|---|
source | AbstractSource | The targeted source (which is now played following the source change) |
“sourceChangeError” (error)
Triggered when a source could not be changed, ie a fatal error occurs (source does not exists, is invalid, …) You should note that the source in argument is the targeted source, as it case of error the current source will be set to undefined.
Kind: event emitted by PlayerEvent
Param | Type | Description |
---|---|---|
error | AbstractPlayerSourceChangeError | The player error |
“stateChanged” (newState, oldState, [reason])
Triggered when a new state has been set.
Kind: event emitted by PlayerEvent
Param | Type | Description |
---|---|---|
newState | number | The new state |
oldState | number | The old state |
[reason] | number | The reason of the state change (optional) |
“contentProtectionClear”
Triggered when the content is not protected and the player has the rights to read the content.
Kind: event emitted by PlayerEvent
“contentProtectionGranted”
Triggered when the content is protected and the player has the rights to read the content.
Kind: event emitted by PlayerEvent
“contentProtectionDenied” (error)
Triggered when the content is protected and the player does not have rights to read the content.
Kind: event emitted by PlayerEvent
Param | Type | Description |
---|---|---|
error | AbstractPlayerError | The player error |
“audioTrackChange”
Triggered when the audio track changes.
Kind: event emitted by PlayerEvent
“videoTrackChange”
Triggered when the video track changes.
Kind: event emitted by PlayerEvent
“subtitleTrackChange”
Triggered when the subtitle track changes.
Kind: event emitted by PlayerEvent
“formatChanged”
Triggered when the format changes.
Kind: event emitted by PlayerEvent
“programChange” (program)
Triggered by player’s implementation when current broadcast program is finished and a new one has started.
Kind: event emitted by PlayerEvent
Param | Type | Description |
---|---|---|
program | AbstractGridProgram | the new current program |
“channelSignalGot”
Triggered when the signal of the current channel has been acquired It happens generally following a (successful) zap
Kind: event emitted by PlayerEvent
“channelSignalLost” (error)
Triggered when the signal of the current channel has been lost
Kind: event emitted by PlayerEvent
Param | Type | Description |
---|---|---|
error | AbstractPlayerError | The player error |
“channelDecodeFailure”
Triggered when the signal has not been decoded for some reasons
Kind: event emitted by PlayerEvent
“streamReady”
Triggered when a stream has been loaded
Kind: event emitted by PlayerEvent
“drmLoadingError” (code)
Player implementation is firing this event when the manifest/DRM loading failed
Kind: event emitted by PlayerEvent
Param | Description |
---|---|
code | An internal DRM error code |
“connectionRecovered”
Triggered when connection has been recovered It happens generally following a (successful) zap
Kind: event emitted by PlayerEvent
“connectionLost”
Triggered when the connection has been lost
Kind: event emitted by PlayerEvent
“parentalLock” (error)
Triggered when the player has been locked because of a parental control
Kind: event emitted by PlayerEvent
Param | Type | Description |
---|---|---|
error | AbstractPlayerError | The player error |
“parentalUnlock”
Triggered when the player has been unlocked because of a parental control
Kind: event emitted by PlayerEvent
“adultLock”
Triggered when the player has been locked because of adult control
Kind: event emitted by PlayerEvent
“adultUnlock”
Triggered when the player has been unlocked after adult control
Kind: event emitted by PlayerEvent
“channelLock” (error)
Triggered when the player has been locked because of a channel locked
Kind: event emitted by PlayerEvent
Param | Type | Description |
---|---|---|
error | AbstractPlayerError | The player error |
“channelUnlock”
Triggered when the player has been unlocked because of a channel unlocked
Kind: event emitted by PlayerEvent
“timeshiftStarted” (data)
Triggered when timeshift is started (LivePlayer only)
Kind: event emitted by PlayerEvent
Param | Type | Description |
---|---|---|
data | Object | Additional data |
data.speedRation | number | The speed used to enter timeshift |
“timeshiftStopped”
Triggered when timeshift is stopped (LivePlayer only)
Kind: event emitted by PlayerEvent
“playPositionChange” (data)
Triggered when the play position has changed
Kind: event emitted by PlayerEvent
Param | Type | Description |
---|---|---|
data | Object | Additional data |
data.position | number | The new position in milliseconds |
“playSpeedChange” (data)
Triggered when the play speed has changed
Kind: event emitted by PlayerEvent
Param | Type | Description |
---|---|---|
data | Object | Additional data |
data.speed | number | The new speed |
“unknownError” (error)
Used to trigger an unknown player error Usefull for some implementations
Kind: event emitted by PlayerEvent
Param | Type | Description |
---|---|---|
error | AbstractPlayerError | The player error |
pipEnabled
Triggered when the player activates PiP mode (i.e. is prepared for PiP mode)
Kind: static property of PlayerEvent
pipDisabled
Triggered when the player no longer has PiP mode enabled
Kind: static property of PlayerEvent
pipEnter
Triggered when the player enters in PiP mode (i.e. is displayed in small)
Kind: static property of PlayerEvent
pipExit
Triggered when the player is no longer displayed in PiP mode
Kind: static property of PlayerEvent
adEvent
Triggered when ad states change of when user interact with the ad
Kind: static property of PlayerEvent