单击按钮播放谷歌驱动器视频

问题描述

我试图在单击按钮时播放来自我的谷歌驱动器的嵌入视频。 jquery 代码似乎试图工作,但最终没有。关于如何使这项工作或替代方法的任何想法?谢谢!

<!DOCTYPE HTML>
<html lang="en">
<head>
<Meta charset="UTF-8">
<Meta name="viewport" content="width=device-width,initial-scale=1.0">
<title>Drive video</title>
<script src="https://code.jquery.com/jquery-3.5.1.min.js" integrity="sha256- 
9/aliU8dGd2tb6OSsuzixeV4y/faTqgFtohetphbbj0=" crossorigin="anonymous"></script>
</head>
<body>
<iframe id="vid" height="500px" width="1000px" 
src="https://drive.google.com/file/d/164zWpJx9BoilrVzDzbh-dLJ3hvpsYUNc/preview"></iframe>
<button id="play" style="margin-top: 300px;">Play</button>

<script>
    $(document).ready(function() {
 $('#play').on('click',function(ev) {

 $("#vid")[0].src += "&autoplay=1";
 ev.preventDefault();

 });
 });
</script>
 </body>
 </html>

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)