This article will introduce to you the commonly used multimedia tags in HTML and the new multimedia tags in HTML5. I hope it will be helpful to friends in need!
New multimedia tags in HTML5
1: Video<video>
Currently the <video> element supports three video formats: try to use MP4 format
Browser
MP4
WebM
Ogg
IE
YES
NO
NO
Chrome
YES
YES
YES
Firefox
YES Starting from Firefox21 version Linux system starting from Firefox 30
YES
YES
Safari
YES
NO
NO
Opera
YES Starting from Opera25 version
YES
YES
<video controls="controls" autoplay="autoplay" muted="muted" width="500px" height="400px" loop="loop" poster="images/tudou.jpg" preload="none">
<source src="medio/mov_bbb.mp4">
<source src="medio/mov_bbb.ogg">
您的浏览器暂不支持<video>标签播放视频</video> Copy after login
Video<video>——Common attributes
Attribute value Description ##autoplay autoplay The video is ready to play automatically (Google browser needs to add muted to solve the autoplay problem) controls controls Show playback controls to the user ##width pixels(pixels) Set player width heightpixels(pixels) Play Device height looploop loop srcurl Video url address posterimageurl Load the waiting picture mutedmuted Mute playback ##2: Audio
BrowserMP3 Wav Ogg IE 9 YES NO NO Chrome 6 YES YES YES Firefox 3.6 YES YES YES Safari 5 YES YES NO##Opera 10 YESYES YES <!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>HTML5音频标签</title></head><body>
<audio controls="controls" autoplay="autoplay" muted="muted" loop="loop">
<source src="medio/music.mp3" type="audio/mpeg">
您的浏览器不支持audio元素</audio>
</body>
</html> Copy after login
Google Chrome disables automatic playback of audio and video
Properties
Value
Description
##autoplay autoplay
Autoplay
controls controls
Show playback controls to user
loop loop
Loop play
src url
Video url address
muted muted
MUTE PLAY
Multimedia tag summary
The audio tag and video tag are basically used in the same way Browser support is different
Google Chrome disables the automatic playback of audio and videoWe can add the muted attribute to the video tag to mute the video, but the audio cannot (can be solved through JavaScript) The video tag is the key point. We often set up automatic playback, and control control and looping are not applicable. And set the size attribute
[Related recommendations: css video tutorial]
The above is the detailed content of Detailed explanation of new multimedia tags in HTML5. For more information, please follow other related articles on the PHP Chinese website!
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Latest Articles by Author
2023-04-24 11:00:01
2023-04-24 10:55:51
2023-04-24 10:52:44
2023-04-23 17:40:51
2023-04-23 17:38:02
2023-04-23 17:34:02
2023-04-23 10:15:45
2023-04-23 10:10:52
2023-04-21 16:01:59
2023-04-21 15:58:01