htmlHow to insert a video: first create an HTML sample file; then enter the video tag in the body; finally pass "
The operating environment of this article: Windows 7 system, HTML5&&CSS3 version, DELL G3 computer
In HTML, use the video tag to insert a video. The
HTML5 supports playing audio and video files directly in the browser without using the Adobe Flash plug-in.
Disadvantages of plug-ins: Plug-ins are one of the main reasons for browser crashes, especially flash, which has many problems.
Currently, the
Tip: You can place text content between the tags so that browsers that do not support the
MP4 = MPEG 4 files using H264 video codec and AAC audio codec
WebM = WebM files using VP8 video codec and Vorbis Audio codec
Ogg = Ogg files use Theora video codec and Vorbis audio codec
MIME type for audio format
Attribute value:
Example:
<!DOCTYPE html> <html> <head> <meta charset="utf-8"> </head> <body> <video width="320" height="240" controls> <source src="movie.mp4" type="video/mp4"> <source src="movie.ogg" type="video/ogg"> 您的浏览器不支持 HTML5 video 标签。 </video> </body> </html>
Rendering:
Recommended learning: 《HTML video tutorial》《css video tutorial》
The above is the detailed content of How to insert video in html. For more information, please follow other related articles on the PHP Chinese website!