这个问题在这里已经有了答案:
Show Youtube video source into HTML5 video tag?
(8 个回答)
Unable to load youtube video using <video> tag where youtube url is inputted in textfield
(3 个回答)
1年前关闭。
我无法播放视频,链接取自 YouTube,代码如下:
<!DOCTYPE html>
<html>
<head>
<title>Audio & Video</title>
</head>
<body>
<h1></h1>
<video src="https://www.youtube.com/watch?v=Et2HGG_Hfdk&t=3s" controls autoplay>
Your Browser Does Not Support the Video Format
</video>
</body>
</html>
最佳答案
这不是嵌入 YouTube 视频的正确方法。
您需要使用 YouTube 的官方嵌入方法,如下所示:
<iframe src="https://www.youtube.com/embed/Et2HGG_Hfdk?start=3" frameborder="0" allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>
关于html - 无法使用 YouTube 中的链接播放视频,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/63760766/