Html5 audio autio tag control and html5 audio autio tag

Source: Internet
Author: User

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.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.