如何解决切换下一个标签页后,停止为带有YouTube视频的引导标签页付款
我有一个Bootstrap标签,其中添加了3个视频,这些视频作为iframe从youtube添加。我的问题是,当我在第一个选项卡上播放视频时移至第二个或第三个选项卡时,它不会停止/暂停。同样,当此选项卡模块添加到模型弹出窗口中时,当我关闭弹出窗口时,它仍在后台运行视频。想知道如何在移至另一个标签页或关闭弹出窗口后停止或暂停该视频吗?
<div class="modal-body">
<div class="tab-content" id="myTabContent">
<div class="tab-pane fade show active" id="home" role="tabpanel" aria-labelledby="home-tab"><iframe src="https://www.youtube.com/embed/cCxcxRw9j_s?rel=0&modestbranding=1&autohide=1&showinfo=0&controls=0" allowfullscreen="" width="100%" height="699" frameborder="0"></iframe></div>
<div class="tab-pane fade" id="profile" role="tabpanel" aria-labelledby="profile-tab"><iframe src="https://www.youtube.com/embed/sivXk8cTPIA?rel=0&modestbranding=1&autohide=1&showinfo=0&controls=0" allowfullscreen="" width="100%" height="436" frameborder="0"></iframe></div>
<div class="tab-pane fade" id="contact" role="tabpanel" aria-labelledby="contact-tab"><iframe src="https://www.youtube.com/embed/bT9Tta7xWdo?rel=0&modestbranding=1&autohide=1&showinfo=0&controls=0" allowfullscreen="" width="100%" height="436" frameborder="0"></iframe></div>
</div>
<ul class="nav nav-tabs" id="myTab" role="tablist">
<li class="nav-item">
<a class="nav-link active" id="home-tab" data-toggle="tab" href="#home" role="tab" aria-controls="home" aria-selected="true" onclick="changeVideo('https://www.youtube.com/watch?v=cCxcxRw9j_s&t=6s');"><span>VIDEO 1</span></a>
</li>
<li class="nav-item">
<a class="nav-link" id="profile-tab" data-toggle="tab" href="#profile" role="tab" aria-controls="profile" aria-selected="false" onclick="changeVideo('https://www.youtube.com/watch?v=sivXk8cTPIA&t=6s');"><span>VIDEO 2</span></a>
</li>
<li class="nav-item">
<a class="nav-link" id="contact-tab" data-toggle="tab" href="#contact" role="tab" aria-controls="contact" aria-selected="false" onclick="changeVideo('https://www.youtube.com/watch?v=bT9Tta7xWdo&t=6s');"><span>VIDEO 3</span></a>
</li>
</ul>
</div>
谢谢
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。