new EMPAnalyticsConnector(player, analytics [, analyticsConfig])
Player class, inherits from videojs Player class.
Parameters:
Name | Type | Argument | Description |
---|---|---|---|
player |
Player | The |
|
analytics |
Object | EMPAnalytics |
|
analyticsConfig |
Object |
<optional> |
The key/value store of analytics options. |
Members
-
playerVersion
-
playerVersion
-
techVersion
-
techVersion
Methods
-
clearTimers()
-
Method to unregister and clear timers
-
dispose()
-
Cleanup and unregister events to send to analytics
-
duration()
-
Duration
Total length of the video
Returns:
The duration of the video in seconds
- Type
- number
-
entitlement( [value])
-
get or set entitlement
Parameters:
Name Type Argument Description value
Object <optional>
entitlement
Returns:
entitlement
- Type
- Object
-
getBitrate()
-
Get current bitrate
Returns:
bitrate
- Type
- number
-
getCachedCurrentTime()
-
Get Cached Current Time
Returns:
CachedCurrentTime
- Type
- number
-
hasSessionId()
-
hasSessionId
Returns:
if it hasSessionId
- Type
- boolean
-
init()
-
Initialization method
-
onBitrateChange()
-
Callback when there is a bitrate change in the playback
-
onChromeCastingStart()
-
Callback when chromecast starts casting
-
onChromeCastingStop(isChromecast)
-
Callback when chromecast stops casting and sender takes back playback session
Parameters:
Name Type Description isChromecast
boolean -
onDataSent(newRequestDate, lastRequestDate)
-
Callback after data sent to analytics
Parameters:
Name Type Description newRequestDate
Date lastRequestDate
Date -
onDispose( [event], data)
-
Callback when playback exists
Parameters:
Name Type Argument Description event
EventTarget~Event <optional>
data
Object -
onDrmSessionUpdate( [event], data)
-
onDrmSessionUpdate
Parameters:
Name Type Argument Description event
EventTarget~Event <optional>
data
Object -
onEnded()
-
Callback when playback is finished
-
onEntitlementChange( [event], data, errorSessionId)
-
Callback when there is an event to change entitlement
Parameters:
Name Type Argument Description event
EventTarget~Event <optional>
data
Object errorSessionId
string -
onEntitlementLoadStart()
-
Callback when starting to load an entitlement
-
onError( [errorEvent] [, fallbackSessionId])
-
Callback when error occurs
Parameters:
Name Type Argument Default Description errorEvent
Object <optional>
null fallbackSessionId
string <optional>
null -
onErrorBeforeAsset()
-
Callback when error occurs before loading the asset
-
onGeneric(eventName [, eventFnc] [, callback], checkSessionCreation [, ignoreDisabled])
-
Generic analytics function
Parameters:
Name Type Argument Default Description eventName
string eventFnc
function <optional>
callback
function <optional>
checkSessionCreation
boolean ignoreDisabled
boolean <optional>
false -
onLoadStart(playSessionId)
-
Callback when starting to load new media chunks
Parameters:
Name Type Description playSessionId
string -
onPause()
-
Callback when playback is paused
-
onPlay()
-
Callback when play command is triggered
-
onPlaying()
-
Callback when media is playing
-
onPlayingAfterStart()
-
Callback when there is a playing event after load started
-
onProgramChange( [event], data)
-
Callback when Program Change
Parameters:
Name Type Argument Description event
EventTarget~Event <optional>
data
Object -
onResume()
-
Callback when playback is resumed
-
onSeeked()
-
Callback when media is seeked
-
onWaiting()
-
Callback when playback enters a waiting state
-
onWaitingEnded()
-
Callback when playback leaves a waiting state
-
onWindowUnload()
-
Callback when user closes browser tab or refreshes the page
-
registerCurrentTimeTimer()
-
Registers a new timer
-
sendCurrentTime()
-
Sends current playback time to analytics
-
sessionCreated(sessionId)
-
Check if a session with given sessionId was already created
Parameters:
Name Type Description sessionId
string Returns:
sessionId
- Type
- string
-
SessionId(playSessionId)
-
Retrieves ongoing playback session id
Parameters:
Name Type Description playSessionId
string playSessionId
Returns:
playSessionId
- Type
- string