HTML5 play video directly on a Web page compatible with all browsers

Source: Internet
Author: User
HTML5 can use video tags to play videos
Currently, the video element supports three types of videos:
5.0+
format ie Firefox Opera Chrome Safari
Ogg No 3.5+ 10.5+ 5.0+ No
mpeg 4 9.0+ No no 3.0+
WebM No 4.0+ 10.6+ 6.0 + No
Ogg = Ogg file with Theora video encoding and Vorbis audio encoding
MPEG4 = mpeg 4 files with H.264 video encoding and AAC audio encoding
WebM = WebM file with VP8 video encoding and Vorbis audio encoding
Column:
 
  
  
The code is as follows Copy Code
<video width= "height=" controls= "Controls" >
  <source src= "Movie.ogg" type= "Video/ogg" >
  <source src= "Movie.mp4" type= "Video/mp4" >
Your Browser does not support the "video tag."
</video>
The video element allows multiple source elements. The source element can link different video files. The browser will use the first recognizable format!
This ensures that all browsers are compatible
Audio also has a audio tag
Currently, the audio element supports three audio formats:
Th>chrome 3.0
ie 9 Firefox 3.5 Opera 10.5 Safari 3.0
ogg Vorbis
MP3
Wav

 
  
  
The code is as follows Copy Code
<audio controls= "Controls" >
  <source src= "Song.ogg" type= "Audio/ogg" >
  <source src= " Song.mp3 "type=" Audio/mpeg ">
Your Browser does not support the audio tag.
</audio>

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.