1.nginx supports FLV and MP4 format playback
Default Yum installation Nginx
CENTOS7 installation of Nginx should be the default installation of the Nginx_mod_h264_streaming module
# nginx-v See if the Nginx_mod_h264_streaming module is installed
Nginx in the new version has supported the--with-http_mp4_module--with-http_flv_module these 2 modules can be
# vi/etc/nginx/nginx.conf
server {
Listen default_server;
Listen [::]:80 default_server;
server_name _;
root/usr/share/nginx/html;
#guowang add
Limit_rate_after 5m; #在flv视频文件下载了5M以后开始限速
Limit_rate 512k; #速度限制为512K
# Load configuration files for the default server block.
include/etc/nginx/default.d/*.conf;
Location/{
}
#guowang add
Location ~ \.flv {
flv
}
Location ~ \.mp4$ {
mp4;
}
Error_page 404/404.html;
Location =/40x.html {
}
Error_page 502 503 504/50x.html;
Location =/50x.html {
}
}
2.HTML5 playing MP4 video code
<! DOCTYPE html>
<meta charset= "Utf-8" >
<title> Company promotional Film </title>
<body>
<video width= "height=" Controls autoplay>
<source src= "Gs.mp4" type= "Video/mp4" >
<source src= "Gs.ogg" type= "Video/ogg" >
<source src= "GS.WEBM" type= "VIDEO/WEBM" >
<object data= "Gs.mp4" width= "height=" >
<embed src= "gs.swf" width= "height=" ><p> if you can't play the video,
That's your device. The file format is not supported </p>
</object>
</video>
</body>
3. Reference:
Http://www.runoob.com/html/html-videos.html
Http://www.runoob.com/try/try.php?filename=tryhtml_video_html5_4
HTML5 playing MP4 video code