Performance Tracking

This demo measures key QoE metrics using the JW Player JavaScript API, including setup time and time to first frame.

License: All
Player Version:
Author: JW Player | GitHub
This demo includes:
  • .on('ready')
  • .on('firstFrame')

This demo outputs Player setup time on page load. Press play to see how long it takes to reach the first frame of video.

The JW Player JavaScript API can be used to integrate with third party QoE systems. See our JavaScript API Reference for all available QoE/QoS events.

<script type="text/javascript">

function init() {
  var player, logs;

  // For demo purposes
  if (typeof jwplayer === 'undefined') {
    setTimeout(init, 100);
    return;
  }

  player = jwplayer('container');
  logs = jwTest.makeLogger('container');

  player.setup({
    displaytitle: false,
    preload:'metadata',
    file: '//content.jwplatform.com/videos/i3q4gcBi.mp4',
    image:'//content.jwplatform.com/thumbs/i3q4gcBi.jpg'
  });

  player.on('ready', function() {
    var qoe = this.qoe();
    logs.log('The player set up in', JSON.stringify(qoe.setupTime),'ms.');
  });

  player.on('firstFrame', function() {
    var qoe = this.qoe();
    logs.log('The player took', JSON.stringify(qoe.firstFrame),'ms to get to the first frame of video.');
  });
}

init();

</script>
Please Note: This player implementation is a Proof of Concept only provided to show the possibilities of the JW Player and Platform and should not be taken as an offer to create, edit or maintain custom integration or development.