Before Html5, adding sound to a web page required third-party components like Adobe Flash player and Apple's Quick Time. Html5 audio element didn't change that method, but at least it offers another if not better option.
HTML5 AUDIO ATTRIBUTES
Audio files cannot display sound controls without related attributes of the audio element. There are several attributes that can be used with the audio element to increase its functionality.
The audio 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.
HTML5 AUDIO META DATA
- Metadata: loads the length of the audio and other data
- Auto is the default setting. it let browser decide what to do.
- None tell the browser not to take any action.
LOOP: With this attribute, you can play an audio file in a constant loop the automatically restart itself without stopping.
MUTED: 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.