vimeo / player.js

Interact with and control an embedded Vimeo Player.
https://player.vimeo.com/api/demo
MIT License
1.45k stars 262 forks source link

Play 2 vimeo videos after eachother. #518

Closed Cookiezzz closed 4 years ago

Cookiezzz commented 4 years ago

Expected Behavior

I'm trying to use player.js in a project of mine. I attempt to play different videos after one another.

Actual Behavior

It stops, fires the 'ended' event, tells me it's playing the second video but on screen it's just blank. It could be my bad coding as well.. I'm just looking for a solution..

Steps to Reproduce

See fiddle below. Normally my video ID changesso hence why i'm looping through it all instead of using the loop option. https://jsfiddle.net/Cookiezzz/kdrvautm/6/

Cookiezzz commented 4 years ago

Found the issue.

setTimeout(function() {
     VimeoPlayer.destroy();
}, 1000);

Completed whenever the next video was trying to play. Used promise and it's now working fine.