我已经在FF和Safari(包括iDevices)中测试了我的视频并且播放正常,但它无法在Chrome浏览器中播放.正如您在下面的代码中看到的,我创建了mp4,m4v,webM和ogv文件,并且我已经在我的计算机上测试了所有这些文件以解决任何播放问题.
在Chrome中,视频似乎已加载,并且控制台日志中没有错误.按下播放按钮时,它会加载文件的一部分,但之后不会播放.然而,有趣的是,如果我在时间栏中随意点击一下,说到中途,即使有字幕,也会播放大约5秒的视频,但没有音频.
我已经阅读了可能导致此问题的任何问题,但我没有找到任何有用的想法.要注意,我在.htaccess文件中写了以下内容:
# ----------------------------------------------------------------------
# Proper MIME type for all files
# ----------------------------------------------------------------------
# Audio
AddType audio/ogg oga ogg
AddType audio/mp4 m4a
AddType audio/webm webm
# Video
AddType video/ogg ogv
AddType video/mp4 mp4 m4v
AddType video/webm webm
# Assorted types
AddType image/x-icon ico
AddType image/webp webp
AddType text/cache-manifest appcache manifest
AddType text/x-component htc
AddType application/x-chrome-extension crx
AddType application/x-opera-extension oex
AddType application/x-xpinstall xpi
AddType application/octet-stream safariextz
AddType application/x-web-app-manifest+json webapp
AddType text/x-vcard …Run Code Online (Sandbox Code Playgroud)