HTML5视频|视频不支持/无效的文件类型| IE [英] HTML5 Video | Video Unsupported / Invalid File Type | IE

查看:1159
本文介绍了HTML5视频|视频不支持/无效的文件类型| IE的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

晚安StackOverflowers!
我似乎遇到了使IE5或Safari浏览器(Safari似乎加载,但希望在播放之前下载整个文件)工作的问题。它在Chrome中运行时没有问题。



在IE中,我收到错误信息:错误:不支持的视频类型或无效的文件路径。

我已经完成了研究,似乎很多人通过将MIME类型添加到他们的.htaccess文件中找到了解决方案。我做了这个没有用。接下来的问题是,我需要首先将.mp4放入视频列表中,完成 - 但没有解决方案。



我的.htaccess文件如下所示:(WordPress安装)

  #BEGIN WordPress 
< IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase / wpress /
RewriteRule ^ index\.php $ - [L]
RewriteCond%{REQUEST_FILENAME}!-f
RewriteCond%{REQUEST_FILENAME }!-d
RewriteRule。 /wpress/index.php [L]
< / IfModule>

#结束WordPress

#Audio HTML5 Mime类型
AddType音频/ aac .aac
AddType音频/ mp4 .mp4 .m4a
AddType audio / mpeg .mp1 .mp2 .mp3 .mpg .mpeg
AddType audio / ogg .oga .ogg
AddType audio / wav .wav
AddType audio / webm .webm

#Video HTML5 Mime类型
AddType视频/ mp4 .mp4 .m4v
AddType视频/ ogg .ogv
AddType视频/ webm .webm


$ b


 < video width =100%height =100%controls =controls> 
< source src =http://www.frozentears.org/wpress/wp-vlog/vlogVid/Rus/[RUS]Rossiyskaya.Imperia/[RUS]Rossiyskaya.Imperia.E01.Petr.I。 PI.mp4type ='video / mp4'/>
< source src =http://www.frozentears.org/wpress/wp-vlog/vlogVid/Rus/[RUS]Rossiyskaya.Imperia/[RUS]Rossiyskaya.Imperia.E01.Petr.I。 PI.webmtype ='video / webm'/>
不支持视频标签。下载视频< a href =http://www.frozentears.org/wpress/wp-vlog/vlogVid/Rus/[RUS]Rossiyskaya.Imperia/[RUS]Rossiyskaya.Imperia.E01.Petr.I.PI的.mp4\" >此处< / a取代。
< / video>

整个页面给我的问题可以在这里看到: http://bit.ly/1g2quqe
我检查了堆栈,发现这些线程这里这里,遵循他们的建议,但由于某种原因,它仍然还没有为我工作。另外,有些人建议我将文件路径放在地址栏中,如果文件播放,则错误出现在代码中。当我将.mp4文件放在地址栏中时,我只是提示下载文件,浏览器没有播放该文件。



任何建议都将不胜感激。
祝好,
劳拉

解决方案

我无法正确地在任何浏览器上播放您的文件。 Chrome仅在30秒下载后播放音频,但没有播放视频。在Firefox中,当我尝试在浏览器中放入mp4的URL时,出现错误提示文件已损坏。我认为这可能是一个文件格式问题。如果是这种情况,可能是文件中的一些不良数据或元数据: 您可以在 http://vjs.zencdn.net/v/oceans.mp4 并将其托管在您的服务器上。如果工作正常,那么你的MIME / TYPES配置是好的,否则你需要调整它们的权利(看看把它们添加到/etc/mime.types文件)。

  • 您可以尝试使用手刹 MP4Box 重新包装你的文件。您需要激活带有手刹的web优化选项(又名快速启动)。



  • 您可以在这里阅读底层故事



    让我们知道它是否可行


    Good Evening StackOverflowers! I seem to have a problem with getting the HTML5 video tag to work in IE, or Safari (Firefox seems to load, but it wants to download the entire file before playing). It works in Chrome without issue.

    In IE, I get the error: "Error: Unsupported video type or invalid file path".

    I have done research, and it seems many find a solution by adding MIME types to their .htaccess file. I have done this to no avail. The next problem was that I needed to put the .mp4 first in the video listing, done - but no solution.

    My .htaccess file looks like this: (WordPress Install)

    # BEGIN WordPress
    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /wpress/
    RewriteRule ^index\.php$ - [L]
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /wpress/index.php [L]
    </IfModule>
    
    # END WordPress
    
    #Audio HTML5 Mime Types
    AddType audio/aac .aac
    AddType audio/mp4 .mp4 .m4a
    AddType audio/mpeg .mp1 .mp2 .mp3 .mpg .mpeg
    AddType audio/ogg .oga .ogg
    AddType audio/wav .wav
    AddType audio/webm .webm
    
    #Video HTML5 Mime Types
    AddType video/mp4 .mp4 .m4v
    AddType video/ogg .ogv
    AddType video/webm .webm 
    

    Additionally, this is what my video code looks like: (Yes, I know it's wordy...)

    <video width="100%" height="100%" controls="controls">
      <source src="http://www.frozentears.org/wpress/wp-vlog/vlogVid/Rus/[RUS]Rossiyskaya.Imperia/[RUS]Rossiyskaya.Imperia.E01.Petr.I.PI.mp4" type='video/mp4' />
      <source src="http://www.frozentears.org/wpress/wp-vlog/vlogVid/Rus/[RUS]Rossiyskaya.Imperia/[RUS]Rossiyskaya.Imperia.E01.Petr.I.PI.webm" type='video/webm' />
      Video tag not supported. Download the video <a href="http://www.frozentears.org/wpress/wp-vlog/vlogVid/Rus/[RUS]Rossiyskaya.Imperia/[RUS]Rossiyskaya.Imperia.E01.Petr.I.PI.mp4">here</a>.
    </video>
    

    The whole page that is giving me issues can be seen here: http://bit.ly/1g2quqe I have checked the stack and found these threads here, here and here, followed their advice, but for some reason it still has yet to work for me.

    Furthermore, some suggested that I put the file path in the address bar, if the file plays then the error is in the code. When I put the .mp4 file in the address bar, I was just prompted to download the file, the browser didn't play the file.

    Any advice would be greatly appreciated. Best regards, Laura

    解决方案

    I could not get to play your files on any browser correctly. Chrome only played the audio after 30 sec download but no video. In Firefox when I tried to put the URL of the mp4 in the browser I got an error saying the file is corrupted. I think it could be a file format issue. If it the case it is probably some bad data or metadata in the file:

    • You can download the file at http://vjs.zencdn.net/v/oceans.mp4 and host it on your server. If it works fine then your MIME/TYPES config is fine otherwise you need to tune them right (look at adding them to the /etc/mime.types file).
    • You can try to use handbrake or MP4Box to repack your file. You need to activate the "web optimized" option (aka fast start) with handbrake.

    You can read here for the underlying story.

    Let us know if it works

    这篇关于HTML5视频|视频不支持/无效的文件类型| IE的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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