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.3k stars 431 forks source link

2 players #384

Closed voodoosnares closed 6 years ago

voodoosnares commented 6 years ago

I want to toggle Play - Pause on 2 video blocks. I have one button per video block which toggles Play/Pause.

I am using:

$.fn.playPauseYTP = function (YTP) { if (YTP[0].state == 1) { //if the player is playing YTP.YTPPause() } else { YTP.YTPPlay(); } };

with button onclick="$(this).playPauseYTP($('#${topArticle.data.source}'))

I have a problem with pausing the first video when clicking the second PLAY/PAUSE button. Can you help me with that?

Regards

pupunzi commented 6 years ago

Hi, do you have a link where I can test your issue?