为什么在 Chrome 上使用 HTML5 视频时只显示控件?

发布于 2024-09-02 07:58:47 字数 467 浏览 2 评论 0原文

我使用以下 HTML5 来显示视频,但 Chrome 中仅显示控件。在 Safari 和 Firefox 中运行良好:

<video width="720" height="480" controls="controls" preload="preload">
    <source src="<?php bloginfo('url'); ?>/wp-content/uploads/Reel.ogv" type="video/ogg; codecs=theora,vorbis" >
    <source src="<?php bloginfo('url'); ?>/wp-content/uploads/Reel.mp4" type="video/mp4">
    Your browser doesn't support video.
</video>

有什么想法吗?

I'm using the following HTML5 to display video, but only the controls show up in Chrome. Works fine in Safari and Firefox:

<video width="720" height="480" controls="controls" preload="preload">
    <source src="<?php bloginfo('url'); ?>/wp-content/uploads/Reel.ogv" type="video/ogg; codecs=theora,vorbis" >
    <source src="<?php bloginfo('url'); ?>/wp-content/uploads/Reel.mp4" type="video/mp4">
    Your browser doesn't support video.
</video>

Any ideas?

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

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

发布评论

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

评论(1

终遇你 2024-09-09 07:58:47

在我看来,第一个 标签的 type 属性格式错误:

<source src="<?php bloginfo('url'); ?>/wp-content/uploads/Reel.ogv" type="video/ogg; codecs=theora,vorbis" >

如果我的话,应该是 type="video/ogg; codecs='theora, vorbis'"记住正确。也可以尝试 type="video/ogg"。

Looks to me like the first <source> tag has a malformed type attribute:

<source src="<?php bloginfo('url'); ?>/wp-content/uploads/Reel.ogv" type="video/ogg; codecs=theora,vorbis" >

should be type="video/ogg; codecs='theora, vorbis'" if I remember correctly. Also just try type="video/ogg".

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