静音和循环youtube视频

时间:2015-09-30 18:47:18

标签: javascript loops youtube mute

出于某种原因,我无法循环播放简单的YouTube视频。 我已经提供了所有必需品属性并使用了这里提供的j https://developers.google.com/youtube/iframe_api_reference#Examples但似乎没有任何工作

<iframe id="player" type="text/html" style="width:500px;height:400px;" src="http://www.youtube.com/embed/bXpUFEWmD6c?autoplay=1&rel=0?loop=1&showinfo=0&html5=1&autoplay=1&autohide=0&showsearch=0&rel=0&hd=1&modestbranding=1&disablekb=1&rel=0&enablejsapi=1" frameborder="0" allowfullscreen></iframe>

function onYouTubeIframeAPIReady() {
  var player;
  player = new YT.Player('player', {

  playerVars: { 'loop': 1,  },
    events: {
      'onReady': onPlayerReady,
      'onPlaybackQualityChange': onPlayerPlaybackQualityChange,
      'onStateChange': onPlayerStateChange,
      'onError': onPlayerError
    }
  });
}

function onPlayerReady(event) {
  event.target.setVolume(0);
  event.target.playVideo();
}

0 个答案:

没有答案