<HTML> <HEAD> </HEAD> <BODY> <OBJECT ID="Player" CLASSID="CLSID:6BF52A52-394A-11d3-B153-00C04F79FAA6"> <PARAM NAME = "URL" VALUE = "http://proseware.com/popup.asx"> </OBJECT> <BR><BR> <!-- This is where the metadata info displays. --> <IMG id = "imgBanner" style = "cursor:hand" onClick = "BannerClick()"> Metadata displays here </DIV> <BR><BR> <!-- This is where the banners display. They are JPEGs. --> <IMG id = "imgBanner" style = "cursor:hand" onClick = "BannerClick()"> <SCRIPT> <!-- // Called when the media opens to retrieve and display metadata. function ShowMetadata() { var Media = Player.currentMedia; // Test whether we have a valid Media object. if(!Media) { divMetadata.innerHTML = "No current media."; return; } // Retrieve the metadata we want to display. var Title = Media.getItemInfo("Title"); var Artist = Media.getItemInfo("WM/AlbumArtist"); var AlbumTitle = Media.getItemInfo("WM/AlbumTitle"); var Duration = Media.durationString; // Test the duration string value. // Streaming media always returns zero. if(Duration == "00:00") { Duration = "No duration available"; } // Display the metadata in the DIV element. divMetadata.innerHTML = "Title: " + Title + "<BR>"; divMetadata.innerHTML += "Artist: " + Artist + "<BR>"; divMetadata.innerHTML += "Album: " + AlbumTitle + "<BR>"; divMetadata.innerHTML += "Duration: " + Duration + "<BR>"; } // Called when the media opens to show the banner image. function ShowAd() { var Media = Player.currentMedia; // Test whether a valid Media objec // was retrieved. if(!Media) { // No valid media. Cannot update the banner. return; } // Retrieve the banner URL from the // custom PARAM element in the playlist. var BannerURL = Media.getItemInfo("BannURL"); // Set the banner URL for the IMG element. imgBanner.src = BannerURL; } // Opens the URL specified in the ASX playlist in a // separate window when the user clicks the banner ad. function BannerClick() { var Media = Player.currentMedia; // Test whether a valid Media objec // was retrieved. if(!Media) { // No valid Media object. Do nothing. return; } // Retrieve the URL from the custom PARAM // element in the ASX playlist. var AdURL = Media.getItemInfo("AdURL"); // Open a separate browser window to display the // Web page. // The following code block contains line breaks for display purposes. // The scripting language does not support line breaks. // In actual implementation, you must remove the line breaks. window.open(AdURL,"", "height=300, width=500, left=300, menubar=no, scrollbars = yes, location=no, titlebar=no, toolbar=no, status=no"); } --> </SCRIPT> <!-- Event handler for OpenStateChange event. --> <SCRIPT Language = "JScript" FOR = "Player" EVENT = "OpenStateChange(NewState)"> switch(NewState) { // Media open. case 13: ShowMetadata(); ShowAd(); break; default: break; } </SCRIPT> </BODY> </HTML>
Section Title