将网站背景的 youtube 视频静音

Mute a youtube video for website background

我有一个网站,我想在其中使用全宽视频。我以前让它完全正常工作,但曾经静音的视频随机播放声音。从它工作时(没有声音)到现在,我根本没有接触过代码。我查看了从中获取代码的教程,那里的声音也没有静音,所以我很好奇它是否是 youtube 的东西。

这是教程的link: http://bootsnipp.com/snippets/featured/ful-screen-video-background

这是应该静音的地方,在数据中的锚标记中-属性是mute:true

<section class="content-section video-section">
  <div class="pattern-overlay">
  <a id="bgndVideo" class="player" data-property="{videoURL:'https://www.youtube.com/watch?v=fdJc1_IBKJA',containment:'.video-section', quality:'large', autoPlay:true, mute:true, opacity:1}">bg</a>
    <div class="container">
      <div class="row">
        <div class="col-lg-12">
        <h1>Full Width Video</h1>  
        <h3>Enjoy Adding Full Screen Videos to your Page Sections</h3>
       </div>
      </div>
    </div>
  </div>
</section>

我尝试使用 muted:true 代替,因为我可以在 google 搜索中找到它,但它也没有任何作用,所有其他搜索都说 mute:true 应该可以,有人能看出这个问题吗?或者知道另一种静音方法吗?

你可以试试这个 library。它有 MUTE 选项,还有其他很棒的功能。

你也得到了这个library。您只需包含 js 文件并调用函数,例如:

$(document).ready(function() {  
    ytbg("vQWlNALvbhE", 0, 17, 1);
});

作为解释:

ytbg("video link", starttime, endtime, volume).