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.32k stars 429 forks source link

Trigger when stopping video #366

Closed stormit closed 6 years ago

stormit commented 6 years ago

Hello,

I need a trigger when video is stopped, not paused. Could you please tell me that your library has that trigger or not? If not, could you please add that trigger in future?

Thank you!

pupunzi commented 6 years ago

Hi, You can find all the events documentation here: https://github.com/pupunzi/jquery.mb.YTPlayer/wiki#events

stormit commented 6 years ago

Hello,

Thank you for the reply!

I found it. But I still have another problem. When video is end. Then, I click the Play button to play again. What trigger should I use in this case? I tried with YTPStart and YTPPlay. But both do not work.

Thank you!

pupunzi commented 6 years ago

Hi, The "YTPPlay" should be triggered every time the video start playing.

Do you have an URL where I can see your issue?

stormit commented 6 years ago

Hi pupunzi,

You can check with your demo file. I check the demo_as_player file.

I add the code below to your code

myPlayer = jQuery("#P1").YTPlayer(); /* My custom code */ myPlayer.on('YTPPlay', function(){ console.log('playing'); }); /* End my custom code */ myPlayer.on("YTPData", function (e) { $(".dida").html(e.prop.title + "<br>@" + e.prop.channelTitle); });

It should show the "playing" text if I click the play button. But when video is end, then I click the play button, it does not work.

Thank you!

pupunzi commented 6 years ago

Hi, it was a bug. Fixed on the next release. You can download the Master if you need the fix right now.