RadarURL HTML MADE EASY: Let's the Music Play!

Search This Blog

Thursday, July 9, 2015

Let's the Music Play!

Lets learn how to play an audio file by html. HTML5 gives us controls to play audio and video files in a browser.
There are two basic elements for playing an audio and a video file.
First is controls and the second is source
Controls can define different controls for audio and video.
While source takes the address of the file.
Here's the Sample Code:

<audio controls>
    <source src='audio.ogg' type='audio/ogg'>
</audio>

There are three supported file types in html 5 ogg, wav and mp3
If the audio file and the html file are in the same folder then no need to give full path,
else give the full path for the audio file.
That's It.
Keep Playing.
Learn some new tricks in next coming posts.

No comments:

Post a Comment