HTML5 playing MP4 video code

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.