Vimeo-jQuery-API icon indicating copy to clipboard operation
Vimeo-jQuery-API copied to clipboard

Multiple videos, on finish callback

Open shivamd opened this issue 9 years ago • 3 comments

Hi,

Thanks a lot for this plugin. It has been extremely helpful. Having an issue with multiple videos and callbacks.

My videos get inserted dynamically in to the page, the play/pause/seekTo etc calls work perfectly. However the on finish callback only works for the first video(iframe) inserted.

Any idea why is this happening? I have double checked, and the the src and iframe id, have the specific required unique_id.

Thanks!

shivamd avatar Aug 17 '15 06:08 shivamd

Same problem here

hjblokland avatar Sep 08 '15 14:09 hjblokland

Same.

operapreneur avatar Apr 05 '16 17:04 operapreneur

I just made an update to this plugin. It was tricky, because the Vimeo plugin normally just checks the static HTML and processes every Vimeo video on the page. In order to process dynamically added videos, you'll need to call a new vimeoLoad() method after appending it to the DOM. Example:

$("<iframe />")
    .attr("src", "https://player.vimeo.com/video/128947850")
    .appendTo("body")
    .vimeoLoad()  //This new method call after appending iframe to the DOM
    .vimeo("play"); //now you can use plugin's methods

Let me know how this works. I've tested it, and seems to work fine. But I'll consider it experimental until I hear that it's working for people.

Sorry it took so long.

jrue avatar Apr 09 '16 22:04 jrue