【问题标题】:How to autoplay multiple youtube videos and muted them?如何自动播放多个 youtube 视频并将它们静音?
【发布时间】:2017-06-22 10:35:31
【问题描述】:

如何自动播放 多个 youtube 视频并将其静音?我有下面的代码,但它只适用于一个视频,多个视频呢?

<div id="muteYouTubeVideoPlayer"></div>

<script async src="https://www.youtube.com/iframe_api"></script>
<script>
 function onYouTubeIframeAPIReady() {
  var player;
  player = new YT.Player('muteYouTubeVideoPlayer', {
    videoId: 'e3Nl_TCQXuw', // YouTube Video ID
    width: 560,               // Player width (in px)
    height: 316,              // Player height (in px)
    playerVars: {
      autoplay: 1,        // Auto-play the video on load
      controls: 0,        // Show pause/play buttons in player
      showinfo: 0,        // Hide the video title
      modestbranding: 1,  // Hide the Youtube Logo
      loop: 1,            // Run the video in a loop
      fs: 0,              // Hide the full screen button
      cc_load_policy: 0, // Hide closed captions
      iv_load_policy: 3,  // Hide the Video Annotations
      autohide: 0         // Hide video controls when playing
    },
    events: {
      onReady: function(e) {
        e.target.mute();
      }
    }
  });
 }

</script>

【问题讨论】:

    标签: video youtube youtube-api mute


    【解决方案1】:

    要播放多个 youtube 视频,您可以使用 api 中的播放器参数。 您将从这里获得以上所有内容 https://developers.google.com/youtube/player_parameters

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2016-08-02
      • 1970-01-01
      • 2012-02-10
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2018-12-17
      相关资源
      最近更新 更多