Skip to main content
Skip table of contents

Insight agent public APIs

The application may use the optional features the agent supports for their respective usage if required. The agent session must be active before using these APIs.

Update Content Information

This public API can be used to update the content information while the session is active. This is useful when content information is available after the playback starts, and the application may want to notify the agent about the updated content info.

JAVA
// Informs the Insight Agent with the updated content information if the session is active

if(mInsightAgent != null) {
   mInsightAgent.updateContent(contentInfoHolder);
}

Update Audio Language

This public API can be used to update the audio language change to the agent while the session is active. It should be noted that the audio language is subject to change during the session.

JAVA
// Informs the Insight Agent with the video quality information if the session is active

if(mInsightAgent != null) {
   mInsightAgent.setAudioLanguage(audioLanguage);
}

Update Subtitle Language

This public API can be used to update the subtitle language change to the agent while the session is active. Subtitle language is subject to change during the session.

JAVA
// Informs the Insight Agent with the video quality information if the session is active

if(mInsightAgent != null) {
   mInsightAgent.setSubtitleLanguage(subtitleLanguage);
}

Update Content Quality

This public API can be used to report the content quality to the agent while the session is active. Video quality is subject to change during the session as per network bandwidth and adaptation.

JAVA
// Informs the Insight Agent with the video quality information if the session is active

if(mInsightAgent != null) {
   mInsightAgent.setContentQuality(contentQuality);
}

Add Network Event

This public API can be used to report network events to the agent.

JAVA
// Notify Network Event to the Insight Agent if the session is active

if(mInsightAgent != null) {
   mInsightAgent.addNetworkEvent(statusCode, originatingUrl, httpHeaders, requestType, mediaType, loadStartedTimestamp, loadCompletedTimestamp);
}

Report FPS

This public API can be used to report current playback rendering frames per second to the agent.

JAVA
// Notify Frames per Second to the Insight Agent if the session is active

if(mInsightAgent != null) {
   mInsightAgent.setFramesPerSecond(numberOfFrames);
}

Report Current Bitrate

This public API can be used to report the current bitrate set for the player to the agent.

JAVA
// Notify playback bitrate has changed to the Insight Agent if the session is active

if(mInsightAgent != null) {
   mInsightAgent.setBitrate(bitrate);
}

The application can also inform the agent of bitrate change with bitrate, resolution and codec info. Here the codecs parameter is the CODECS field in the definition of the variants in the manifest.

JAVA
// Notify playback bitrate has changed to the Insight Agent if the session is active

if(mInsightAgent != null) {
   mInsightAgent.setBitrate(bitrate, resolution, codecs);
}

Report Live Offset

This public API can be used to report the offset of the live playback when seeking on linear TV to the agent.

JAVA
// Notify current live offset to the Insight Agent if the session is active

if(mInsightAgent != null) {
   mInsightAgent.setOffsetFromLive(offset);
}

Add Error event

This public API can be used to report errors to the agent.

JAVA
// Notify error to the Insight Agent if the session is active

if(mInsightAgent != null) {
   mInsightAgent.addErrorEvent(errorCode, errorMessage);
}

Add MediaPlayer Error event

This public API can be used to report MediaPlayer errors to the agent. The agent wrapper takes care of reporting the playback errors by default.

JAVA
// Notify error detected by MediaPlayer.OnErrorListener to the Insight Agent if the session is active

if(mInsightAgent != null) {
   mInsightAgent.addMediaPlayerError(mediaPlayer, what, extra);
}
JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.