Chrome won't play .mp4 file

后端 未结 2 1986
耶瑟儿~
耶瑟儿~ 2021-01-06 03:10

I\'m trying to get HTML5 video to work. I am working off a local server.

2条回答
  •  庸人自扰
    2021-01-06 03:39

    Browsers like Internet Explorer and Safari support .H264 codec which plays mp4 files. Firefox support Theora codec which plays .ogv files. Chrome supports both .H264 and Theora. But to make your video works across all browser you need to encode your mp4 video into different formats using application like HandBrake. Then amke your code :

    
    

    and also change your .htacess file to support videos

    AddType video/mp4 mp4 m4v
    AddType audio/mp4 m4a 
    AddType video/ogg ogv
    AddType audio/ogg ogg oga
    AddType video/webm webm  
    

提交回复
热议问题