1, HTML
2, CSS

1.6, Inserting audio and video on your webpage

⭐ To Insert a video or an audio into your webpage, you should know the tags audio and video.

1.6.1 Inserting Audio to your Webpage


Follow the steps below to insert your audio
1. Create a folder on your PC and name it as you like.
2. Put an audio inside the folder you created.
3. Open up note pad.
4.Write the basic html code.
<html>
    <head>
        <title>My First Audio</title>
    </head>
    <body>
    </body>
</html>
5. Code up the code below inside the body tag.
<audio src="C:/Users/pakistan/Downloads/horse.mp3" type="audio/mp3" controls></audio>

Brief Explanation
✴️ Src refers to the source of your audio. You can go to the properties of your audio file then to the security to find the source.
✴️ Type refers to the type of extension your audio has. It can be mp3, ogg, mpeg etc….
🥥 Remember before writing the type of the audio you should write "audio/".
🥥 Controls makes your audio controllable. It makes you to control the audio by on your webpage by giving it different features like volume, pause and play and more.
6. Save your file and open it.
You should see a bar of audio with controls that looks like this one.

✴️ If you want your audio to play just as you open your html file add autoplay to your audio code.
<audio src="C:/Users/pakistan/Downloads/horse.mp3" type="audio/mp3" controls autoplay></audio>

🥥 If autoplay doesn't work, its fine. It just doesn't work on some browsers. Actually, many of the browsers don't support it.
🥥 And if you don't want controls, you can remove controls too.
✴️ If you want it to never stop play it, you use loop
<audio src="C:/Users/pakistan/Downloads/horse.mp3" type="audio/mp3" controls autoplay loop></audio>


1.6.1 Inserting Video to your Webpage


Inserting a video to your webpage is so similar to inserting an audio to your webpage. The only difference is the tag you use and the type of video.
🥥 The tag you use to insert a video to your webpage is the video tag.
Follow the steps below to insert your video
1. Open up notepad.
2. Write the basic html code.
<html>
    <head>
        <title>My First Video</title>
    </head>
    <body>
    </body>
</html>
5. Code like this inside the body tag. But don't forget to change it to your video's src. You can copy it by going to properties ➡️ securtiy.
<video src="C:/Users/pakistan/Downloads/horse.mp4" type="video/mp4" controls></video>