You can use audio tags and video tags respectively. The specific steps are as follows:
First, we open sublime, create a new html5 document, and write out the basic structure of the html5 document, as shown in the figure below:
Then we create a new html5 document in
When you open the web page, you can find that the video is not playing at this time, it is just a still picture, and there is no response no matter how you click it. This is because we have not added playback controls.
We add playback controls, that is, controls, in the video tag. At this time, we find that there is a progress bar directly below the video. We can click play to try. Now you can play normally.
If we want the video to play automatically when we click into the web page, we can add an autoplay, which means autoplay.
Major browsers have inconsistent support for video formats in video. For example, some browsers do not support mp4 format and only support webm format, while others do the opposite. In order to prevent accidents from happening, we need to be compatible so that our videos can play normally on any browser.
Add audio to a web page 01 To embed audio into a website, we use the audio tag. In fact, the audio tag is the same as the video tag. The audio tag is used to embed audio content, and the properties of the audio tag are similar to the video tag.
Audio support is similar to video. You can also use the