PDA

View Full Version : Embed Multiple Media


codejunkie
02-10-2005, 11:10 PM
Alright, I've checked W3, google, dynamic drive, java script kit, everywhere I can think of, on how to embed multiple music files in one page without having multiple buttons. What I'm looking for is having like 10 different songs play in one WMP toolbar with the option of skipping songs by pressing the next button. I guess I could save them all as one file, but I dont want to do that. Any suggestions?

Rob

_Aerospace_Eng_
02-10-2005, 11:41 PM
okay so u dont want to make a play list? that would be the best option, they could skip and go back in the song list but here is something a bit different
http://www.codingforums.com/showthread.php?t=50666

codejunkie
02-10-2005, 11:52 PM
What I'm thinking of is like a normal embedded audio file, but instead of it stopping after the first song it goes on to the next one. So it would be like listening to a cd, you can skip songs, but I don't need the selection one. What would be nice is if it had a random value so it picked random order. Anyways, as soon as the page loads it starts, just like a normal inbedded audio file, but instead it has multiple ones. Thanks

_Aerospace_Eng_
02-11-2005, 12:37 AM
which u can do find a random audio script, and just use document.write to write the player into the page, making a playlist for the audio which can be done

codejunkie
02-11-2005, 02:23 AM
I know it can be done, I just don't know how. The code would look something like this i think:


<html>
<head>
<title>music bar</title>
</head>
<body bgcolor="black">
<script language="JavaScript" type="text/javascript">
var myMusic
myMusic = document.write('<embed src="lament.wav" autostart="true" width="200" height="45">')
//more here
</script>
</body>
</html>


I don't know how to add more links though. I just started Java Script, so any elaborated ideas would be nice. Thanks

rmedek
02-11-2005, 02:38 AM
For something that so incorporates media and html I'd probably recommend Flash... I don't know if that's an option, but it might be the best cross-browser solution.

codejunkie
02-13-2005, 02:47 AM
I'm not that worried about cross-browser compatibility. I've got a small audience of maybe 30 people who all probably have dells, so IE is probably the only browser used. I don't have a flash maker, so that's not an option. Is there not a way that you can have a playlist in java script or a server side script? It wouldn't be a large library, 10 to 15 songs, just for an ambiance, so i dont need something too extravagant. I just find it annoying to go to a page and have the same music playing everytime, and its a hasle to change the file often, so if I could get those 10 or 15 songs with a random play list feature it would more than suffice. Thanks

_Aerospace_Eng_
02-13-2005, 08:44 AM
if you aren't worried about browser compatibility then u can use this, it works in IE, you would need 15 playlists that each have different orders, u should put this wherever you want the player to appear
<script type="text/javascript">
<!-- hide script. Begin
nummidi = 10
day = new Date()
z = day.getTime()
y = (z - (parseInt(z/1000,10) * 1000))/10
x = parseInt(y/100*nummidi,10) + 1
if (x == (1))
list=("playlist1.m3u")
if (x == (2))
list=("playlist2.m3u")
if (x == (3))
list=("playlist3.m3u")
if (x == (4))
list=("playlist4.m3u")
if (x == (5))
list=("playlist5.m3u")
if (x == (6))
list=("playlist6.m3u")
if (x == (7))
list=("playlist7.m3u")
if (x == (8))
list=("playlist9.m3u")
if (x == (9))
list=("playlist9.m3u")
if (x == (10))
list=("playlist10.m3u")
document.write('<OBJECT id="music" height="50" width="230" classid="clsid:22D6F312-B0F6-11D0-94AB-0080C74C7E95">');
document.write(' <PARAM NAME="AutoStart" VALUE="-1">');
document.write(' <PARAM NAME="Filename" VALUE="'+list+'">');
document.write(' <PARAM NAME="ShowStatusBar" VALUE="-1">');
document.write('</OBJECT>');
// End -->
</script>
attached is an example playlist in .m3u format which can be edited with notepad