YouTube iFrame API “setPlaybackQuality” or “suggestedQuality” not working

后端 未结 6 1081
温柔的废话
温柔的废话 2020-11-30 07:02

I\'m having some trouble setting the quality settings on a video via the Youtube iFrame API. This is my code:

var player;

player = new YT.Player(\'player\',         


        
6条回答
  •  暖寄归人
    2020-11-30 07:21

    i found a solution that works perfectly for me:

     function onPlayerStateChange(event) {
       //Some code...
    
       $(".btn-change-quality").on("click",  function(){
           pauseVideo();
           player.setPlaybackQuality('hd720');
           playVideo();
        });
    } 
    

提交回复
热议问题