The HTML5 provides the standard for playing audio.
One, the audio on the Web
Until now, there is still no standard for playing audio on a Web page.
Today, most audio is played through plugins (such as Flash). However, not all browsers have the same plugin.
HTML5 provides a standard way to include audio through the sound element.
The audio element can play a sound file or audio stream.
Ii. Use of audio tags
<src= "Song.ogg" controls= "Controls"> </audio>
The control property is used to add play, pause, and volume controls.
The content inserted between <audio> and </audio> is displayed for browsers that do not support the audio element:
<!DOCTYPE HTML><HTML> <Head> <MetaCharSet= "Utf-8" /> <title></title> </Head> <Body> <Divstyle= "Text-align:center;"> <VideoID= "Video1"width= "420"style= "margin-top:55px;"> <Sourcesrc= "Img/mov_bbb.mp4"type= "Video/mp4" /> <Sourcesrc= "Img/mov_bbb.ogg"type= "Video/ogg" />Your Browser does not support HTML5 video. </Video> <BR/> <Buttononclick= "Playpause ()">Play/Pause</Button> <Buttononclick= "Makebig ()">Big</Button> <Buttononclick= "Makenormal ()">In</Button> <Buttononclick= "Makesmall ()">Small</Button> <BR/> <BR/> <AudioControls= "Controls"> <Sourcesrc= "Img/qiuyinong.mp3"type= "Audio/mpeg">Your Browser does not support the audio tag. </Audio> </Div> <Scripttype= "Text/javascript"> varMyvideo=document.getElementById ("Video1"); functionPlaypause () {if(myvideo.paused) myvideo.play (); ElseMyvideo.pause (); } functionMakebig () {myvideo.width= 560; } functionMakesmall () {myvideo.width= the; } functionMakenormal () {myvideo.width= 420; } </Script> </Body></HTML>
Folder Contents
1. Under Chrome Browser:
2. Under IE9 Browser:
3, IE8 browser under test:
HTML5 Audio <audio>