我的视频索引中有下一个代码:
<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.
有任何线索吗?它既不适用于谷歌浏览器。
答案 0 :(得分:10)
路径有效吗?
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
答案 1 :(得分:1)
@ Gonzalo-正如@Daniel在他的回答中所指出的那样 - 确保源标签中的/ video文件夹是可访问的。例如 - 您正在访问
页面 https://abcdomain/approot/somepage
并且假设你有这个视频文件夹在里面,那么你需要修改源标签,它会像 -
<source src="/approot/video/v1.ogv" type="video/ogg">
希望,这有帮助。