Track quality of experience on Chromecast track-quality-of-experience-on-chromecast

The following instructions provide guidance for implementation across all 2.x SDKs.

If you are implementing a 1.x version of the SDK, you can download the 1.x Developers Guides here: Download SDKs.

Overview overview

Quality of experience tracking includes quality of service (QoS) and error tracking, both are optional elements and are not required for core media tracking implementations. You can use the media player API to identify the variables related to QoS and error tracking.

Player events player-events

On all bitrate change events

  • Create/update the QoS object instance for the playback, qosObject
  • Call trackEvent(Media.Heartbeat.Event.BitrateChange, qosObject);

On player errors

Call trackError("media error id");

Implement implement

  1. Identify when the bitrate changes during media playback and create the MediaObject instance using the QoS information.

    QoSObject variables:

    note tip
    These variables are only required if you are planning to track QoS.
    table 0-row-3 1-row-3 2-row-3 3-row-3 4-row-3 3-align-center 7-align-center 11-align-center 15-align-center 19-align-center
    Variable Description Required
    bitrate Current bitrate Yes
    startupTime Startup time Yes
    fps FPS value Yes
    droppedFrames Number of dropped frames Yes

    QoS object creation: createQoSObject

    code language-none
    qosInfo =, 0, 24, 10);
  2. When playback switches bitrates, call the BitrateChange event in the Media Heartbeat instance: trackEvent

    code language-none;
    note important
    Update the QoS object and call the bitrate change event on every bitrate change. This provides the most accurate QoS data.
  3. Make sure that getQoSObject() method returns the most updated QoS information.

  4. When the media player encounters an error, and the error event is available to the player API, use trackError() to capture the error information. (See Overview.)

    note tip
    Tracking media player errors will not stop the media tracking session. If the media player error prevents the playback from continuing, make sure that the media tracking session is closed by calling trackSessionEnd() after calling trackError().