function WMPPlayer()
{
    // call after rendering song
    this.createAudio = function( songURL, audiodiv) 
    {
	var urlAudioInfo = this.audioInfo[songURL];
	if( !urlAudioInfo )  {
	    urlAudioInfo = new Object();
	    urlAudioInfo.url = songURL;
	    urlAudioInfo.indexes = new Array();
	    this.audioInfo[songURL] = urlAudioInfo;
	}
	this.init(songURL);
	if( Utils.isOpera() ) {
	    audiodiv.innerHTML = '<div style="font-size:8;"><i>Audio</i>: Not supported on Opera: Sorry.</center>'
	    audiodiv.style.width = "100%";
	    audiodiv.style.textAlign = "center";
	    audiodiv.style.display = "block";
	    return;
	}
	if( songURL && songURL != "") {
	    audiodiv.style.width = "100%";
	    audiodiv.style.height = 72;
	    audiodiv.style.zIndex = 10;
	    audiodiv.style.display = "block";

	    // generate the correct name so that the pre-installed
	    // handlers will work
	    var audio_id  = wmpAudioControlNameBase + (_WMPAudioPlayers.length+1)

	    this.audio_id = audio_id;

	    var s = '<OBJECT id="' + audio_id + '" style="padding-top:5;" width="100%" height="44" ' +
		    ((!Utils.isIE() ) ? ' type="application/x-ms-wmp" ' : '' ) + // firefox
		    ((Utils.isIE() ) ? 'CLASSID="CLSID:6BF52A52-394A-11d3-B153-00C04F79FAA6">' : '>')+
			      '<PARAM NAME="URL" VALUE="' + songURL + '">' +
			      '<PARAM NAME="AutoStart" VALUE="False">' +
			      '<PARAM name="uiMode" value="full">' +
			      '<PARAM name="PlayCount" value="1">' +
			      '<PARAM name="ShowControls" value="True">' +
			      '<PARAM name="ShowStatusBar" value="true">' +
			       '</OBJECT>' +
			       this.getSliderControlsHTML(audio_id);
	    audiodiv.innerHTML = s;

	    // add to global array so that event handlers can find us
	    _WMPAudioPlayers[audio_id] = this;	 

	    this.audioPlayerControl = document.getElementById(audio_id);
	    this.initSliderControls(audio_id);
	}
    }

    /**
     * called from our event handler when play state changes
     * @private
     */
    this._onAudioControlPlayStateChange = function(newState)
    {
	if( this.audioPlayerControl != null ) {
	    if( this.audioPlayerControl.playState == 9 ) {
		this.audioUpdateTimeIndicator("Preparing to play ...");
	    }
	    else if( this.audioPlayerControl.playState == 8 ) {
		this.audioUpdateTimeIndicator("Buffering");
	    }
	    else if( this.audioPlayerControl.playState == 1 ) {
		this.onStop();
	    }
	    else if( this.audioPlayerControl.playState == 2 ) {
		this.onPause();
	    }
	    else if( this.audioPlayerControl.playState == 3 ) { 
		this.onPlay();
		this.audioTimerPoll();
	    }
	    else {
		this.audioUpdateTimeIndicator();
	    }
	}
    }

    this.onAudioControlPositionChange = function(newPosition) { 
	this.audioUpdateTimeIndicator(); 
    }

    this.getAudioPosition = function() { 
	return this.audioPlayerControl.controls.currentPosition; 
    }

    this.seekAudio = function(time) { 
	this.audioPlayerControl.controls.currentPosition = time; 
	this.audioUpdateTimeIndicator(); 
    }
    this.setAudioPlaybackRate = function(rate) {
	if( this.audioPlayerControl.settings )
	    this.audioPlayerControl.settings.rate = rate;
    }

    /**
     * poller while playing
     */
    this.audioTimerPoll = function()
    {
	this.audioUpdateTimeIndicator();
	if( this.audioPlayerControl.playState == 3 )
	    setTimeout(function() { me.audioTimerPoll(); }, 25 );
    }

    this.setPlayerAudio = function(URL) {
	if( this.audioPlayerControl.playState == 3 )	// if playing
	    this.audioPlayerControl.stop();		// stop
	this.audioPlayerControl.URL = URL;
    }

    var me = this;

    this.audio_id = "";

    this.setBaseObject(this);	// kind a kludgy
}
/**
 * a class that represents a WMP (Windows Media Player) audio plugin
 */
