Html5 audio autio tag control and html5 audio autio tag
<Audio id = "my" controls = "controls" loop = "loop"> <source src = "/11.mp3" type = "audio/mp3"> Your browser does not support audio element. </audio> <input type = "button" onclick = "document. getElementById ('My '). play () "value = 'play'/> <! -- Start --> <input type = "button" onclick = "document. getElementById ('my'). pause ()" value = 'pause'/> <! -- Pause --> <input type = "button" onclick = "document. getElementById ('my'). currentTime = 0.0" value = 'stop'/> <! -- Return to zero -->
Question about HTML5 Audio tag Audio format support
After all, HTML5 has not been widely used. This is a tough problem for the Internet. It is difficult to ask people to use the same browser and terminal. Although the official website says that it is only for Members who have made standards to agree to the implementation, it is hard to say the specific implementation effect. We recommend that you use XHTML for the time being. The compatibility is much better. HTML5 can be used for mobile websites. After all, GOOGLE's systems are quite popular.
How to insert Audio and Video in HTML 5 Audio Video?
Added the <audio> and <video> tags in HTML5 to insert audio and video.
Sample Code:
<Audio src = "audio.wav"> </audio>
<Video src = "video. wmv"> </video>
You can also use some parameters to perform advanced control on media files:
Take <video> as an example:
<Video src = "demo.mp4" controls auto loop> </video>
Controls: If the controls attribute is added to the tag, the player displays the control to the user. If the controls attribute is not available for audio files, you cannot view the audio control on the page.
Autoplay, as its name implies, is automatic playback. After this attribute is added, once the audio/video is ready, automatic playback starts.
Loop to control whether loop playback is enabled. In fact, it will be easy to understand when you look at the tutorial. You can see the seventh set in "Buid New World": HTML 5 Audio Video tags and more features.