gpt4 book ai didi

javascript - YouTube 全屏背景自动播放在 YTplayer 中不起作用

转载 作者:行者123 更新时间:2023-11-29 14:51:16 25 4
gpt4 key购买 nike

I am using YTplayer plugin for fullscreen youtube player in this-website Get inspired tab!

  • 我在下面提供了带有有用链接的代码!我认为代码是正确的!
  • 如果我们点击悬停在视频播放器底部的播放控件,播放器就会工作!(下图)!
  • 请帮我解决为什么自动播放不起作用?
  • 我的代码哪里出错了?

player


有用链接>>


https://github.com/pupunzi/jquery.mb.YTPlayer

http://pupunzi.open-lab.com/mb-jquery-components/jquery-mb-YTPlayer/

http://pupunzi.com/#mb.components/mb.YTPlayer/YTPlayer.html


这是>


<a class="player" id="player" data-property="{
videoURL: 'https://www.youtube.com/watch?v=j9fgbuH0_RI&feature=youtu.be',
containment:'#videobg',
autoPlay: true,
optimizeDisplay: true,
showControls: true,
startAt: 0,
opacity: 1,
ratio: '4/3',
addRaster: false }"></a>

<div id="videobg" class="section-divider white-text videobg" data-scroll-index="4">
<div class="pattern-overlay"></div>
<div class="triangle-right"></div>

<div class="container extra-padding">
<div class="col-md-5 extra-padding">
<h1>INNOVATING THROUGH TRAVEL</h1>
<p>Travel is more than the seeing of sights; it is a change that goes on, deep and permanent, in the ideas of living.</p>
</div>
</div>
</div>

解决方案

  • 为 ytplayer 使用最新版本的 java 脚本。

最佳答案

编辑

问题似乎来自 repo jquery.mb.YTPlayer。如果我们看问题 https://github.com/pupunzi/jquery.mb.YTPlayer/issues/49

确保您拥有最新版本的存储库。


从 repo 阅读文档后,尝试将 autoPlay: true, 替换为 autoplay: true,

最终代码:

<a class="player" id="player" data-property="{
videoURL: 'https://www.youtube.com/watch?v=j9fgbuH0_RI&feature=youtu.be',
containment:'#videobg',
autoplay: true,
optimizeDisplay: true,
showControls: true,
startAt: 0,
opacity: 1,
ratio: '4/3',
addRaster: false }"></a>

<div id="videobg" class="section-divider white-text videobg" data-scroll-index="4">
<div class="pattern-overlay"></div>
<div class="triangle-right"></div>

<div class="container extra-padding">
<div class="col-md-5 extra-padding">
<h1>INNOVATING THROUGH TRAVEL</h1>
<p>Travel is more than the seeing of sights; it is a change that goes on, deep and permanent, in the ideas of living.</p>
</div>
</div>
</div>

文档:https://github.com/pupunzi/jquery.mb.YTPlayer/wiki

关于javascript - YouTube 全屏背景自动播放在 YTplayer 中不起作用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/25499179/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com