a class that represents a WMP (Windows Media Player) audio plugin
a class that represents a WMP ( Windows Media Player ) audio plugin
function WMPPlayer()
{
    this.createAudio = function( songURL, audiodiv) 
    {
	var urlAudioInfo = this.audioInfo[songURL];
	if( !urlAudioInfo )  {
	    urlAudioInfo = new Object();
	    urlAudioInfo.url = songURL;
	    urlAudioInfo.indexes = new Array();
	    this.audioInfo[songURL] = urlAudioInfo;
	}
	this.init(songURL);
	if( Utils.isOpera() ) {
	    audiodiv.innerHTML = '<div style="font-size:8;"><i>Audio</i>: Not supported on Opera: Sorry.</center>'
	    audiodiv.style.width = "100%";
	    audiodiv.style.textAlign = "center";
	    audiodiv.style.display = "block";
	    return;
	}
	if( songURL && songURL != "") {
	    audiodiv.style.width = "100%";
	    audiodiv.style.height = 72;
	    audiodiv.style.zIndex = 10;
	    audiodiv.style.display = "block";
	    var audio_id  = wmpAudioControlNameBase + (_WMPAudioPlayers.length+1)
	    this.audio_id = audio_id;
	    var s = '<OBJECT id="' + audio_id + '" style="padding-top:5;" width="100%" height="44" ' +
		    ((!Utils.isIE() ) ? ' type="application/x-ms-wmp" ' : '' ) + 
		    ((Utils.isIE() ) ? 'CLASSID="CLSID:6BF52A52-394A-11d3-B153-00C04F79FAA6">' : '>')+
			      '<PARAM NAME="URL" VALUE="' + songURL + '">' +
			      '<PARAM NAME="AutoStart" VALUE="False">' +
			      '<PARAM name="uiMode" value="full">' +
			      '<PARAM name="PlayCount" value="1">' +
			      '<PARAM name="ShowControls" value="True">' +
			      '<PARAM name="ShowStatusBar" value="true">' +
			       '</OBJECT>' +
			       this.getSliderControlsHTML(audio_id);
	    audiodiv.innerHTML = s;
	    _WMPAudioPlayers[audio_id] = this;	 
	    this.audioPlayerControl = document.getElementById(audio_id);
	    this.initSliderControls(audio_id);
	}
    }
    this._onAudioControlPlayStateChange = function(newState)
    {
	if( this.audioPlayerControl != null ) {
	    if( this.audioPlayerControl.playState == 9 ) {
		this.audioUpdateTimeIndicator("Preparing to play ...");
	    }
	    else if( this.audioPlayerControl.playState == 8 ) {
		this.audioUpdateTimeIndicator("Buffering");
	    }
	    else if( this.audioPlayerControl.playState == 1 ) {
		this.onStop();
	    }
	    else if( this.audioPlayerControl.playState == 2 ) {
		this.onPause();
	    }
	    else if( this.audioPlayerControl.playState == 3 ) { 
		this.onPlay();
		this.audioTimerPoll();
	    }
	    else {
		this.audioUpdateTimeIndicator();
	    }
	}
    }
    this.onAudioControlPositionChange = function(newPosition) { 
	this.audioUpdateTimeIndicator(); 
    }
    this.getAudioPosition = function() { 
	return this.audioPlayerControl.controls.currentPosition; 
    }
    this.seekAudio = function(time) { 
	this.audioPlayerControl.controls.currentPosition = time; 
	this.audioUpdateTimeIndicator(); 
    }
    this.setAudioPlaybackRate = function(rate) {
	if( this.audioPlayerControl.settings )
	    this.audioPlayerControl.settings.rate = rate;
    }
    this.audioTimerPoll = function()
    {
	this.audioUpdateTimeIndicator();
	if( this.audioPlayerControl.playState == 3 )
	    setTimeout(function() { me.audioTimerPoll(); }, 25 );
    }
    this.setPlayerAudio = function(URL) {
	if( this.audioPlayerControl.playState == 3 )	
	    this.audioPlayerControl.stop();		
	this.audioPlayerControl.URL = URL;
    }
    var me = this;
    this.audio_id = "";
    this.setBaseObject(this);	
}
function WMPPlayer ( ) { this . createAudio = function ( songURL , audiodiv ) { var urlAudioInfo = this . audioInfo [ songURL ] ; if ( ! urlAudioInfo ) { urlAudioInfo = new Object ( ) ; urlAudioInfo . url = songURL ; urlAudioInfo . indexes = new Array ( ) ; this . audioInfo [ songURL ] = urlAudioInfo ; } this . init ( songURL ) ; if ( Utils . isOpera ( ) ) { audiodiv . innerHTML = '<div style="font-size:8;"><i>Audio</i>: Not supported on Opera: Sorry.</center>' audiodiv . style . width = "100%" ; audiodiv . style . textAlign = "center" ; audiodiv . style . display = "block" ; return ; } if ( songURL && songURL != "" ) { audiodiv . style . width = "100%" ; audiodiv . style . height = 72 ; audiodiv . style . zIndex = 10 ; audiodiv . style . display = "block" ; var audio_id = wmpAudioControlNameBase + ( _WMPAudioPlayers . length + 1 ) this . audio_id = audio_id ; var s = '<OBJECT id="' + audio_id + '" style="padding-top:5;" width="100%" height="44" ' + ( ( ! Utils . isIE ( ) ) ? ' type="application/x-ms-wmp" ' : '' ) + ( ( Utils . isIE ( ) ) ? 'CLASSID="CLSID:6BF52A52-394A-11d3-B153-00C04F79FAA6">' : '>' ) + '<PARAM NAME="URL" VALUE="' + songURL + '">' + '<PARAM NAME="AutoStart" VALUE="False">' + '<PARAM name="uiMode" value="full">' + '<PARAM name="PlayCount" value="1">' + '<PARAM name="ShowControls" value="True">' + '<PARAM name="ShowStatusBar" value="true">' + '</OBJECT>' + this . getSliderControlsHTML ( audio_id ) ; audiodiv . innerHTML = s ; _WMPAudioPlayers [ audio_id ] = this ; this . audioPlayerControl = document . getElementById ( audio_id ) ; this . initSliderControls ( audio_id ) ; } } this . _onAudioControlPlayStateChange = function ( newState ) { if ( this . audioPlayerControl != null ) { if ( this . audioPlayerControl . playState == 9 ) { this . audioUpdateTimeIndicator ( "Preparing to play ..." ) ; } else if ( this . audioPlayerControl . playState == 8 ) { this . audioUpdateTimeIndicator ( "Buffering" ) ; } else if ( this . audioPlayerControl . playState == 1 ) { this . onStop ( ) ; } else if ( this . audioPlayerControl . playState == 2 ) { this . onPause ( ) ; } else if ( this . audioPlayerControl . playState == 3 ) { this . onPlay ( ) ; this . audioTimerPoll ( ) ; } else { this . audioUpdateTimeIndicator ( ) ; } } } this . onAudioControlPositionChange = function ( newPosition ) { this . audioUpdateTimeIndicator ( ) ; } this . getAudioPosition = function ( ) { return this . audioPlayerControl . controls . currentPosition ; } this . seekAudio = function ( time ) { this . audioPlayerControl . controls . currentPosition = time ; this . audioUpdateTimeIndicator ( ) ; } this . setAudioPlaybackRate = function ( rate ) { if ( this . audioPlayerControl . settings ) this . audioPlayerControl . settings . rate = rate ; } this . audioTimerPoll = function ( ) { this . audioUpdateTimeIndicator ( ) ; if ( this . audioPlayerControl . playState == 3 ) setTimeout ( function ( ) { me . audioTimerPoll ( ) ; } , 25 ) ; } this . setPlayerAudio = function ( URL ) { if ( this . audioPlayerControl . playState == 3 ) this . audioPlayerControl . stop ( ) ; this . audioPlayerControl . URL = URL ; } var me = this ; this . audio_id = "" ; this . setBaseObject ( this ) ; }
a class that represents a WMP (Windows Media Player) audio plugin
a class that represents a WMP ( Windows Media Player ) audio plugin
// call after rendering song
 // generate the correct name so that the pre-installed
 // handlers will work
 // firefox
 // add to global array so that event handlers can find us
 /**
     * called from our event handler when play state changes
     * @private
     */ /**
     * poller while playing
     */ // if playing
 // stop
 // kind a kludgy
