Html 视频播放器播放声音但不播放视频 [英] Html Video player plays sound but not video

查看:34
本文介绍了Html 视频播放器播放声音但不播放视频的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在制作网页,正在尝试插入视频.视频播放器加载正常,您可以按播放键,但只能播放音频,不能播放视频.(在 chrome 中预览时)在 Firefox 中查看时它可以正常工作

Im in the process of making a webpage, and im trying to insert a video. The video player loads fine, and you can press play, but only the audio plays, not the video. (When previewing in chrome) When viewing in firefox it works properly

我的代码如下...

<video width="600" height="400" controls>
  <source src="ds2.mp4" type="video/mp4">
  <source src="ds2.ogv" type="video/ogv">
  <source src="ds2.webm" type="video/webm">

您的浏览器不支持视频标签.

Your browser does not support the video tag.

</video>

我的文档类型是

我检查了 MIME 类型,即视频/mp4.然而,其中一个 mime 请求是红色的并被取消(使用谷歌开发工具网络检查时)

I checked the MIME type, its Video/mp4. however, one of the mime requests is in red and cancelled (When checking with google dev tools networking)

我正在使用 microsoft expression web 4(以防万一)

Im using microsoft expression web 4 (incase it is relevant)

如果我忽略了任何重要信息,请让我知道并更新帖子:) 在此先感谢您的帮助 :)

If i've neglected any important information please let me know and ill update the post :) Thanks in advance for your help :)

推荐答案

您的问题在于文件编码.HTML5 支持的类型很少,遗憾的是,每个浏览器只能播放这个狭窄列表中的一部分.

Your problem is with the file encoding. HTML5 supports very few types and, sadly, every browser can play only part of this narrow list.

如果您将 mp4 文件转换为 H.264 编码,它将在 chrome 和 IE9 及更高版本上运行,但显然由于专利问题,firefox 不支持它,但如果操作系统可以玩了这真的很烦人,仍然需要使用播放器才能在不受支持的浏览器中播放文件.

If you convert your mp4 file to H.264 encoding it will work on chrome and IE9 and above, but apparently due to patent issues, firefox does not support it but will play it if the OS can play it. This is really annoying and still require the use of players in order to play files in not-supported browsers.

这篇关于Html 视频播放器播放声音但不播放视频的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