Reputation: 329
Playing multiple videos with video-js functionality is actually possible:
However when wrapping a trigger such as a button around the function which invokes playVideo()
, the video-js functionality breaks from the second video on.
...
$('#start').click(function() {
...
});
...
// The rest of the code in Fiddle 2 is similar to Fiddle 1
What am I doing wrong?
Upvotes: 0
Views: 892
Reputation: 36
You should pass a number to the playVideo()
function as a parameter. In your examples they are set to 0.
Then turn
videojs(document.getElementsByClassName("video-js")[0], {}, function () {});
to
videojs(document.getElementsByClassName("video-js")[number], {}, function () {});
That´s it:
Demo: JS Fiddle
Upvotes: 1