HTML
|
JavaScript
Alignment
Basics
Character Codes
Colors
CSS
DIVS
Forms
Frames
Links
Lists and Bullets
Meta Tags
Multimedia
Pictures
Spacing
Tables
Text
Audio and Music
Videos
Audio and Music
285
Audio without Controls
Description
To add music with no controls showing, insert the tag <BGSOUND SRC="URL"> into your HTML document. URL is replaced with the Internet address of the music file.
There is no example of music with hidden controls because the music starts automatically and cannot be turned off.
Code
<html><body>
<BGSOUND SRC="http://www.activejump.com/audio/samplemusic.wav">
</body></html>
Output
n/a
Practice
<html><body> <BGSOUND SRC="http://www.activejump.com/audio/samplemusic.wav"> </body></html>
Audio with Controls
Description
To add music with controls showing, you need to insert the tag <EMBED SRC="URL" WIDTH="XX" HEIGHT="XX" AUTOSTART="VALUE"> and the closing tag, </EMBED>. Nothing goes between the two tags.
URL is replaced with the Internet address of the music file. The two XXs are replaced with the desired height and width of the controls. VALUE is replaced by either "TRUE" or "FALSE".
TRUE - Music automatically starts
FALSE - Music starts when play button is pushed
Code
<html><BODY>
<EMBED SRC="http://www.activejump.com/audio/samplemusic.wav" WIDTH="150" HEIGHT="45" AUTOSTART="FALSE"></EMBED>
</BODY></html>
Output
Practice
<html><BODY> <EMBED SRC="http://www.activejump.com/audio/samplemusic.wav" WIDTH="150" HEIGHT="45" AUTOSTART="FALSE"></EMBED> </BODY></html>
Loop Play
Description
Loop play allows you to have a song repeat itself a certain number of times. This will work if you have the controls hidden or showing. To specify how many times the song loops (repeats itself), add the line LOOP="X" to your normal music tag. Replace X with the number of times you want the song to repeat, or if you want continuous play, replace X with "INFINITE". The final result will look like one of the two below, depending on if you chose hidden or showing controls.
<BGSOUND SRC="URL" LOOP="X">
<EMBED SRC="URL" WIDTH="XX" HEIGHT="XX" AUTOSTART="FALSE" LOOP="X">
Code
<html><body>
<EMBED SRC="http://www.activejump.com/audio/samplemusic.wav" WIDTH="150" HEIGHT="45" AUTOSTART="FALSE" LOOP="3"">
</EMBED>
</body></html>
Output
Practice
<html><body> <EMBED SRC="http://www.activejump.com/audio/samplemusic.wav" WIDTH="150" HEIGHT="45" AUTOSTART="FALSE" LOOP="3""> </EMBED> </body></html>
Advertisements