Before Html5, adding sound to a web page required third-party components like Windows Media Player, Adobe Flash and Apple's Quick Time. Obviously, Html5 audio didn't change that, but it offers another if not better option.
Audio files cannot display sound controls without the related attributes of the element. There are several attributes that can be used with Html5 audio element to increase its functionality.
The source attribute can also be used as an independent self closing element to include different audio files format to ensure cross browser support for all of your audio files.
This attribute brings Html5 native audio in to view. It display the browser default audio controls that allow users to interact and manipulate the media player sound.
Preload give the browser an idea of the amount of audio it needs to load. This attribute can use three different values.
Audio Meta Data
- Metadata: loads the length of the audio and other data
- Auto is the default, it let the browser decide what to do.
- None tell the browser not to take any action.
With this attribute, you can play an audio file in a constant loop the automatically restart itself without stopping.
This is used to pause the audio player, but the attribute is not currently supported by any browser. Until then, its practically useless. However it's purpose is obvious.
Copyright © 2013. Responsive Webworks. All Rights Reserved.