HTML Tutorial-playing music

Source: Internet
Author: User
Tags format
Tutorial HTML can also play music and video, in addition to inserting graphics. The music formats you can play with your browser are: MIDI music, WAV music, au format. In addition to the use of the network to download a variety of music formats, MP3 is the highest compression rate, the best quality file format.

On-Demand music

Make a link to music, just click on it with the mouse, you can hear the moving music, the way to do this is simple:

   <a href= "Music Address" > Song name </A>

For example: Play a piece of midi music:

<a href= "Midi.mid" >midi music </A> MIDI Music

Play a section of the AU format music:

<a href= "you.au" > You-au music </A> the same table you-au music

The music we like to collect, as a music library, at any time can let themselves and others wandering in the ocean of music, has been done, you must have met a lot, and you can try to do it!

Automatically load music

In front, we use the link to realize the function of playing music online, we can also let the music automatically load, you can let it appear control Panel or when the background music used. Basic syntax:

    <embed src= "Music file Address" >

Properties are:

Src= "FILENAME" Set the path to the music file
Autostart=true/false Whether you want the music file to play automatically when it is finished, true to, false is not, default is False
Loop=true/false Set the number of playback repeats, Loop=6 says repeat 6 times, true to show infinite playback, false play once stop.
Startime= "Minutes: Seconds" Set the start play time of the music, such as 20 seconds after the play is written as startime=00:20
volume=0-100 Set the volume size. If it's not set, use the system's volume.
WIDTH HEIGHT To set the size of the control panel
Hidden=true Hide Control Panel
Controls=console/smallconsole Set the appearance of the control panel

Cases:
*************************************

<title> Play Music </title>

<body>
<embed src= "Midi.mid" Autostart=true hidden=true loop=true>

Play as a background music.
</body>

Cases:
*************************************

<title> Play Music </title>

<body>
<embed src= "Midi.mid" Loop=true width=145 height=60>

<P> Control Panel appears, you can control its open and close, but also to adjust the volume size. </P>
</body>

Background music in IE

In addition, there is an insert background music format, but only in IE browser can be heard.

<bgsound src= "Music file Address" loop=#>

Number of #= cycles

Cases:
<bgsound src= "Sound.wav" loop=3>



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.