我在视频的索引中有下一个代码:

<video width="100%"  controls> 
  <source src="video/v1.ogv" type="video/ogg"> 
  <source src="video/v1.webm" type="video/webm"> 
  <source src="video/v1.mp4" type="video/mp4"> 
Your browser does not support the video tag. 
</video> 

当我尝试将其加载到firefox中时,它将返回 “找不到支持格式和MIME类型的视频”。

Firebug 会回来
"NetworkError: 500 Internal Server Error - https://root/folder/video/v1.ogv" 
 
v1.ogv 
 
HTTP load failed with status 500. Load of media resource https://root/folder/video/v1.ogv failed. 
 
 
...,c=l.length;c--;)(f=l[c])&&(v[d[c]]=!(y[d[c]]=f));if(i){if(o||e){if(o){for(l=[],... 
 
jquery.min.js (line 2) 
 
"NetworkError: 500 Internal Server Error - https://root/folder/video/v1.webm" 
 
v1.webm 
 
HTTP load failed with status 500. Load of media resource https://root/folder/video/v1.webm failed. 
 
Specified "type" attribute of "video/mp4" is not supported. Load of media resource video/v1.mp4 failed. 
 
All candidate resources failed to load. Media load paused. 

有什么线索吗?它也无法在Google Chrome浏览器中运行。

请您参考如下方法:

路径有效吗?

  • https://root/folder/video/v1.ogv
  • https://root/folder/video/v1.webm

  • Firefox doesn't support .mp4 files解释 Specified "type" attribute of "video/mp4" is not supported.错误。

    如果使用的是Apache,则可以强制其使用正确的MIME类型。将以下内容添加到您的.htaccess文件中。
    # MIME types for Video 
    AddType video/mp4 mp4 m4v f4v f4p 
    AddType video/ogg ogv 
    AddType video/webm webm 
    AddType video/x-flv flv 
    


    评论关闭
    IT干货网

    微信公众号号:IT虾米 (左侧二维码扫一扫)欢迎添加!