我尝试在我的页面上添加带有 HTML 的 YouTube 视频,但它不起作用

发布于 2025-01-13 10:16:27 字数 155 浏览 2 评论 0原文

<video width="300px" 
height="300px" controls>
<source 
src"https://YouTube.be/y8yv4pn 

o7qc" type="video/mp4>

<video width="300px" 
height="300px" controls>
<source 
src"https://YouTube.be/y8yv4pn 

o7qc" type="video/mp4>

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

下壹個目標 2025-01-20 10:16:27

标签适用于计算机上的本地文件。另外,请确保正确设置元素格式,如本网站所示:https://www.w3schools。 com/html/html5_video.asp
如果您要下载视频并在项目中使用它,它会如下所示:

<video width="300px" height="300px" controls>
    <source src="./myvideo.mp4" type="video/mp4">
</video>

如果您想使用 Youtube 视频,则标签为:。以下是文档:https://www.w3schools.com/html/html_youtube.asp。这是一些示例代码:

<iframe width="300px" height="300px" src="https://youtube.com/video"></iframe>

The <video> tags are for local files on your computer. Also, make sure to format correctly the element like in this website: https://www.w3schools.com/html/html5_video.asp.
If you were to download a video, and use it in your project, it would look like this:

<video width="300px" height="300px" controls>
    <source src="./myvideo.mp4" type="video/mp4">
</video>

If you want to use Youtube videos, the tag is: <iframe>. Here is the documentation: https://www.w3schools.com/html/html_youtube.asp. Here is some sample code:

<iframe width="300px" height="300px" src="https://youtube.com/video"></iframe>
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文