简体   繁体   中英

Firefox 4 Not Playing HTML5 Video When On Server

I've been working on a project which has an HTML5 video embedded. It works locally, but when I put it on a server (or in this case, MAMP) it doesn't play. If I right click on the video, it will let me save the video file but it never plays on the page. The particular video in question has no controls, but when I added another test video with controls it had an X in the center.

I'm serving H264, WebM, and Theora. The same videos play perfectly fine in Chrome or Safari.

Any security issues I'm missing? Also, any idea why Firefox is the only browser that refuses to loop the video while the others do?

Thanks in advance.

My assumption is that for whatever reason Firefox is seeing it as a video possibly to the MIME type being sent by the server. If you're on an Apache-based server, you can add the following to your .htaccess to ensure the correct MIME types are being sent.

AddType video/ogg ogv
AddType video/mp4 mp4
AddType video/webm webm

只需将.theora.ogv更改为.theora.ogg。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM