Forum Moderators: open

Message Too Old, No Replies

changes songs in a media player?

changes songs in a media player?

         

ryanc

8:56 pm on Apr 22, 2005 (gmt 0)

10+ Year Member


Can anyone help me with changing a song in a media player with javascript. This is what I have right now and it does not work?

<script type="text/javascript">
function playMusic()
{
document.Player.src = "song2.mp3"
}
</Script>

<embed type="application/x-mplayer2" pluginspage="http://www.microsoft.com/Windows/Downloads/Contents/MediaPlayer/" width="300" height="69" src="song1.mp3" autostart="True" showcontrols="True" showstatusbar="True" showdisplay="False" autorewind="True" loop="true" ID="Player"></embed>

<a href="#" onclick="playMusic()">Song 2</a>

Thanks,
ryanc

nicko170

7:31 am on Apr 29, 2005 (gmt 0)



if you just use this as a standalone you can add a link to the song on your page and it will play in the media of the browser

<a href="insert the location of the song here e.g: C:\mp3\eminem\file.mp3" onclick="playMusic()">this is what the browser will display</a>

ryanc

1:05 pm on Apr 29, 2005 (gmt 0)

10+ Year Member


Actually, I wanted to keep the player on the page and cycle several songs through the same player. And, I figured out how to do that, so I have it the way I want it now. Thank you for the reply though.

ryanc