Youtube player api with loop

后端 未结 7 1022
伪装坚强ぢ
伪装坚强ぢ 2020-12-31 02:24

I am struggling with setting up the loop for youtube videos using youtube player api.

The problem is that the video is not running under a loop.

Here is my c

7条回答
  •  时光说笑
    2020-12-31 03:08

    Try this in your onPlayerStateChange, in some sort of way Youtube wants you to put in the videoID again.

    onStateChange: function(e){
        var id = 'qzZuBWMnS08';
    
        if(e.data === YT.PlayerState.ENDED){
            player.loadVideoById(id);
        }
    }
    

提交回复
热议问题