Track quality of experience using JavaScript 3.x track-quality-of-experience-on-javascript

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

IMPORTANT
If you are implementing any previous versions of the SDK, you can download the Developers Guides here: Download SDKs.

Implement QOE

  1. Identify when the bitrate changes during media playback and create the qoeObject instance using the QoE information.

    QoEObject variables:

    note tip
    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
    Variable Type Description
    bitrate number Current bitrate
    startupTime number Startup time
    fps number FPS value
    droppedFrames number Number of dropped frames

    QoE object creation:

    code language-js
    // Replace <bitrate>, <startuptime>, <fps> and
    // <droppeFrames> with the current playback QoE values.
    var qoeObject = ADB.Media.createQoEObject(<bitrate>,
                                                   <startuptime>,
                                                   <fps>,
                                                   <droppedFrames>);
    tracker.updateQoEObject(qoeObject);
    
  2. When playback switches bitrates, call the BitrateChange event in the Media Heartbeat instance:

    code language-js
    _onBitrateChange = function() {
        // If the new bitrate value is available provide it to the tracker.
        var qoeObject = ADB.Media.createQoEObject(1000000, 2.4, 25, 10);
        tracker.updateQoEObject(qoeObject);
    
        tracker.trackEvent(ADB.Media.Event.BitrateChange);
    };
    
    note important
    IMPORTANT
    Update the QoE object and call the bitrate change event on every bitrate change. This provides the most accurate QoE data.
  3. Make sure to call updateQoEObject() method to provide the most updated QoE information to the SDK.

  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
    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