The following page contains instructions on how to integrate using Rsut SDK for a few advanced use cases, such as fatal errors, reporting live program and playlist changes.After completing the initial stream sensor integration, use these instructions as an add-on to achieve specific goals.
Report Live, Live Linear, or FAST Program Changes
Report program changes during live, live linear, or FAST streaming
Users may switch from one program to another at the program boundary either during live or live linear streaming. To report such changes, use the update_content_info(update_info) API and update the asset name and any other metadata that has changed at the program boundary.
The following is the sample code:
let mut update_info = CISContentInfo::new();
content_info.asset_name = Some("Asset name of the next program".to_string());
let res = video_session.update_content_info(update_info);
Report Playlist Changes
Report video changes in playlist
Users may switch from one playlist item to another during streaming. To report these changes, close the previous session and open a new session using the create_session(content_info) API.
Sample code:
let mut content_info = create_metadata();
content_info.asset_name = Some("Next playlist item".to_string());
// Create video session
let video_session_result = conviva_client.create_session(content_info);
Report Errors
Playback does not recover from error and is reported once only
Playback encounters a fatal error from which it does not recover. Use the report_error(errorMessage, isFatal) API to report this to Conviva, so that Conviva can close the monitoring session.
Sample code:
// true for fatal errors and false for warnings
let res = video_session.report_error("errorMessage", true);
Retry - Playback does not recover from error and fatal errors are reported multiple times
Playback encounters an initial fatal error from which it does not recover. However, an application or player timeout triggers a retry behavior. In such a use case, invoke the report_error(errorMessage, isFatal) API to report each error to Conviva, so that Conviva can keep the session active until all retry attempts are exhausted. When no more retries are available from the application's perspective, the Conviva monitoring session is closed.
Sample code:
let res = video_session.report_error("errorMessage1", true);
res = video_session.report_error("errorMessage2", true);
res = video_session.report_error("errorMessage3", true);
.
.
.
res = video_session.report_error("errorMessage_n", true);
video_session.cleanup();
Playback recovers from a fatal error by switching to a different asset URL
Playback has encountered an error and on retrying with a different asset url, it recovered during the same playback session. In such cases, use the report_error(errorMessage, isFatal) API to report the error and update_content_info(content_info) API to update the stream URL once the playback has recovered.
Sample code:
let res = video_session.report_error("errorMessage1", true);
let mut content_info = create_metadata();
content_info.stream_url = Some("UPDATED_STREAM_URL".to_string());
let res = video_session.update_content_info(content_info);
Playback recovery in multi CDN scenario
Playback has encountered an error and on retrying with a different CDN, it recovered during the same playback session. In such cases, use the report_error(errorMessage, isFatal) API to report the error. Then, update the stream URL corresponding to the newer CDN once the playback has recovered.
Sample code:
let res = video_session.report_error("errorMessage1", true);
let mut content_info = create_metadata();
content_info.stream_url = Some("NEW_CDN_STREAM_URL".to_string());
let res = video_session.update_content_info(update_info);
Playback is not impacted due to a warning error type
The player or application encountered an error that does not impact video playback. However, if you still want to report it, then ensure to report it as WARNING. Invoke the report_error(errorMessage, isFatal) API to report the error severity as a warning.
Sample code:
let res = video_session.report_error("errorMessage1", false);
Optimize Monitoring During User Wait State
User Actions: User Dialogues
Conviva prefers to optimize certain portions of monitoring during user wait state, so that it does not inaccurately reflect in metrics like VST. For that, monitoring must be turned off when video playback request is halted due to user dialogues like:
pin popup
accepting strong language or violence
confirming age
startover or resume dialogue
watch party initiation
These user dialogues can be handled using the following APIs:
On user wait started:
video_session.detach();
On user wait ended:
let attach_status = video_session.attach(Arc::downgrade(&player_if));