Player: custom player - konstantin-shinkarenko/doc-sample-proj GitHub Wiki

Conviva SDK can be used to integrate video players using explicit metric reporting using the ConvivaVideoAnalytics class methods. The major API methods shall be used for this purpose:

To report fatal playback error AND quit the session:

ConvivaVideoAnalytics.reportPlaybackFailed(errorMessage, contentInfo); This method takes errorMessage string as the first mandatory argument. The 2nd argument 'contentInfo' is optional. If not provided, Conviva SDK will use metadata previously reported by setContentInfo() or metadata passed along with reportPlaybackRequested() call.

To report fatal playback error AND keep session open (in case of re-try):

ConvivaVideoAnalytics.reportPlaybackFailed(errorMessage, contentInfo); This method takes errorMessage string as the first mandatory argument. The 2nd argument 'contentInfo' is optional. If not provided, Conviva SDK will use metadata previously reported by setContentInfo() or metadata passed along with reportPlaybackRequested() call.

To report playback metrics:

ConvivaVideoAnalytics.reportPlaybackMetric(String key, Object… val); It accepts multiple/zero values for the second argument. The values of the supported "key" argument are defined as Conviva constants (see the below table).

The keys are pre-defined in the 'ConvivaSdkConstants.PLAYBACK' object. Example usage: reportPlaybackMetric(ConvivaSdkConstants.PLAYBACK.BITRATE, 3600); // integer for this key

Key Description
PLAYER_STATE Requires: enum ConvivaSdkConstants.PlayerState. All player state changes such as Playing, Buffering etc. should be reported to CONVIVA SDK.
BITRATE Requires: int (kbps). Report new bitrate value on change event (video + audio, or video only if audio isn't available)
SEEK_START Optional: int (units - ??) . Start of seeking or scrubbing by user. If seek position is known, report as the method argument.
SEEK_END Requires: none. End of seeking or scrubbing by user
PLAY_HEAD_TIME Requires: long (seconds or ms - ??). Current playback position.
BUFFER_LENGTH Requires: long (seconds or ms - ??). Report current Buffer length of the player.
RENDERED_FRAMERATE Rendered framerate in fps.
CDN IP Requires: string. CDN IP address in string format.
☞ NOTE: The Conviva ExoPlayer module can also auto collect the CDN IP. Please contact Conviva Support to enable auto collection.
⚠️ **GitHub.com Fallback** ⚠️