The audio and video tags are HTML5 tags, <audio></audio> and <video></video> respectively, and these two tag usages are approximately the same and are used only in IE9 and above and other browsers. Not supported in IE8 and in the following versions.
Usage examples:
<!DOCTYPE HTML><HTML> <Head> <MetaCharSet= "Utf-8"> </Head> <Body> <Videowidth= "400px"Height= "400px"AutoPlay= "AutoPlay"Controls= "Controls"> <Sourcesrc= "D4.mp4"type= "Video/mp4">your browser does not support the HTML5 video tag. </Video> <AudioLoop= "Loop"Controls= "Controls"preload= "Auto"> <Sourcesrc= "D1.mp3"type= "Audio/mp3">your browser does not support the HTML5 audio tag. </Audio> </Body></HTML>
The text in the previous example, "Your browser does not support HTML5 Audio/video tags", is only displayed if the browser is not compatible with the label and the tag does not take effect.
<audio></audio> and <video></video> the majority of the properties of the two tags are the same, as follows:
AutoPlay If this property appears, the video plays as soon as it is ready.
Preload if this property appears, the video loads when the page loads and prepares to play. If you use "autoplay", the property is ignored.
Controls if this property appears, the control is displayed to the user, such as the play button.
Loop If this property occurs, the media file starts playing again when it finishes playing.
Muted if this property appears, the audio output of the video is muted.
Poster Specifies that the video is being downloaded when the image is displayed until the user clicks the play button.
SRC The URL of the video to play.
In addition to the,<video></video> tag, you can also set the width and Height properties.
Audio and video files are best mp3, MP4 files, because only these two files are compatible with all versions of the browser.
HTML audio and video tags