audio
The HTML audio element is used to play audio files and optionally offer stock control components.
<audio src="Scurvy_Pirate.mp3" controls="controls" autoplay="autoplay">
Fallback embed or object tags go here
</audio>
Alternately you can supply the audio tag with <source> tags in place of using the "src" attribute and specify alternative audio file formats for different environments.
<audio controls="controls">
<source src="Scurvy_Pirate.mp3" type='audio/mpeg'>
<source src="Scurvy_Pirate.mp4" type='audio/mp4'>
<source src="Scurvy_Pirate.wav" type='audio/wav'>
<source src="Scurvy_Pirate.ogg" type='audio/ogg'>
Fallback embed or object tags go here
</audio>
File Formats
Due to inconsistencies between different browser software vendors we cannot just link to one sound resource file type to render HTML5 Audio. Using OGG and MP4 together is recommended to consider most browsing environments people would use. Currently Firefox and Opera prefer OGG files, Internet Explorer prefers MP3 or MP4 files, while Chrome will render most audio file types.
HTML Attributes
src - "path/to/audio_files/song.mp3"
the path(URL) to the audio file
autoplay - "autoplay" or ""
specify if the audio should auto play when the audio file is buffered enough
controls - "controls" or ""
tell the browser software to give controls for the audio playback
loop - "loop" or ""
specify if the audio should loop when it ends
mediagroup - string
link multiple media streams together into a media group
preload - "auto", "metadata", "none", ""
specify the download setting for the audio resource
auto - optimized downloading set for entire audio resource.
metadata - audio not expected to play, but fetching the metadata for it is desirable.
none - spend no resources fetching or preloading audio data.
Empty string is equivalent to "auto".
Related Posts :
bdo
bdo
The HTML <bdo> element is made to represent text going the opposite way … Read More...
body
body
The HTML <body> element is the main display container for the web docum… Read More...
base
base
The HTML <base> element targets the base URL to put on all relative lin… Read More...
bdi
bdi
NOTE: This new element is HTML5 and will be a standardized element in 2014.
The H… Read More...
blockquote
blockquote
The HTML <blockquote> element is used to represent quoted materia… Read More...
0 Response to "audio"
Post a Comment