Player Events

The nexxPLAY SDK makes heavy Use of various Events. In order to react to them, the Page must add Listeners to those Event Types, it is interested in.

The Playstate Listener

This is the most used Listeners and receives all Events, that are exposed by a nexxPLAY Player Instance.

_play.config.addPlaystateListener(function);

The given Function will then be called for every Player related Event of every Player with a lot of Metadata. The Function will get an Object, that can easily be filtered by object.type to handle only the Events, the Page is interested in.

Please notice, that this Function will receive ALL Events of ALL Players. If that is not desired, dont use a global Listener, add a Player-specific Listener with the _play.PlayerConfiguration.playstateListeners Override.

All available Events

Here is the current List of all emitted Events (that are related to Media Playback):

Event

Description

playeradded

a new Player Instance has been added

startsession

the Player inited (or re-used) a Session

metadata

the Media Item Metadata has been loaded, parsed and verified

playerready

the Player is ready to start Playback

startplayback

the Player is starting Playback (Content or Ad)

startplay

the Player is starting Playback of Content

maininteraction

the User clicked on the Player the first Time

changemedia

the Player swaps to a new Media Item, that is not Part of the current List

changeplaypos

the Player swaps to a new Media Item in the current List

changemediaintent

the Player used virtual Prev/Next Controls, that have been activated (or the Playback has been finished and forcePrevNext is active OR ErrorExit has been disabled and the Player needs a new Media Item). This Event must be answered with a Call to one of the swapMedia Calls.

showoverlay

the Player opens the Overlay UI

hideoverlay

the Player closes the Overlay UI

enterfullscreen

the Player enters Fullscreen

exitfullscreen

the Player exists Fullscreen

enterpip

the Player enters PiP

exitpip

the Player exits PiP

enterpopout

the Player enters PopOut Mode

exitpopout

the Player exits PopOut Mode

enterremote

the Player enters a Remote Display (AirPlay, Chromecast)

exitremote

the Player exists a Remote Display (AirPlay, Chromecast)

trickplay

the Player changes Playback Speed

play

the Media Item is playing

replay

the Playback starts again

pause

the Media Item is pausing

second

every Second of Playback

quarter

every 15 Seconds of Playback

progress25

the Media Item has reached 25% of its Duration

progress50

the Media Item has reached 50% of its Duration

progress75

the Media Item has reached 75% of its Duration

progress95

the Media Item has reached 95% of its Duration

ended

the Media Item has been played completely

endedall

there is no new Media Item in the Playback List

mute

the Player is muted

unmute

the Player unmutes

unmuteautoplay

the Player was muted due to muted AutoPlay, but is now allowed to use Sound

showhotspot

a HotSpot is shown

hidehotspot

a HotSpot is removed

adcalled

the Player is calling for Ads

adstarted

an Ad starts

adended

an Ad ends

aderror

ad Ad Error occured

adclicked

an Ad has been clicked

adresumed

a paused Ad is resuming

adcompanions

the Player found Ad Companions, that can be integrated

bumperclicked

a Bumper has been clicked

error

a fatal Error has occured and the Player cannot continues

intersection

the Player is more/less visible than before

paypreviewended

the Player is stopping, as the Media is a PayPreview Item, which

reached its free Duration

presentationtarget

the Player was in PresentationMode and the User selected a Media Item

for Playback in a Detail View

downloadstarted

the Download of an Attachment, Source File or localMedia Process has started

downloadprogress

returns Information about a started Downloads Progress

downloadready

a Download has been finished successfully

downloaderror

a Download has been finished with an Error

newcontentrequest

will be emitted, if the SDK received an App-related Command via MediaSession (only android/androidTV SDK)

closerequest

will be emitted, if the "back" Button in Fullscreen Mode (enabled via "showCloseButtonOnFullscreen" Environment) was pressed and therefore, the PlayerView should be removed by the App (only android/androidTV SDK)

Please notice, that on iOS, the Events (Notification) have a different Name, that is built by the following Rule: "nexxPlay" + EventName.camelCase() + "Notification". So for example, a "pause" Notification will become a "nexxPlayPauseNotification", and a "changeplaypos" Notification will become a "nexxPlayChangePlayPosNotification"

Every Event consists of a Data Object besides the Event Name. Accessing the Details varies between Player Technologies, but in General, the Events provide at least basic Information of the Media, that it refers to (EVENT.mediaID, EVENT.globalID, EVENT.streamtype).

These Events are also supported by nexxPLAY for iOS and nexxPLAY for android.

nexxPLAY for iOSnexxPLAY for Android

Additional Listener Functions

Although the PlaystateListener is the most used Listener, the nexxPLAY SDK offers a variety of other Listener Functionalities, that can be used in advanced Contexts.

//get notified for Addon Events
_play.config.addAddonListener(function,addonName);

Event

Description

addonrendered

the Player rendered an Addon

addonerror

a Player Addon could not be finished and removes itself

//get notified for Widget Events
_play.config.addWidgetListener(function);

Event

Description

widgetclicked

the Widget has been Clicked

widgeterror

the Widget could not load the Feed

//get notified for LifeCycle Events like "freeze"
_play.config.addLifecycleListener(function);
//get notified for Network Events like "online, offline"
_play.config.addNetworkListener(function);
//get notified for Geo (and Geo Permission) Events
_play.config.addGeoListener(function);

Last updated