vimeo / player.js

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

When I keep playing multiple videos, it'll be a black screen. #222

Closed an1101 closed 6 years ago

an1101 commented 6 years ago

Expected Behavior

I would like to keep playing multiple videos in turn. For example, when A is ended, B starts to play. When B is ended, C starts to play. When C is ended, A starts to play.

Actual Behavior

Now, multiple videos keep playing in turn. But when time has passed for a while, a screen becomes black. Control bar is moving like "now playing", or it's indicated "I'm sorry. .." If an error occurs, I'd like to play or reload. Any advice, please.

Steps to Reproduce

-HTML-

<div id="player_1" width="100%"></div>
<div id="player_2" width="100%"></div>

-js-

$(function() {
var options = {
        id: AAAAAAAA,
        autoplay: true,  
        autopause: true
    };
    var options2 = {
         id: BBBBBBBB,
        autopause: true
    };

    var player01 = new Vimeo.Player($('#player_1'), options);
    var player02 = new Vimeo.Player($('#player_2'), options2);

    player01.setVolume(0); 
    player01.play();

    player01.on('ended', function(data) {
        player01.setCurrentTime(0);
        player02.setVolume(0);
        player02.play();
    });

    player02.on('ended', function(data) {
        player02.setCurrentTime(0);
        player01.setVolume(0);
        player01.play();       
    });
});
luwes commented 6 years ago

Duplicate of #166