寻求一些帮助以获取从 youtube 嵌入的视频,作为图像幻灯片中的第 4 项。最终结果应该是播放前 3 个图像,一旦播放到第 4 个元素(即视频),它应该自动播放,视频结束后,它应该移动到幻灯片放映中的下一个图像的顶部。
我的网站是 www.serenitygardenrooms.com
我的无效代码片段是:
<section id="home-slider" class="flexslider fullbg"
style="background-image:url(img/slide/home/1_1_.jpg); height:600px; padding:0px;">
景观。范围。风格。语境。
<p class="home-slide-content bounceIn animated" data-wow-delay="0.5s" data-wow-duration="10s">
We <span class="highlight">build</span> it
</p>
</div>
</li>
<li class="home-slide">
<div class="flex-caption transparent light-font center flexslider fullbg" style="background-image:url(img/slide/home/2.jpg); height:600px; width:100%; padding:0px; margin-top:0px;">
<p class="home-slide-content bounceInLeft animated" data-wow-delay="0.5s" data-wow-duration="10s" style="margin-top:150px;">
Scape. <span class="highlight">Scope.</span> Style.<span class="highlight"> Context.</span>
</p>
<p class="home-slide-content bounceIn animated" data-wow-delay="0.5s" data-wow-duration="10s">
We <span class="highlight">build</span> it
</p>
</div>
</li>
<li class="home-slide">
<div class="flex-caption transparent light-font center flexslider fullbg" style="background-image:url(img/slide/home/3.jpg); height:600px; width:100%; padding:0px; margin-top:0px;">
<p class="home-slide-content bounceInLeft animated" data-wow-delay="0.5s" data-wow-duration="10s" style="margin-top:150px;">
Scape. <span class="highlight">Scope.</span> Style.<span class="highlight"> Context.</span>
</p>
<p class="home-slide-content bounceIn animated" data-wow-delay="0.5s" data-wow-duration="10s">
We <span class="highlight">build</span> it
</p>
</div>
</li>
<li class="home-slide">
<div class="flex-caption transparent light-font center flexslider fullbg" style="background-image:url(img/slide/home/4.jpg); height:600px; width:100%; padding:0px; margin-top:0px;">
<iframe src="https://www.youtube.com/watch?v=WyjK8mjhjb4?autoplay=1" width="100%" height="600px" frameborder="0" allowfullscreen></iframe>
</div>
</li>
最佳答案
您需要一个事件来捕捉 HTML5 视频中的结束事件。 有一个类似的问题:
关于javascript - 嵌入式 Youtube 视频自动播放 - 在图像幻灯片中间,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31902653/