HTML help

  • Dragoris
  • Beginner
  • Beginner
  • Dragoris
  • Posts: 48
  • Loc: Erie, PA

Post 3+ Months Ago

how do i get music to play on my site through HTML coding? :oops:

Conditions: I want to make it so one song will play when the site is opened by default, but you will be able to change the song by clicking on a button or icon of sorts.
  • Anonymous
  • Bot
  • No Avatar
  • Posts: ?
  • Loc: Ozzuland
  • Status: Online

Post 3+ Months Ago

  • RyTRiX
  • Graduate
  • Graduate
  • User avatar
  • Posts: 239
  • Loc: Michigan

Post 3+ Months Ago

Code: [ Select ]
<embed src="sound.mp3"></embed>


??? I don't know
  • Dragoris
  • Beginner
  • Beginner
  • Dragoris
  • Posts: 48
  • Loc: Erie, PA

Post 3+ Months Ago

Thanks ill try that :)
  • whatlikesit12345
  • Guru
  • Guru
  • User avatar
  • Posts: 1211

Post 3+ Months Ago

<!-- TWO STEPS TO INSTALL MIDI MENU:

1. Copy the coding into the HEAD of your HTML document
2. Add the last code into the BODY of your HTML document -->

<!-- STEP ONE: Paste this code into the HEAD of your HTML document -->

<HEAD>

<SCRIPT LANGUAGE="JavaScript">
<!-- Original: Nicholas Loar -->
<!-- Web Site: http://www.cass.net/~anarchy -->

<!-- This script and many more are available free online at -->
<!-- The JavaScript Source!! http://javascript.internet.com -->

<!-- Begin
songNum = new Array();
songNum[0] = "#";
songNum[1] = "http://javascript.internet.com/img/midi-menu/whiskey.mid";
songNum[2] = "http://javascript.internet.com/img/midi-menu/aeroplane.mid";
songNum[3] = "http://javascript.internet.com/img/midi-menu/christina.mid";
songNum[4] = "http://javascript.internet.com/img/midi-menu/hell.mid";

var music = null;
var track = 0;
var ver = navigator.appName;
function audioCheck(plugName) {
for (var i = 0; i < navigator.plugins.length; i++) {
if (navigator.plugins[i].name.toLowerCase() == plugName.toLowerCase()) {
for (var j = 0; j < navigator.plugins[i].length; j++) {
if (navigator.plugins[i][j].enabledPlugin) {
return true;
}
}
return false;
}
}
return false;
}
function chooseSong(s) { // ie
track = s.options[s.selectedIndex].value;
if (ver == "Microsoft Internet Explorer") {
document.all.music.src = songNum[track];
} else {
songPlay('play');
}
}
function songPlay(cmd) { // netscape
if (audioCheck("LiveAudio")) {
if (cmd == 'play') {
document.musicSource.play(false, songNum[track]);
}
} else {
alert("You Do Not Have The Correct Plugin");
}
}
// End -->
</script>
</HEAD>

<!-- STEP TWO: Copy this code into the BODY of your HTML document -->

<BODY>

<center>
<form name=choose>
<select size=1 name=track onChange="chooseSong(this);">
<option value="0">Click For Music</option>
<option value="1">Whiskey In A Jar</option>
<option value="2">Aeroplane</option>
<option value="3">Genie In A Bottle</option>
<option value="4">Hell</option>
</select>
<input type=button onMouseDown="chooseSong(document.choose.track)" value=" Play ">
</form>

<script language="JavaScript">
<!-- Begin
var ver = navigator.appName;
if (ver == "Microsoft Internet Explorer") {
document.write('<bgsound src="#" ID=music loop=1 AUTOSTART=true>');
} else {
document.write('<embed type="audio/midi" src="aeroplane.mid" AUTOSTART=false hidden=true VOLUME="90" name="musicSource" MASTERSOUND></EMBED>');
}
// End -->
</script>
</center>

<p><center>
<font face="arial, helvetica" size="-2">Free JavaScripts provided<br>
by <a href="http://javascriptsource.com">The JavaScript Source</a></font>
</center><p>

<!-- Script Size: 2.53 KB -->



you can just post it all in one.
  • Dragoris
  • Beginner
  • Beginner
  • Dragoris
  • Posts: 48
  • Loc: Erie, PA

Post 3+ Months Ago

COOL! Thanx! :D
  • Nucleo
  • SausagePorkPie
  • Mastermind
  • User avatar
  • Posts: 2297
  • Loc: UK - England

Post 3+ Months Ago

it depends on what you are looking for, on my site http://www.inucleo.co.uk on the music page, under a heading i have my music playing in little media player boxes, i used this code
Code: [ Select ]
<embed src="song.mp3 (or .au music, like mine, smaller file)" autostart=false loop=false height=45 width=350 controls="smallconsole">


it will come out like this
//removed because of errors and load time
its pritty handy, and uses whichever media player you use.

Post Information

  • Total Posts in this topic: 6 posts
  • Users browsing this forum: No registered users and 37 guests
  • You cannot post new topics in this forum
  • You cannot reply to topics in this forum
  • You cannot edit your posts in this forum
  • You cannot delete your posts in this forum
  • You cannot post attachments in this forum
 
cron
 

© 1998-2014. Ozzu® is a registered trademark of Unmelted, LLC.