Windows Phone上的html5视频错误 [英] html5 video error on Windows phone
问题描述
我正在尝试将手机视频与HTML5整合。在iPhone上,确定,在Android上它很慢,但确定,对于Windows Phone,我有一个错误:无效的来源。
这是不适用于Windows Phone的代码:
< div align =center> ;
< video autobuffer height =170width =300controls>
< source src =http://dev.com/cloud.mp4type =video / mp4>
< source src =http://dev.com/cloud.webmtype =video / webm>
< source src =http://dev.com/cloud.ogvtype =video / ogg>
< / video>
< / div>
我在手机上试过W3Schools的代码,它在Windows Phone上工作(这是.mp4在WP上运行):
< div align =center>
< video width =320height =240controls =>
< source src =http://www.w3schools.com/html/movie.mp4type =video / mp4>
< source src =http://www.w3schools.com/html/movie.oggtype =video / ogg>
< / video>
< / div>
我的错误是什么?如果是编码,我该如何转换它,以及如何编解码器,......如何: - )
谢谢!
视频编码良好。问题是服务器配置中存在错误的MIME类型。 MIME是.mp4 =>application / octet-stream,但这里的WP不理解这个MIME,所以我把它编辑为video / mp4,并且它可以工作。
I'm trying to integrate video for mobile phones with HTML5. On iphone, OK, on Android it's slow but OK, and for windows phone, I have a bad error: invalid source . This is the code that don't work for Windows Phone:
<div align="center">
<video autobuffer height="170" width="300" controls>
<source src="http://dev.com/cloud.mp4" type="video/mp4">
<source src="http://dev.com/cloud.webm" type="video/webm">
<source src="http://dev.com/cloud.ogv" type="video/ogg">
</video>
</div>
I tried the code of W3Schools on the mobiles and it work on Windows Phone (This is the .mp4 that runs on WP) :
<div align="center">
<video width="320" height="240" controls="">
<source src="http://www.w3schools.com/html/movie.mp4" type="video/mp4">
<source src="http://www.w3schools.com/html/movie.ogg" type="video/ogg">
</video>
</div>
What is my mistake? If it is encodage, how Can I transform it and wich codec, ... HOW :-)
Thank you!
The video was well encoded. the problem was there was a wrong MIME typeon the server configuration. The MIME was .mp4 => "application/octet-stream", but here the WP doesn't understand this MIME, so I edit it to "video/mp4", and it works.
这篇关于Windows Phone上的html5视频错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!