html - 如何让 YouTube 自动播放为网站工作?
问题描述
我一直在尝试让客户在访问我的网站时自动播放 youtube 视频。我一直在环顾四周,发现 Google 禁用了该功能。无论如何都要编写一些代码,这样人们就不必手动启用它,或者手动单击它?我不是编码专家,所以请原谅我的无知
我的代码:
<!DOCTYPE html>
<html>
<head>
<style>
body {
background-color: black;
}
h1 {
color: white;
text-align: center;
}
p {
font-family: verdana;
font-size: 20px;
}
</style>
</head>
<body>
<iframe width="560" height="315" src="https://www.youtube.com/embed/DkW87-Z9FAY?autoplay=1"></iframe>
</body>
</html>
解决方案
您设置什么并不重要,因为浏览器和用户已经设置了自己的偏好。
推荐阅读
- ldap - LDAP sudoers sudoHost 通配符
- form-recognizer - 已使用无法在 MS Flow 中检测到的标签进行训练的表单识别器模型
- r - 如何改变ggplot中椭圆的半透明度?
- c# - 将输入数据从 Web 应用程序保存到数据库
- ios - 为什么我的 sendEmailVerification(beforeUpdatingEmail) 函数不总是返回错误?
- java - 减小签名的 apk 大小
- python - ValueError:无法将输入数组从形状(424,16,3)广播到形状(128,160,3)
- github - 将 GitHub 操作标记为可选
- apache-kafka - Kafka Connect - 如果我无法直接访问 Kafka 集群,是否可以使用?
- r - 如何在 R 中使用 ggpairs 添加第二个图例?