HTML 5 视频出现问题,视频无法显示

发布于 2024-10-10 00:51:12 字数 456 浏览 0 评论 0原文

所以我为 chrome 和 firefox 制作了 HTML5 视频...当然是 mp4 和 .ogv 我遇到的问题是视频可以在某些 Chrome 浏览器上运行,而在其他浏览器上则不能运行,并且视频在任何 Firefox 浏览器上根本无法显示(请记住,所有经过测试的浏览器都已完全更新,这意味着它们支持 HTML5 视频) )这是我的源代码

<video id="the-video" width="550px" height="550px" controls>
<source src="videos/intro.mp4"  type='video/mp4; codecs="avc1.42E01E, mp4a.40.2"'>
<source src="videos/intro.ogv"  type='video/ogg; codecs="theora, vorbis"'>

</video>

so I madean HTML5 video for chrome and firefox ... mp4 and .ogv of course
The problem im having is that the video is working on some chrome browsers while it doesnt on others and the video is not showing at all on any firefox browser ( keep in mind that all browsers that were tested on were fully updated meaning they support HTML5 video ) here is my source code

<video id="the-video" width="550px" height="550px" controls>
<source src="videos/intro.mp4"  type='video/mp4; codecs="avc1.42E01E, mp4a.40.2"'>
<source src="videos/intro.ogv"  type='video/ogg; codecs="theora, vorbis"'>

</video>

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

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

发布评论

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

评论(3

烏雲後面有陽光 2024-10-17 00:51:12

添加 *.webm 并将其设为第一个源

add *.webm and make it first source

眼眸里的快感 2024-10-17 00:51:12

Firefox 不支持 H.264,Chrome 支持,但很快就会放弃

无论如何,您应该使用 HTML 5 的 Webm 视频格式。

Firefox doesn't support H.264, Chrome does but will drop soon.

Anyway you should use Webm video format for HTML 5.

幽梦紫曦~ 2024-10-17 00:51:12

尝试将 .ogv 重命名为 .ogg,服务器可能未设置为提供 .ogv 文件。我过去也曾发生过这种情况。

或者,如果您有权访问服务器,请为 .ogv 扩展名添加 MIME 类型 video/ogg。

Try renaming the .ogv to .ogg, the server might not be set up to serve .ogv files. This has happened me in the past.

Alternatively, if you have access to the server, add the MIME type video/ogg for .ogv extensions.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文