Skip to content

Additional topics for download and offline playback series

Offline Analytics events

Offline Analytics events

The SDK will autonomously save offline playback analytics in local storage and transmit them periodically when the device regains an internet connection.

During every playback session, a collection of events will be temporarily saved in the device's internal storage. These events will remain there until the user's device connects to the internet, at which point they will be securely transmitted to the analytics server as a single batch, also SDK try to send offline playback analytics in the background every 5 minutes.

The SDK will examine the locally stored events and dispatch them to the analytics server if any are Playback.Completed, Playback.Aborted, Playback.Error, Playback.GracePeriodEnded.

Offline Analytics : playback session id handling

Each offline playback session has to be identified with a unique ID which normally comes from the playSessionId in the response to an enitlement/play? request. The ID:s shall be generated by appending an increment to the earlier received playSessionId , as follows: playSessionId + '_' + increment // use underscore as separator

Pushing Offline Events to the Server

SDK is designed to push offline events to the server when network connectivity is available. It operates as a periodic job, running every 5 minutes while the app is actively in use. It ensures that analytics event data is transmitted to the analytics server efficiently and avoids running when the app is in the background.

The algorithm checks if the network is available and if the app is in an active state. It iterates through all assets in the analytics event store and, for each asset, iterates through the session storage. If the last event in a session bucket is one of the specified types (Playback.Completed, Playback.Aborted, Playback.Error, Playback.GracePeriodEnded), it sends the data to the analytics server and deletes the events from storage.

App Background

Android SDK, as per analytics specifications, will emit events when the app is backgrounded and resumed.

For offline playback, a Grace Period of 60 minutes is defined, meaning the app can be in the background for up to 60 minutes during a playback session before it's considered completed.


Table of Contents
Working with DRM protected offline content
AssetDownloadState
• Offline Analytics events (current)
Only download on wifi networks
AssetQueueDownload