Neil Smith [MVP Digital M
Guest
|
Posted:
Mon Jul 18, 2005 8:30 pm Post subject:
Re: How to get title from metafile |
|
|
On Sat, 16 Jul 2005 09:44:58 -0700, "wizi"
<wizi@discussions.microsoft.com> wrote:
| Quote: | i am using Window Media Metafile for my website to play some songs. I use
this format .
entry><title>A</title><reft...></entry
entry><title>B</title><reft...></entry
When window media player ( on the web) is playing, how can i get the title
of the song which is playing (A, B, ect.)
|
Yes, thankfully it's relatively simple : The title is an attribute of
the player.currentMedia object - currentMedia is a handle to the item
currently playing (also you can use 'name' for this attribute)
So you would have for example in your page's <head />
<script language="javascript1.2" type="text/javascript">
function showCurrentTrackTitle() {
WMP9=document.getElementById("MediaPlayer");
alert(WMP9.currentMedia.name);
}
</script>
That's assuming you gave your <object /> tag an id of `MediaPlayer`.
Call it how you like, or to test it :
<a href="#" onclick="showCurrentTrackTitle(); return false">Show
Title</a>
Cheers - Neil |
|