How to play video in html: 1. Use the
The operating environment of this article: Windows7 system, HTML5&&CSS3 version, Dell G3 computer.
htmlPlay Video
Playing video in HTML is not easy!
You need to know a lot of techniques to ensure that your video files work in all browsers (Internet Explorer, Chrome, Firefox, Safari, Opera) and on all hardware (PC, Mac, iPad, iPhone) Play.
Use the
The
The following HTML code displays a Flash video embedded in a web page:
Example
<embed src="intro.swf" height="200" width="200">
Problem
HTML4 does not recognize the
If the browser does not support Flash, the video will not play
iPad and iPhone cannot display Flash videos.
If you convert the video to other formats, it still won't play in all browsers.
Use the
The
The following HTML fragment displays a Flash video embedded in a web page:
Example
<object data="intro.swf" height="200" width="200"></object>
Problem:
If the browser does not support Flash, it will not play video.
iPad and iPhone cannot display Flash videos.
If you convert the video to other formats, it still won't play in all browsers.
Using the HTML5
HTML5
The following HTML snippet displays a video in ogg, mp4 or webm format embedded in a web page:
Example
<video width="320" height="240" controls> <source src="movie.mp4" type="video/mp4"> <source src="movie.ogg" type="video/ogg"> <source src="movie.webm" type="video/webm"> 您的浏览器不支持 video 标签。 </video>
Question:
You must put the video Convert to many different formats. The
Recommended tutorials: html video tutorial, css video tutorial
The above is the detailed content of How to play video in html. For more information, please follow other related articles on the PHP Chinese website!