Quality of Service (QoS) offre una visualizzazione dettagliata delle prestazioni del motore video. Browser TVSDK fornisce statistiche dettagliate su riproduzione, buffering e dispositivi.
È possibile leggere le statistiche di riproduzione, buffering e dispositivo dalla classe QOSProvider.
Il QOSProvider
class fornisce varie statistiche, tra cui informazioni su buffering, bit rate, frame rate, dati temporali e così via.
Crea un'istanza di un lettore multimediale.
Creare un QOSProvider
e collegarlo al lettore multimediale.
// Create Media Player.qosProvider =
new AdobePSDK.QOSProvider();
qosProvider.attachMediaPlayer(player);
(Facoltativo) Leggi le statistiche di riproduzione.
Una soluzione per leggere le statistiche di riproduzione è disporre di un timer, che recupera periodicamente i nuovi valori QoS dalla QOSProvider
. Ad esempio:
var qosTimer = (function () {
var ref = null,
qosChangeInterval = 500, // in milliseconds
startTimer = function () {
var playbackInformation = qosProvider.playbackInformation;
console.log("Frame rate", playbackInformation.frameRate);
console.log ("Dropped frames", playbackInformation.droppedFrameCount);
console.log ("Bitrate", playbackInformation.bitrate);
console.log ("Buffering time", playbackInformation.bufferingTime);
console.log ("Buffer length", playbackInformation.bufferLength);
console.log ("Buffer time", playbackInformation.bufferTime);
console.log ("Empty buffer count", playbackInformation.emptyBufferCount);
console.log ("Time to load", playbackInformation.timeToLoad);
console.log ("Time to start", playbackInformation.timeToStart);
ref = window.setTimeout(startTimer, qosChangeInterval);
};
return {
start: function () {
if (ref !== null) {
// don't start another timeout if one already exists.
return;
}
startTimer();
},
stop: function () {
window.clearTimeout(ref);
ref = null;
}
};
})()
qosTimer.start();
(Facoltativo) Leggi le informazioni specifiche del dispositivo.
// Show device information
DeviceInformation deviceInfo = new QOSProvider().deviceInformation;
console.log("OS: "+ deviceInfo.getOS());
console.log("Width: "+ deviceInfo.getWidthPixels() +
"Height: "+ deviceInfo.getHeightPixels() );