html5 video error on Windows phone

十年热恋 提交于 2019-12-13 04:53:11

问题


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!


回答1:


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.



来源:https://stackoverflow.com/questions/23546519/html5-video-error-on-windows-phone

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!