HTML5 Audio tag is use to apply some audio file in a webpage. The Audio tag contains one or more source tags with different audio sources. The browser will choose the first source it supports.
The text between the audio tags will only be displayed in browsers if it do not support the audio element.
There are three supported audio formats in HTML: MP3, WAV, and OGG.
Attribute | Description |
---|---|
controls | Hide/show the controls in a video |
autoplay | This boolean attribute indicates if the media should start automatically. |
loop | Specifies if the audio should be played continuously, a certain number of times or not at all. |
muted | Audio file will be muted. |
Example 1: Play Audio file in HTML5 player
HTML5 Video tag is use to apply some video file in a webpage.
Attributes | Description |
---|---|
controls | Hide/show the controls in a video |
autoplay | This boolean attribute indicates if the media should start automatically. |
loop | Specifies if the video should be repeat continuously, a certain number of times or not at all. |
width | Width of the video in pixels. |
height | Height of the video in pixels. |
Example 2: Play Video file in HTML5 player