1
votes

i want check jwplayer buffer 100 percent, code look like this:

<script type='text/javascript'>
      var myPlayer = jwplayer('myPlayer').setup({...});
      myPlayer.onBufferChange(function(e) {
      if (e.buffer == 100) {//but result is undefined
          console.log('done!');
      }
   });
</script>

how i can do this? somebody can help me?

1
Where are you running this? (link)emaxsaun
how do you know the result is undefined? why do you need to check for the buffer being 100 percent? can you please include the rest of your setup code and/or a full code sample/link?Elon Zito

1 Answers

0
votes

Check out this fiddle. The second alert should say 100.

jwplayer("player").setup({
     file: "http://clips.vorwaerts-gmbh.de/VfE_html5.mp4",
     events:{
        onBufferChange: function(callback) {
        alert(callback.bufferPercent);
            }
        }
 });

http://jsfiddle.net/simsketch/h71moacv/