1. Embed audio and video For audio clips, the traditional delivery method is to use the or tag to embed the clip into the page, while HTML5 The tag is provided to do this 2. Introduction of the tag (1) A simple The tags are as follows: Depending on the needs of website visitors, different attributes and methods can be used. Use the tag to make it easier to configure. We use the width and height attributes to set the width and height of the video displayed on the web page, for example: (2) The controls attribute determines whether to display a series of default playback controls in the browser. In fact, if the controls attribute is not applied, web page visitors will not be able to reprint the entire webpage, otherwise the video cannot be replayed. An example of the controls attribute is as follows: (3) The preload attribute tells the browser The browser, once it encounters this element, immediately starts downloading the video file. (4) The loop attribute tells the browser to replay the video immediately after it has finished playing, as shown below: (5) The autoplay attribute causes the video to start playing immediately after loading on the web page. Putting the previous attributes together, the video factors in practical applications are generated: 3. tag: backup plan If visitors use an old version of the browser that does not support HTML5, in this case, they cannot watch the video through the tag, we can add some additional elements through the tag, as follows : 4. Play audio through the tag (1) Like the tag, the tag supports a variety of source files. Since there is no universal format that requires audio files to be encoded multiple times to support the widest possible audience. Like the tag, also supports attributes like controls, autoplay, loop, and preload. Therefore, the syntactic essence of the tag and the tag are the same. Like video files, audio streams also need to be embedded into Flash objects to meet the needs of users of older versions of IE. (2) Playing audio in older browsers Like video, playing audio in older browsers requires the use of tags. When used in videos When doing this, two attributes are usually used, src and autostart. src configures the location of the resource file of the audio file. autostart controls whether the audio clip automatically plays after loading on the web page, By default Next, will automatically play. If you don’t want so much, you can add the autostart="false" attribute tag, as shown below: In addition A commonly used attribute of the tag is loop. When the loop attribute is set to true or infinite, the audio file segment will be replayed immediately after playing. This attribute can also be set to false to indicate that the audio should only be replayed once. However, By default, the audio file only plays once, so omitting the loop attribute and setting it to false have the same effect