PDA

View Full Version : Embedded music + selection



3dkingpin
05-02-2009, 07:13 PM
hi,

I want to embed a windows media player object into the HTML window and show only the controls to playback music.. Below this i want a list of links to different music tracks.

Now when the user clicks on a track it starts playing in the embedded control.

How can this be done is there a tutorial or template i could use?

Rowsdower!
05-02-2009, 10:07 PM
hi,

I want to embed a windows media player object into the HTML window and show only the controls to playback music.. Below this i want a list of links to different music tracks.

Now when the user clicks on a track it starts playing in the embedded control.

How can this be done is there a tutorial or template i could use?

I don't readily know of any tutorial or template, but if you know how to embed a windows media player (do a google search and you should find ample examples) all you need to do is add a javascript function to change the source of the media in the player. So assuming your HTML was something like this:
<object id="media_player1" height="62" width="250" classid="clsid:6BF52A52-394A-11D3-B153-00C04F79FAA6">
...
</object>
<h2>Track List:</h2>
<ul>
<li><a href="/music/track1.mp3" onclick="switch_track();">Track 1</a></li>
<li><a href="/music/track2.mp3" onclick="switch_track();">Track 2</a></li>
<li><a href="/music/track3.mp3" onclick="switch_track();">Track 3</a></li>
</ul>Something generally like this:
function switch_track(){
document.getElementById("media_player1").url=this.href;
}

I haven't tested any of the code but this should be a fair approximation of what you want. Once you have the basic embedding finished post back if the script doesn't work.