Home > Web Front-end > H5 Tutorial > body text

Detailed explanation of new multimedia tags in HTML5

藏色散人
Release: 2022-08-05 16:10:50
forward
3300 people have browsed it

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

##autoplayautoplayThe video is ready to play automatically (Google browser needs to add muted to solve the autoplay problem) controlscontrolsShow playback controls to the user##width heightloopsrcpostermuted##2: Audio
Attributevalue Description
pixels(pixels)Set player width
pixels(pixels)Play Device height
looploop
url Video url address
imageurlLoad the waiting picture
mutedMute playback