Media Analytics
Mobile | Web | TV Platforms | ||||
---|---|---|---|---|---|---|
Media Analytics​
The DIVA SDK provides a Media Analytics Interface, which exposes low-level media player events. Integrators can write code to intercept these events and implement their own Media Analytics integration, depending on the provider of their choice. Popular providers include New Relic, Mux, Akamai, Conviva, etc.
Additionally, DIVA offers ready-to-use media analytics plugins implementation:
Easily integrate the Media Analytics Plugin to the host application and connect to DIVA through the same Media Analytics Interface. You can find out more about these plugins in the SDK section of this documentation.
Interface​
All Media Analytic events in DIVA's player are raised through a callback. Implement your own Media Analytics plugin by registering to such callback.
- Web
- iOS
- tvOS
- Android
- WebTV
- Roku
new Diva('.diva-player-container', {
// ...
onMediaAnalyticEvent: function (event) {
process(event)
}
})
var config = DivaConfiguration(/* ... */)
config.onMediaAnalyticsUpdate = { event in
process(event)
}
let diva = Diva(configuration: config)
var config = DivaTVConfiguration(/* ... */)
config.onMediaAnalyticsUpdate = { event in
process(event)
}
let diva = DivaTV(configuration: config)
DivaFragment.newInstance(
DivaConfiguration(
// ...
customMediaAnalyticsCallback = { event ->
process(event)
}
)
)
onMediaAnalytics={event => plugin.handleEvent(event)}
' Observe Diva Player media analytics event call
observeDivaPlayerMediaAnalyticsEvent("mediaAnalyticsCallback")
...
' Media analytics event handler callback
sub mediaAnalyticsCallback(evt as dynamic)
data = evt.getData()
print data
end sub
It's important to note that because one single DIVA session can switch between multiple videos and even start multiple simultaneous playback sessions, any plugin must consider this complexity.
Events list​
The Event received in the mediaAnalyticsCallback
is a strongly typed payload on each platform. The Events list is a summary of the exposed events and their meaning.
Common playerId
parameter​
All events contain a playerId
, a random identifier associated with a playback session. The purpose of this playerId is for the listener/plugin to distinguish between multiple playback sessions.
Event list​
videoOpen​
- Payload: videoId
- Description: Fired right before the VideoMetadata is requested for the first time
videoLoaded​
- Payload: VideoMetadata
- Description: Fired every time the VideoMetadata for a certain video is updated
videoReady​
- Payload: Platform-specific payload containing the Media Player
- Description: Fired every time DIVA video is ready to be played
videoDurationChanged​
- Payload:
duration
- The current total duration of the video (not trimmed) - Description: Fired as soon as the video duration is known and every time the video duration changes
videoEnded​
- Description: Fired when the video playback ends naturally (by reaching the duration)
videoClosed​
- Description: Fired when the video playback session is closed prematurely (before reaching the duration)
videoReplay​
- Description: Fired when a video is played again from the beginning
videoError​
- Payload:
error
- An error payload that includes two parameters:message
(string): A string representation of the errorfatal
(boolean): Indicating whether the error is resulting in an interrupted playback
- Description: Fired every time the Media Player component encounters playing the video
airplayStatusChanged​
- Payload:
isActive
- A Boolean indicating whether Airplay is active - Description: Fired every time Airplay casting is engaged or disengaged (only applicable to iOS)
seekStarted​
- Playload: The current relative playhead position within the video (start time of the seek)
- Description: Fired every time a seek operation is initiated
seekEnded(time: CMTime)​
- Playload: The current relative playhead position within the video (destination of the seek)
- Description: Fired every time a seek operation is completed
playbackStarted​
- Description: Fired when the first frame of the video is displayed on screen
playbackPaused​
- Description: Fired every time the playback is paused
waitingUserInteraction​
- Description: Fired when the player is waiting for user interaction before continuing. This is web-specific in case the video cannot automatically play (refer to browser autoplay policies)
playbackBitrateChanged​
- Payload:
bitrate
- The new bitrate being applied. Note that the unit of measure is platform-specific because it depends on the underlying Media Player being used - Description: Fired when the player bitrate has changed
bufferingStarted​
- Description: Fired every time the media player starts buffering
bufferingEnded​
- Description: Fired every time the media player ends buffering
playbackRateChanged(rate: Float)​
- Description: Fired every time the playback rate changes where 1.0 is the normal playback speed
prerollStarted​
- Description: Fired when a CSAI pre-roll Advertisement has started playing
prerollEnded​
- Description: Fired when a CSAI pre-roll Advertisement has finished playing
midrollStarted​
- Description: Fired when a CSAI mid-roll Advertisement has started playing
midrollEnded​
- Description: Fired when a CSAI mid-roll Advertisement has finished playing
ssaiStarted​
- Description: Fired when an SSAI/DAI Advertisement has started playing
ssaiEnded​
- Description: Fired when an SSAI/DAI Advertisement has finished playing