pupunzi / jquery.mb.YTPlayer

use a custom yutube player for a video as background on jQuery framework
https://pupunzi.com/mb.components/mb.YTPlayer/demo/demo.html
1.33k stars 429 forks source link

How to show a loading bar #309

Closed diegoiglesias closed 6 years ago

diegoiglesias commented 6 years ago

Hi, I want to show a loading bar on the top of the page like Youtube does. I've checked YTPBuffering out but I don't think it's the right event for this.

Can you help me? Thanks

pupunzi commented 6 years ago

Hi, I don't really understand what bar are you referring to; anyway there's the 'YTPTime' event that is fired every second and returns the video played time (e.time):

myPlayer.on("YTPTime", function (e) {
     var currentTime = e.time;
     var totalTime = myPlayer.YTPGetTotalTime();
}

You can see an example in the demo.html file