Track quality of experience on Roku track-quality-of-experience-on-roku

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

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

Implement QOS

  1. Identify when the bitrate changes during media playback, and use the mediaUpdateQoS API to update the QoS info on the Media SDK.

    QoSObject variables:

    note tip
    TIP
    These variables are only required if you are tracking 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

    For example:

    code language-none
    bitrate = 200000
    fps = 0
    droppedFrames = 1
    startupTime = 2
    qosinfo = adb_media_init_qosinfo(bitrate, startupTime, fps, droppedFrames)
    
    ADBMobile().mediaUpdateQoS(qosinfo)
    
  2. When playback switches bitrates, call trackEvent(BitrateChange) to notify the Media SDK that the Bitrate changed.

    code language-none
    ADBMobile().mediaTrackEvent(ADBMobile().MEDIA_BITRATE_CHANGE)
    
    note note
    NOTE
    You need to call updateQoSObject with the updated bitrate value.
  3. 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
    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().
recommendation-more-help
c8eee520-cef5-4f8c-a38a-d4952cfae4eb