I took out all references to https and replaced with http, but still get the message.
I though the OBJECT tags were causing the message. I'll check back on the file later to see if the message dissapears, since I recal that happening before. Is it possible my server needs time to authenticate or something??
I really luv your code!!
and I just have one question, but I don't know if you answered it yet.
Is there a way to randomly play a song in the beginning when the webpage is opened instead of having the person choose a song from the list??
I really luv your code!!
and I just have one question, but I don't know if you answered it yet.
Is there a way to randomly play a song in the beginning when the webpage is opened instead of having the person choose a song from the list??
I had a feeling you were going to say that, in the future, please be clear on what exactly it is that you want. This could have saved both of us another post.
Code:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>Random mp3 Music Player</title>
<style type="text/css">
<!--
#jukebox {
text-align:center;
}
-->
</style>
<script type="text/javascript">
<!--
nummp3 = 10
day = new Date()
z = day.getTime()
y = (z - (parseInt(z/1000,10) * 1000))/10
x = parseInt(y/100*nummp3,10) + 1
if (x == (1))
mp3=("song1.mp3")
if (x == (2))
mp3=("song2.mp3")
if (x == (3))
mp3=("song3.mp3")
if (x == (4))
mp3=("song4.mp3")
if (x == (5))
mp3=("song5.mp3")
if (x == (6))
mp3=("song6.mp3")
if (x == (7))
mp3=("song7.mp3")
if (x == (8))
mp3=("song8.mp3")
if (x == (9))
mp3=("song9.mp3")
if (x == (10))
mp3=("song10.mp3")
function song(){
document.getElementById('music1').innerHTML="<embed type='application/x-mplayer2' id='music2' pluginspage='http://www.microsoft.com/Windows/MediaPlayer/' src='"+document.getElementById('cancion').value+"' name='MediaPlayer1' width='300' height='69' controltype='2' showcontrols='1' showstatusbar='1' AutoStart='true'></embed>";
}
//-->
</script>
</head>
<body>
<div id="jukebox">JUKEBOX<br><br>
<select id="cancion" onchange="song()" size="1">
<option value="none">::::::::::::: Choose Your Song Here :::::::::::::</option>
<option value="http://song1.mp3">Song 1</option>
<option value="http://song2.mp3">Song 2</option>
<option value="http://song3.mp3">Song 3</option>
<option value="http://song4.mp3">Song 4</option>
<option value="http://song5.mp3">Song 5</option>
<option value="http://song6.mp3">Song 6</option>
<option value="http://song7.mp3">Song 7</option>
<option value="http://song8.mp3">Song 8</option>
<option value="http://song9.mp3">Song 9</option>
<option value="http://song10.mp3">Song 10</option>
</select><br><br>
<span id="music1">
<script type="text/javascript">
<!--
document.write('<embed type="application/x-mplayer2" '
+'pluginspage="http://www.microsoft.com/Windows/MediaPlayer/" '
+'src="'+mp3+'" '
+'name="MediaPlayer1" '
+'width="300" '
+'height="69" '
+'controltype="2" '
+'showcontrols="1" '
+'showstatusbar="1" '
+'autostart="true">'
+'</embed>');
//-->
</script>
</span>
</div>
</body>
</html>
Last edited by _Aerospace_Eng_; 05-01-2005 at 08:41 PM..
I have been trying to set up a player which can be used in Active Desktop to play back local files from a playlist held on the local drive as a screensaver/desktop and am experiencing some issues:
I have seen that the M3U format for the playlist is recommended earlier. I have been using ASX type in the format which Microsoft show on their web site along the lines of:
<ASX version = "3.0">
<TITLE>Basic Playlist Demo</TITLE>
<REPEAT>
However this has a number of problems - fade to black flips through white at the end of every clip and we use MPG and WMV files. We want to deliver a new list every day to our users who cache the files on their local hard drive using some management software.
Second problem is startup is at the same point if you stop the player again. We would like it to start where you left off - is that possible?
Hi AerospaceEng,
The original post you made with the dropdown list. I want to use this but with WMV files. The version posted there does not work with WMV files. I tried changing the classID and that does not work it won't even start playing the files. Will you help me?
Obviously I changed the height and width. Can play mpeg just not wmv.
Nevermind. I uploaded it to the server and it worked fine.
Thanks. God Bless.
Aaron.
Last edited by aaroncavanaugh2; 05-12-2005 at 02:15 AM..
Random after play time huh? This isn't easy, if I have the time I might be able to work something up, but I can set you off in the right direction. A minor drawback for what you want to do is you would need to know the length of each song, because this length will be the deciding factor on when the function song() needs to run again. Look into the random function and how it is used. Also look into the setTimeout() in javascript.
i've read this entire topic and it was definetely useful but i was wondering about something else:
i want to have a non-visible embedded media player on my website linked to a m3u playlist, with my own custom-made previous-play-pause-next buttons that control the media player, i tried it with a code like this and when i press play it does work but when i press next it does go to the next song but i have to press play again before the song starts...
also: is there any way i can have the title of the song (as stated in the m3u file) displayed on my site?
In reference to leopold's post, you have some conflicting filename values, your embed src is different from the filename parameter value. Also you should be using quotes around your values. This embedded media player generator should prove helpful, to avoid any coding errors on the player that you might make.