Youtube player api with loop

后端 未结 7 1028
伪装坚强ぢ
伪装坚强ぢ 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 02:54

    If the video isn't changing, you can just do

    onStateChange: 
        function(e) {
            if (e.data === YT.PlayerState.ENDED) {
                player.playVideo(); 
            }
        }
    

    This will prevent unnecisarily reloading the video

提交回复
热议问题