HTML5视频无法在Firefox和Chrome中运行? [英] HTML5 Video not working in Firefox and Chrome?

查看:327
本文介绍了HTML5视频无法在Firefox和Chrome中运行?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用下面的这个代码段。该视频在Safari中单击时有效,但在firefox中点击时无效,即chrome。

I am using this snippet below. The video works when clicked in safari but it doesn't work when clicked in firefox, ie, and chrome.

片段:

      <video width="560" height="340" controls>
      <source src="/media/intro.mp4" type='video/mp4; 
      codecs="avc1.42E01E, mp4a.40.2"'>
      </video>


推荐答案

您需要将mp4视频转换为ogv并包含它作为一个来源。包含视频的webm版本也是一个好主意。

You need to convert your mp4 video to ogv and include it as a source. It also may be a good idea to include a webm version of the video.

您可以使用此程序进行转换。
仅限Windows, XMedia Recode

You can use this program to convert it. Windows only, XMedia Recode

<video width="560" height="340" controls="controls">
      <source src="media/intro.mp4" type="video/mp4"/>
      <source src="media/intro.ogv" type="video/ogg"/>
      <source src="media/intro.webm" type="video/webm"/>
</video>

这篇关于HTML5视频无法在Firefox和Chrome中运行?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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