开发者

HTML 5 Video Problem

开发者 https://www.devze.com 2023-01-08 11:07 出处:网络
I\'m trying to set up my site to use HTML 5 videos. The mp4 files are served from S3. I\'ve got the MIME type right, and the URL is right. It\'s not working though. The only thing I can think of is th

I'm trying to set up my site to use HTML 5 videos. The mp4 files are served from S3. I've got the MIME type right, and the URL is right. It's not working though. The only thing I can think of is the codec being wrong.

Here is my code:

<video width="320" height="240" controls>
<source src="{url}"  type='video/mp4; codecs="avc1.42E01E, mp4a.40.2"'>
</video>

Now as I understand it, the a开发者_高级运维udio codec is always the same. mp4a.40.2. The video is encoded as baseline, but according to http://wiki.whatwg.org/wiki/Video_type_parameters#MPEG-4, the last two characters of the video codec, in my code 1E are variable.

Is having the wrong characters enough to cause the video to not work? If so, how do I find the right settings?

I'm having a hard time wrapping my head around this stuff. Thanks for any help you can provide.


The idea of the video codecs information is that your browser won't download the video if it can't play it. (found that here) So I think even with a wrong, but common, avc level (last 2 chars) it should download and play. I found this guide how to determine and change your avc level using a hex editor. Megui apparently also works for that.


Try removing the type attribute. If that makes it work, you've found the problem. Also, check the actual Content-Type HTTP header.

0

精彩评论

暂无评论...
验证码 换一张
取 消