Overview overview
The following instructions provide guidance for implementation across all 2.x SDKs.
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. Here are the key elements of tracking quality of experience:
Player events player-events
On any QoS metric changes:
Create or update the QoS object instance for the playback. QoS API Reference
On all bitrate change events
Call trackEvent(Media.Heartbeat.Event.BitrateChange);
Implemement QOS
-
Identify when any of QOS metrics change during media playback, create the
MediaObject
using the QoS information, and update the new QoS information.QoSObject 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 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 -
Make sure that
getQoSObject()
method returns the most updated QoS information. -
When playback switches bitrates, call the
BitrateChange
event in the Media Heartbeat instance.note important IMPORTANT Update the QoS object and call the bitrate change event on every bitrate change. This provides the most accurate QoS data.
The following sample code uses the JavaScript 2.x SDK for an HTML5 media player. You should use this code with the core media playback code.
var mediaDelegate = new MediaHeartbeatDelegate();
...
// This is called periodically by MediaHeartbeat instance
mediaDelegate.prototype.getQoSObject = function() {
return this.qosInfo;
};
if (e.type == "qos_update") {
var qosInfo = MediaHeartbeat.createQoSObject(<BITRATE>,<STARTUP_TIME>,<FPS>,<DROPPED_FRAMES>);
mediaDelegate.qosInfo = qosInfo;
};
if (e.type == "bitrate_change") {
this.mediaHeartbeat.trackEvent(MediaHeartbeat.Event.BitrateChange, qosObject);
};