// Turner XMP, Release Build, � 2007 Turner Broadcasting System, Inc. A Time Warner Company.  File: xmp_playerapi_native, Version: 0.1.567.2163

xmp.DHTML_PLAYER="DHTML";xmp.DHTML_MIME_TYPE="application/x-dhtml";xmp.DHTML_OBJECT_TRANSPORT="dhtmlObject";xmp.DHTMLPlayer=function(aa,ba){this.object=null;this.node=null;this.url="";xmp.DHTMLPlayer.ctor.call(this,xmp.DHTML_PLAYER,aa,ba);this._logger=new xmp.util.internals.CategoryLogger('DHTMLPlayer');};xmp.DERIVE_CLASS(xmp.AbstractNativePlayer,xmp.DHTMLPlayer);xmp.DHTMLPlayer.prototype.open=function(ca){this.node=ca;this.url=ca.getURI();var da=new xmp.util.Callback(this.getName(),this.onDHTMLObjectLoad,this);var ea=xmp.DHTML_OBJECT_TRANSPORT;var fa=ca.getMetadata('altRootUrlType','');if(fa.length>0){ea=fa;}
var ga=xmp.baseplayer.MetaFileLoaderFactory.getInstance().create(ea);ga.setIds([this.url],da);ga.load();};xmp.DHTMLPlayer.prototype.close=function(){if(this.object){this.object.close();this.object=null;}
xmp.DHTMLPlayer.base.close.call(this);};xmp.DHTMLPlayer.prototype.play=function(){this.object.play();xmp.DHTMLPlayer.base.play.call(this);this.setState(xmp.PLAY);};xmp.DHTMLPlayer.prototype.pause=function(){this.object.pause();xmp.DHTMLPlayer.base.pause.call(this);this.setState(xmp.PAUSE);};xmp.DHTMLPlayer.prototype.stop=function(){this.object.stop();xmp.DHTMLPlayer.base.stop.call(this);this.setState(xmp.STOP);};xmp.DHTMLPlayer.prototype.rewind=function(){this.object.rewind();xmp.DHTMLPlayer.base.rewind.call(this);this.setState(xmp.REWIND);};xmp.DHTMLPlayer.prototype.fastForward=function(){this.object.fastForward();xmp.DHTMLPlayer.base.fastForward.call(this);this.setState(xmp.FAST_FORWARD);};xmp.DHTMLPlayer.prototype.seek=function(ha){this.object.seek(ha);xmp.DHTMLPlayer.base.seek.call(this,ha);this.setState(xmp.SEEKABLE);};xmp.DHTMLPlayer.prototype.ended=function(){xmp.DHTMLPlayer.base.ended.call(this);this.object.ended();};xmp.DHTMLPlayer.prototype.isAvailable=function(ia){if(!this.object){return false;}
return this.object.isAvailable(ia);};xmp.DHTMLPlayer.prototype.getPosition=function(){return this.object.getPosition();};xmp.DHTMLPlayer.prototype.getDuration=function(){return this.object.getDuration();};xmp.DHTMLPlayer.prototype.moveTo=function(ja,ka,la,ma){xmp.DHTMLPlayer.base.moveTo.call(this,ja,ka,la,ma);this.object.moveTo(ja,ka,la,ma);};xmp.DHTMLPlayer.prototype.create=function(na){na.id=xmp.DHTML_PLAYER+na.group;xmp.DHTMLPlayer.base.create.call(this,na);if(na.viewport.getType()!==xmp.DHTML_VIEWPORT){throw new xmp.InvalidNativePlayerViewportError("Creating native player.","Invalid native player viewport \""+na.viewport.getType()+"\".  Supported viewports:  DHTML.",this);}
this.volume=na.volume;this.mute=na.mute;var oa=na.viewport.getNative();oa.innerHTML="<div id='"+na.id+"' style='background-color: #000000; z-index: "+xmp.NATIVE_PLAYER_Z_INDEX+"; width: "+oa.style.width+"; height: "+oa.style.height+"' />";this.setCreated();};xmp.DHTMLPlayer.prototype.onDHTMLObjectLoad=function(pa,qa){try{if(true===qa.isError()){return;}
this.object=qa.getDataObject();this.validateObject();this.object.open(this.getGroup(),this,this.getNative(),this.node);this.node=null;}
catch(e){this.setError("Loading DHTML object via Ajax request.",e);}};xmp.DHTMLPlayer.prototype.validateObject=function(){if(!this.object){throw new xmp.DHTMLObjectError("Validating DHTML object.","NULL DHTML object.");}
var ra=[{name:xmp.OPEN_OPERATION,implementation:this.object.open,args:4},{name:xmp.CLOSE_OPERATION,implementation:this.object.close,args:0},{name:xmp.PLAY_OPERATION,implementation:this.object.play,args:0},{name:xmp.PAUSE_OPERATION,implementation:this.object.pause,args:0},{name:xmp.STOP_OPERATION,implementation:this.object.stop,args:0},{name:xmp.REWIND_OPERATION,implementation:this.object.rewind,args:0},{name:xmp.FAST_FORWARD_OPERATION,implementation:this.object.fastForward,args:0},{name:xmp.SEEK_OPERATION,implementation:this.object.seek,args:1},{name:xmp.ENDED_OPERATION,implementation:this.object.ended,args:0},{name:xmp.IS_AVAILABLE_OPERATION,implementation:this.object.isAvailable,args:1},{name:xmp.GET_POSITION_OPERATION,implementation:this.object.getPosition,args:0},{name:xmp.GET_DURATION_OPERATION,implementation:this.object.getDuration,args:0},{name:xmp.MOVETO_OPERATION,implementation:this.object.moveTo,args:4}];var sa=ra.length;for(var i=0;i<sa;i++){if(!ra[i].implementation){throw new xmp.DHTMLObjectError("Validating DHTML object.","Missing required DHTML object method \""+ra[i].name.toLowerCase()+"\" implementation.");}
if(ra[i].implementation.length!==ra[i].args){throw new xmp.DHTMLObjectError("Validating DHTML object.","The required DHTML object method \""+ra[i].name.toLowerCase()+"\" requires \""+ra[i].args+"\" arguments.  \n\n"+ra[i].implementation.length+" arguments were found.");}}};xmp.DHTMLPlayer.prototype.onStateChange=function(ta,ua){xmp.validateArguments(arguments,[xmp.STRING_TYPE,xmp.STRING_TYPE],"DHTMLPlayer.onStateChange");this.setState(ta,ua);};xmp.DHTMLPlayer.prototype.onError=function(va,e){xmp.validateArguments(arguments,[xmp.STRING_TYPE,xmp.OBJECT_TYPE],"DHTMLPlayer.onError");this.setError(va,e);};xmp.FLASH="Flash";xmp.FLASH_MIME_TYPE="video/x-flv";xmp.FLASH_PLUGIN_MIME_TYPE="application/x-shockwave-flash";xmp.FLASH_PLUGIN_NAME="Shockwave Flash";xmp.FLASH_ACTIVEX_BASE_PROGID="ShockwaveFlash.ShockwaveFlash.";xmp.FLASH_ACTIVEX_VERSION_INDEPENDENT_PROGID="ShockwaveFlash.ShockwaveFlash";xmp.FLASH_VERSION=8;xmp.FLASH_VERSION_VARIABLE="$version";xmp.ALLOW_SCRIPT_ACCESS="allowScriptAccess";xmp.ALLOW_FULLSCREEN_ACCESS="allowFullScreen";xmp.ALWAYS_ACCESS="always";xmp.QUALITY="quality";xmp.QUALITY_HIGH="high";xmp.ALLOW_TRANSPARENCY="wmode";xmp.WINDOW_MODE="wmode";xmp.TRANSPARENT_WINDOW_MODE="transparent";xmp.FLASH_PLAYER_STATE_CHANGE_METHOD="onStateChange";xmp.FLASH_PLAYER_ERROR_METHOD="onError";xmp.FLASH_PLAYER_INITIALIZATION_METHOD="onInit";xmp.FLASH_PLAYER_EXECUTE_COMMAND_METHOD="onExecuteCommand";xmp.FLASH_PLAYER_TRIGGER_METHOD="onTrigger";xmp.SCRIPT_ELEMENT_TAG="script";xmp.FLASH_ERROR_CALLBACK="errorCallback";xmp.FLASH_INITIALIZATION_CALLBACK="initializationCallback";xmp.FLASH_STATE_CHANGE_CALLBACK="stateChangeCallback";xmp.FLASH_STATE_EXECUTE_COMMAND_CALLBACK="executeCommandCallback";xmp.FLASH_TRIGGER_CALLBACK="triggerCallback";xmp.EXECUTE_COMMAND_RESULT="executeCommandResult";xmp.FLASH_NATIVE_PLAYER_COMPONENT="native_player_component";xmp.FLASH_CONNECTION_ERROR="ConnectionError";xmp.FLASH_PLAYER_SWF_BASE_NAME="FlashMediaPlayer";xmp.FLASH_BUFFER_TIME_CONFIG="Buffer Time";xmp.FLASH_BUFFER_TIME="bufferTime";xmp.FLASH_STREAMING_VIDEO_ADAPTER_CONFIG="Streaming Video Adapter";xmp.FLASH_STREAMING_VIDEO_ADAPTER="streamingVideoAdapter";xmp.FLASH_FULLSCREEN_ENABLED="fullscreenEnabled";xmp.FlashPlayer=function(wa,xa){xmp.FlashPlayer.ctor.call(this,xmp.FLASH,wa,xa);};xmp.DERIVE_CLASS(xmp.AbstractNativePlayer,xmp.FlashPlayer);xmp.FlashPlayer.prototype.open=function(ya){this.getNative().fmpOpen(xmp.FLASH_MIME_TYPE,ya.getURI());};xmp.FlashPlayer.prototype.close=function(){this.getNative().fmpClose();xmp.FlashPlayer.base.close.call(this);};xmp.FlashPlayer.prototype.play=function(){this.getNative().fmpPlay();xmp.FlashPlayer.base.play.call(this);this.setState(xmp.PLAY);};xmp.FlashPlayer.prototype.pause=function(){this.getNative().fmpPause();xmp.FlashPlayer.base.pause.call(this);this.setState(xmp.PAUSE);};xmp.FlashPlayer.prototype.stop=function(){this.getNative().fmpStop();xmp.FlashPlayer.base.stop.call(this);this.setState(xmp.STOP);};xmp.FlashPlayer.prototype.rewind=function(){this.getNative().fmpRewind();xmp.FlashPlayer.base.rewind.call(this);this.setState(xmp.REWIND);};xmp.FlashPlayer.prototype.fastForward=function(){this.getNative().fmpFastForward();xmp.FlashPlayer.base.fastForward.call(this);this.setState(xmp.FAST_FORWARD);};xmp.FlashPlayer.prototype.seek=function(za){this.getNative().fmpSeek(za);xmp.FlashPlayer.base.seek.call(this,za);this.setState(xmp.SEEKABLE);};xmp.FlashPlayer.prototype.ended=function(){this.getNative().fmpEnded();xmp.FlashPlayer.base.ended.call(this);};xmp.FlashPlayer.prototype.isAvailable=function(Aa){return this.getNative().fmpIsAvailable(Aa);};xmp.FlashPlayer.prototype.getPosition=function(){return this.getNative().fmpGetPosition();};xmp.FlashPlayer.prototype.getDuration=function(){return this.getNative().fmpGetDuration();};xmp.FlashPlayer.prototype.getVolume=function(){return this.getNative().fmpGetVolume();};xmp.FlashPlayer.prototype.setVolume=function(Ba){this.getNative().fmpSetVolume(Ba);};xmp.FlashPlayer.prototype.getMute=function(){return this.getNative().fmpGetMute();};xmp.FlashPlayer.prototype.setMute=function(Ca){this.getNative().fmpSetMute(Ca);};xmp.FlashPlayer.prototype.setFullscreen=function(Da){var Ea="The \"setFullscreen\" method is not supported.  Fullscreen is only suppported by a double-click on the player.";if(false===this.isFullscreenEnabled()){Ea="The \"setFullscreen\" method is not supported.  Fullscreen disabled.";}
throw new xmp.NativePlayerUnsupportedError("Invoking \"setFullscreen\" method.",Ea,this);};xmp.FlashPlayer.prototype.onValidatePlugIn=function(Fa){this.validatePlugInVersion(xmp.FLASH,this.validatePlugInExists());};xmp.FlashPlayer.prototype.validatePlugInExists=function(){var Ga=this.getPlugInInfo(xmp.FLASH);if(xmp.isIEBrowser()){try{return this.getActiveXVersion(new ActiveXObject(xmp.FLASH_ACTIVEX_VERSION_INDEPENDENT_PROGID));}
catch(e){var Ha=parseInt(this.parseVersion(Ga.minVersion).major,10);var Ia=Ha;if(Ga.maxVersion&&Ga.maxVersion.length>0){Ia=parseInt(this.parseVersion(Ga.maxVersion).major,10);}
for(var i=Ia;(i>=3&&i>=Ha);i--){try{return this.getActiveXVersion(new ActiveXObject(xmp.FLASH_ACTIVEX_BASE_PROGID+i));}
catch(tempE){}}}
throw new xmp.PlugInNotFoundError("Validating native player plugin.",Ga);}
else{var Ja=navigator.mimeTypes[xmp.FLASH_PLUGIN_MIME_TYPE];if(!Ja){throw new xmp.PlugInNotFoundError("Validating native player plugin.",Ga);}
if(!Ja.enabledPlugin){throw new xmp.PlugInDisabledError("Validating native player plugin.",Ga,xmp.FLASH_PLUGIN_MIME_TYPE);}
var Ka=Ja.enabledPlugin.name;if(Ka.indexOf(xmp.FLASH_PLUGIN_NAME)===-1){throw new xmp.PlugInDisabledError("Validating native player plugin.",Ga,xmp.FLASH_PLUGIN_MIME_TYPE);}
var La=Ja.enabledPlugin.description;var Ma=this.getVersionFromString(xmp.MOZILLA_VERSION_DETECTION_JSON,La);return Ma;}
return"";};xmp.FlashPlayer.prototype.create=function(Na){if(true===this.attach(Na)){return;}
Na.id=xmp.FLASH+Na.group;xmp.FlashPlayer.base.create.call(this,Na);var Oa=Na.viewport.getNative();var Pa=new SWFObject(xmp.makeSWFPath(xmp.FLASH_PLAYER_SWF_BASE_NAME,true),Na.id,Oa.style.width,Oa.style.height,xmp.FLASH_VERSION,xmp.BLACK_BACKGROUND_COLOR);Pa.addParam(xmp.ALLOW_SCRIPT_ACCESS,xmp.ALWAYS_ACCESS);Pa.addParam(xmp.QUALITY,xmp.QUALITY_HIGH);Pa.addParam(xmp.ALLOW_TRANSPARENCY,"transparent");Pa.addParam(xmp.ALLOW_FULLSCREEN_ACCESS,xmp.TRUE);Pa.addVariable(xmp.FLASH_BUFFER_TIME,this.getConfigProperty(xmp.FLASH_BUFFER_TIME_CONFIG));Pa.addVariable(xmp.FLASH_STREAMING_VIDEO_ADAPTER,this.getConfigProperty(xmp.FLASH_STREAMING_VIDEO_ADAPTER_CONFIG));Pa.addVariable(xmp.FLASH_FULLSCREEN_ENABLED,((true===this.isFullscreenEnabled())?xmp.TRUE:xmp.FALSE));Pa.addVariable(xmp.FLASH_INITIALIZATION_CALLBACK,this.getCallbackMethod(xmp.FLASH_PLAYER_INITIALIZATION_METHOD));Pa.addVariable(xmp.FLASH_STATE_CHANGE_CALLBACK,this.getCallbackMethod(xmp.FLASH_PLAYER_STATE_CHANGE_METHOD));Pa.addVariable(xmp.FLASH_TRIGGER_CALLBACK,this.getCallbackMethod(xmp.FLASH_PLAYER_TRIGGER_METHOD));Pa.addVariable(xmp.FLASH_STATE_EXECUTE_COMMAND_CALLBACK,this.getCallbackMethod(xmp.FLASH_PLAYER_EXECUTE_COMMAND_METHOD));Pa.addVariable(xmp.FLASH_ERROR_CALLBACK,this.getCallbackMethod(xmp.FLASH_PLAYER_ERROR_METHOD));Pa.addVariable(xmp.VOLUME,Na.volume);Pa.addVariable(xmp.MUTE,((true===Na.mute)?xmp.TRUE:xmp.FALSE));Pa.write(Oa.id);};xmp.FlashPlayer.prototype.attach=function(Qa){Qa.id=Qa.viewport.getName();xmp.FlashPlayer.base.attach.call(this,Qa);if(Qa.viewport.getType()!==xmp.DHTML_VIEWPORT&&Qa.viewport.getType()!==xmp.FLASH_VIEWPORT){throw new xmp.InvalidNativePlayerViewportError("Creating native player.","Invalid native player viewport \""+Qa.viewport.getType()+"\".  Supported viewports:  DHTML, Flash",this);}
if(Qa.viewport.getType()!==xmp.FLASH_VIEWPORT){return false;}
var Ra=[{name:xmp.FLASH_BUFFER_TIME,value:this.getConfigProperty(xmp.FLASH_BUFFER_TIME_CONFIG)},{name:xmp.FLASH_STREAMING_VIDEO_ADAPTER,value:this.getConfigProperty(xmp.FLASH_STREAMING_VIDEO_ADAPTER_CONFIG)},{name:xmp.FLASH_INITIALIZATION_CALLBACK,value:this.getCallbackMethod(xmp.FLASH_PLAYER_INITIALIZATION_METHOD)},{name:xmp.FLASH_STATE_CHANGE_CALLBACK,value:this.getCallbackMethod(xmp.FLASH_PLAYER_STATE_CHANGE_METHOD)},{name:xmp.FLASH_TRIGGER_CALLBACK,value:this.getCallbackMethod(xmp.FLASH_PLAYER_TRIGGER_METHOD)},{name:xmp.FLASH_STATE_EXECUTE_COMMAND_CALLBACK,value:this.getCallbackMethod(xmp.FLASH_PLAYER_EXECUTE_COMMAND_METHOD)},{name:xmp.FLASH_ERROR_CALLBACK,value:this.getCallbackMethod(xmp.FLASH_PLAYER_ERROR_METHOD)},{name:xmp.VOLUME,value:Qa.volume},{name:xmp.MUTE,value:((true===Qa.mute)?xmp.TRUE:xmp.FALSE)}];var Sa=Ra.length;for(var i=0;i<Sa;i++){var Ta=Ra[i];this.getNative().SetVariable(Ta.name,Ta.value);}
this.setCreated();return true;};xmp.FlashPlayer.prototype.translateState=function(Ua){return Ua;};xmp.FlashPlayer.prototype.getActiveXVersion=function(Va){var Wa=Va.GetVariable(xmp.FLASH_VERSION_VARIABLE);return this.getVersionFromString(xmp.ACTIVEX_VERSION_DETECTION_JSON,Wa);};xmp.FlashPlayer.prototype.onInit=function(){try{this.getNative().style.zIndex=xmp.NATIVE_PLAYER_Z_INDEX;this.setCreated();}
catch(e){this.setError("Initializing.",e);}};xmp.FlashPlayer.prototype.onStateChange=function(Xa,Ya){try{var Za=this.translateState(Xa);if(Za.length>0){this.setState(Za,Ya);}}
catch(e){this.setError("Handling state change.",e);}};xmp.FlashPlayer.prototype.onTrigger=function($a,ab){try{this.setTrigger($a,ab);}
catch(e){this.setError("Handling trigger.",e);}};xmp.FlashPlayer.prototype.onExecuteCommand=function(bb,cb){var db=null;try{db=xmp.FlashPlayer.base.executeCommand.call(this,bb,cb);}
catch(e){this.setError("Execute command.",e);}
return db;};xmp.FlashPlayer.prototype.onError=function(eb,fb,gb){try{var hb=[{label:"Flash Error Type",text:eb}];if(gb){hb.push({label:"Flash Error Code",text:gb});}
var ib=((eb===xmp.FLASH_CONNECTION_ERROR)?new xmp.NativePlayerConnectionError("Connecting to media.",fb,this,hb):new xmp.NativePlayerError("Handling error.",fb,this,hb));this.setError(null,ib);}
catch(e){this.setError("Handling error.",e);}};xmp.IMAGE_PLAYER="Image";xmp.IMAGE_MIME_TYPE="application/x-image";xmp.IMAGE_TAG="IMG";xmp.IMAGE_STATE_CHANGE_METHOD="onStateChange";xmp.IMAGE_ERROR_METHOD="onError";xmp.IMAGE_INITIALIZATION_METHOD="onInit";xmp.ImagePlayer=function(jb,kb){xmp.ImagePlayer.ctor.call(this,xmp.IMAGE_PLAYER,jb,kb);};xmp.DERIVE_CLASS(xmp.AbstractNativePlayer,xmp.ImagePlayer);xmp.ImagePlayer.prototype.open=function(lb){this.url=lb.getURI();this.timeLimit=lb.getTimeLimitInSeconds();this.position=0;if(true===this.isDHTML()){this.setState(xmp.CONNECTING);this.getNative().src=this.url;}
else{this.getNative().fmpOpen(xmp.IMAGE_MIME_TYPE,this.url);}};xmp.ImagePlayer.prototype.close=function(){if(false===this.isDHTML()){this.getNative().fmpClose();}
xmp.ImagePlayer.base.close.call(this);};xmp.ImagePlayer.prototype.play=function(){if(-1!==this.timeLimit){this.startMonitor();}
this.setState(xmp.PLAY);};xmp.ImagePlayer.prototype.stop=function(){this.setState(xmp.STOP);};xmp.ImagePlayer.prototype.ended=function(){if(false===this.isDHTML()){this.getNative().fmpEnded();}
xmp.ImagePlayer.base.ended.call(this);this.close();};xmp.ImagePlayer.prototype.isAvailable=function(mb){return(mb===xmp.ENDED);};xmp.ImagePlayer.prototype.getPosition=function(){return this.position;};xmp.ImagePlayer.prototype.getDuration=function(){return((-1===this.timeLimit)?0:this.timeLimit);};xmp.ImagePlayer.prototype.create=function(nb){if(true===this.attach(nb)){return;}
nb.id=xmp.IMAGE_PLAYER+nb.group;xmp.ImagePlayer.base.create.call(this,nb);this.volume=nb.volume;this.mute=nb.mute;var ob=nb.viewport.getNative();ob.innerHTML="<img style='background-color:  #000000' id='"+nb.id+"' width='"+(ob.style.width)+"' height='"+(ob.style.height)+"' src='"+nb.node.getURI()+"' style='background-color:  #000000; z-index: "+xmp.NATIVE_PLAYER_Z_INDEX+"' onError='"+this.createCallbackMethod(xmp.IMAGE_ERROR_METHOD)+"()' onLoad='"+this.createCallbackMethod(xmp.IMAGE_STATE_CHANGE_METHOD)+"(xmp.OPEN, null)' />";this.setCreated();};xmp.ImagePlayer.prototype.onMonitorTimelineChange=function(pb,qb){this.position++;};xmp.ImagePlayer.prototype.attach=function(rb){rb.id=rb.viewport.getName();this.volume=rb.volume;this.mute=rb.mute;xmp.ImagePlayer.base.attach.call(this,rb);if(rb.viewport.getType()!==xmp.DHTML_VIEWPORT&&rb.viewport.getType()!==xmp.FLASH_VIEWPORT){throw new xmp.InvalidNativePlayerViewportError("Creating native player.","Invalid native player viewport \""+rb.viewport.getType()+"\".  Supported viewports:  DHTML,  Flash",this);}
if(rb.viewport.getType()!==xmp.FLASH_VIEWPORT){return false;}
this.getNative().SetVariable(xmp.FLASH_INITIALIZATION_CALLBACK,this.getCallbackMethod(xmp.IMAGE_INITIALIZATION_METHOD));this.getNative().SetVariable(xmp.FLASH_STATE_CHANGE_CALLBACK,this.getCallbackMethod(xmp.IMAGE_STATE_CHANGE_METHOD));this.getNative().SetVariable(xmp.FLASH_ERROR_CALLBACK,this.getCallbackMethod(xmp.IMAGE_ERROR_METHOD));this.getNative().SetVariable(xmp.CONTEXT,rb.group);this.setCreated();return true;};xmp.ImagePlayer.prototype.isDHTML=function(){return(this.getNative().tagName.toUpperCase()===xmp.IMAGE_TAG);};xmp.ImagePlayer.prototype.createCallbackMethod=function(sb){return this.getCallbackMethod(sb).replace(/\'/g,"\"");};xmp.ImagePlayer.prototype.translateState=function(tb){return tb;};xmp.ImagePlayer.prototype.onInit=function(){try{this.setCreated();}
catch(e){this.setError("Initializing.",e);}};xmp.ImagePlayer.prototype.onStateChange=function(ub,vb){try{var wb=this.translateState(ub);if(wb.length>0){this.setState(wb,vb);}}
catch(e){this.setError("Handling state change.",e);}};xmp.ImagePlayer.prototype.onError=function(xb,yb,zb){try{var Ab=null;if(true===this.isDHTML()){Ab=new xmp.NativePlayerConnectionError("Connecting to media.","Unable to connect to \""+this.getNative().src+"\"",this);}
else{var Bb=[{label:"Flash Error Type",text:xb}];if(zb){Bb.push({label:"Flash Error Code",text:zb});}
Ab=((xb===xmp.FLASH_CONNECTION_ERROR)?new xmp.NativePlayerConnectionError("Connecting to media.",yb,this,Bb):new xmp.NativePlayerError("Handling error.",yb,this,Bb));}
this.setError(null,Ab);}
catch(e){this.setError("Handling error.",e);}};xmp.MOCK_NATIVE="MOCK_NATIVE";xmp.MOCK_MIME_TYPE="application/xmp-mock";xmp.MockNativePlayer=function(Cb,Db){xmp.MockNativePlayer.ctor.call(this,xmp.MOCK_NATIVE,Cb,Db);this.position=0;this.duration=0;this.realTimePosition=0;this.realTimeDuration=0;this.playInstance=-1;this.monitorTimes=4.0;this.logger=new xmp.util.internals.CategoryLogger('MockNativePlayer');};xmp.DERIVE_CLASS(xmp.AbstractNativePlayer,xmp.MockNativePlayer);xmp.MockNativePlayer.prototype.open=function(Eb){this.node=Eb;this.logger.info("open(): "+this.node.getURI());this.position=0;this.duration=this._getDuration();this.realTimePosition=0;this.realTimeDuration=xmp.util.internals.MockTestMode.getInstance().getRealPlayTimePerNode();this.monitorInterval=this.realTimeDuration/this.monitorTimes;this.positionChangeInterval=this.duration/(this.monitorTimes*2);this.realTimePositionChangeInterval=this.realTimeDuration/(this.monitorTimes*2);this.logger.info("Duration: "+this.duration+" second(s)");this.logger.debug("Real time duration: "+this.realTimeDuration+" milliseconds");this.setState(xmp.OPEN);};xmp.MockNativePlayer.prototype.close=function(){if(this.node){this.logger.info("close(): "+this.node.getURI());}
this.node=null;xmp.MockNativePlayer.base.close.call(this);};xmp.MockNativePlayer.prototype.fini=function(){this.close();};xmp.MockNativePlayer.prototype.onSetState=function(Fb,Gb){xmp.MockNativePlayer.base.onSetState.call(this,Fb,Gb);var Hb=Fb.getMetadata(xmp.CONTEXT,{});if(Hb.type===xmp.PLAY){this.simulatePlay();}};xmp.MockNativePlayer.prototype.play=function(){this.setState(xmp.PLAY);};xmp.MockNativePlayer.prototype.simulatePlay=function(){var Ib=this.node;this.logger.info("play(): "+Ib.getURI());this.logger.info("Node type: "+Ib.getNodeTypeName());this.playInstance++;var Jb=this.createTimer({object:this,id:"position change",interval:this.realTimePositionChangeInterval,handler:this.onSimulatedPositionChange,context:this.playInstance});Jb.start();this.startMonitor();};xmp.MockNativePlayer.prototype.onSimulatedPositionChange=function(Kb,Lb){var Mb=this.node;var Nb=Kb.getMetadata(xmp.CONTEXT,-1);if(!Mb||Nb!==this.playInstance){Lb.stop();}
else if(this.position>=this.duration){Lb.stop();this.stopMonitor();this.setState(xmp.ENDED);}
else{this.position+=this.positionChangeInterval;}};xmp.MockNativePlayer.prototype._getDuration=function(){var Ob=-1;var Pb=this.node;if(Pb.isContentType()||Pb.isAdType()){var Qb=Pb.getPlayableData();Ob=Qb.getTotalRunTime();}
if(Ob<=0){Ob=3;}
return Ob;};xmp.MockNativePlayer.prototype.pause=function(){if(this.node!==null){this.logger.info("pause(): "+this.node.getURI());}
xmp.MockNativePlayer.base.pause.call(this);this.setState(xmp.PAUSE);};xmp.MockNativePlayer.prototype.stop=function(){if(this.node!==null){this.logger.info("stop(): "+this.node.getURI());}
xmp.MockNativePlayer.base.stop.call(this);this.setState(xmp.STOP);};xmp.MockNativePlayer.prototype.rewind=function(){if(this.node!==null){this.logger.info("rewind(): "+this.node.getURI());}
xmp.MockNativePlayer.base.rewind.call(this);this.setState(xmp.REWIND);};xmp.MockNativePlayer.prototype.fastForward=function(){if(this.node!==null){this.logger.info("fastForward(): "+this.node.getURI());}
xmp.MockNativePlayer.base.fastForward.call(this);this.setState(xmp.FAST_FORWARD);};xmp.MockNativePlayer.prototype.seek=function(Rb){if(this.node!==null){this.logger.info("seek(): "+this.node.getURI()+" to "+Rb);}
xmp.MockNativePlayer.base.seek.call(this);this.setPosition(Rb);this.setState(xmp.SEEKABLE);};xmp.MockNativePlayer.prototype.ended=function(){if(this.node!==null){this.logger.info("ended(): "+this.node.getURI());}
xmp.MockNativePlayer.base.ended.call(this);};xmp.MockNativePlayer.prototype.isAvailable=function(Sb){return true;};xmp.MockNativePlayer.prototype.getPosition=function(){return this.position;};xmp.MockNativePlayer.prototype.getDuration=function(){return this.duration;};xmp.MockNativePlayer.prototype.validate=function(Tb){};xmp.MockNativePlayer.prototype.onValidatePlugIn=function(Ub){};xmp.MockNativePlayer.prototype.setCreated=function(){this.createTimer({object:this,id:"setCreated",interval:xmp.DEFAULT_TIMER_INTERVAL,handler:this.onSetCreated,context:null}).start();};xmp.MockNativePlayer.prototype.executeCommand=function(Vb,Wb){return this.listener.onNativePlayerExecuteCommand(Vb,Wb);};xmp.MockNativePlayer.prototype.create=function(Xb){this.data=Xb;};xmp.MockNativePlayer.prototype.attach=function(Yb){this.data=Yb;};xmp.MockNativePlayer.prototype.getNative=function(){return null;};xmp.MockNativePlayer.prototype.getMonitorInterval=function(){return this.monitorInterval;};xmp.QUICKTIME="QuickTime";xmp.QUICKTIME_MIME_TYPE="video/quicktime";xmp.FLIP4MAC="Flip4Mac";xmp.QUICKTIME_VERSION_CHECK_PROGID="QuickTimeCheckObject.QuickTimeCheck.1";xmp.FLIP4MAC_VERSION_DETECTION_JSON="Flip4Mac Version Detection JSON";xmp.QuickTimePlayer=function(Zb,$b){this.state=new xmp.QuicktimeStateMachine(this);xmp.QuickTimePlayer.ctor.call(this,xmp.QUICKTIME,Zb,$b);};xmp.DERIVE_CLASS(xmp.AbstractNativePlayer,xmp.QuickTimePlayer);xmp.QuickTimePlayer.prototype.open=function(ac){this.state.open(ac);};xmp.QuickTimePlayer.prototype.close=function(){xmp.QuickTimePlayer.base.close.call(this);this.state.close();};xmp.QuickTimePlayer.prototype.play=function(){xmp.QuickTimePlayer.base.play.call(this);this.state.play();};xmp.QuickTimePlayer.prototype.pause=function(){xmp.QuickTimePlayer.base.pause.call(this);this.state.pause();};xmp.QuickTimePlayer.prototype.stop=function(){xmp.QuickTimePlayer.base.stop.call(this);this.state.stop();};xmp.QuickTimePlayer.prototype.rewind=function(){xmp.QuickTimePlayer.base.rewind.call(this);this.state.rewind();};xmp.QuickTimePlayer.prototype.fastForward=function(){xmp.QuickTimePlayer.base.fastForward.call(this);this.state.fastForward();};xmp.QuickTimePlayer.prototype.seek=function(bc){xmp.QuickTimePlayer.base.seek.call(this,bc);this.state.seek(bc);};xmp.QuickTimePlayer.prototype.ended=function(){xmp.QuickTimePlayer.base.ended.call(this);this.state.ended();};xmp.QuickTimePlayer.prototype.isAvailable=function(cc){return this.state.isAvailable(cc);};xmp.QuickTimePlayer.prototype.onValidatePlugIn=function(dc){this.validateQuicktime();if(dc.indexOf(xmp.WINDOWS_MEDIA_MIME_TYPE)!==-1){this.validateFlip4Mac();}};xmp.QuickTimePlayer.prototype.getPosition=function(){return this.state.getPosition();};xmp.QuickTimePlayer.prototype.getDuration=function(){return this.state.getDuration();};xmp.QuickTimePlayer.prototype.getVolume=function(){return this.state.getVolume();};xmp.QuickTimePlayer.prototype.setVolume=function(ec){this.state.setVolume(ec);};xmp.QuickTimePlayer.prototype.getMute=function(){return this.state.getMute();};xmp.QuickTimePlayer.prototype.setMute=function(fc){this.state.setMute(fc);};xmp.QuickTimePlayer.prototype.create=function(gc){gc.id=xmp.QUICKTIME+gc.group;xmp.QuickTimePlayer.base.create.call(this,gc);if(gc.viewport.getType()!==xmp.DHTML_VIEWPORT){throw new xmp.InvalidNativePlayerViewportError("Creating native player.","Invalid native player viewport \""+gc.viewport.getType()+"\".  Supported viewports:  DHTML",this);}
var hc=gc.viewport.getNative();if(true===xmp.isIEBrowser()){hc.innerHTML="<object id='"+gc.id+"' width='"+hc.style.width+"' height='"+hc.style.height+"' classid='clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B'"+" style='background-color:  #000000; z-index: "+xmp.NATIVE_PLAYER_Z_INDEX+"' >"+"<param name='src' value='"+gc.node.getURI()+"' />"+"<param name='showlogo' value='false' />"+"<param name='bgcolor' value='#000000' />"+"<param name='autoplay' value='true' />"+"<param name='controller' value='false' />"+"<param name='enablejavascript' value='true' />"+"<param name='saveembedtags' value='true' />"+"<param name='scale' value='"+((true===gc.stretchToFit)?"TOFIT":"ASPECT")+"' />"+"<param name='loop' value='false' />"+"<param name='kioskmode' value='true' /></object>";}
else{hc.innerHTML="<embed type='video/quicktime' name='"+gc.id+"' width='"+hc.style.width+"' height='"+hc.style.height+"' src='"+gc.node.getURI()+"' showlogo='false'"+" style='background-color:  #000000; z-index: "+xmp.NATIVE_PLAYER_Z_INDEX+"' bgcolor='#000000' autoplay='true'"+" controller='false' enablejavascript='true' saveembedtags='true'"+" scale='"+((true===gc.stretchToFit)?"TOFIT":"ASPECT")+"' loop='false' kioskmode='true'></embed>";}
this.state.create(gc);this.setCreated();};xmp.QuickTimePlayer.prototype.validateQuicktime=function(){var ic=this.getPlugInInfo(xmp.QUICKTIME);var jc="0.0.0.0";if(true===xmp.isIEBrowser()){try{var kc=new ActiveXObject(xmp.QUICKTIME_VERSION_CHECK_PROGID);jc=this.getVersionFromString(xmp.ACTIVEX_VERSION_DETECTION_JSON,kc.QuickTimeVersion);}
catch(e){throw new xmp.PlugInNotFoundError("Validating native player plugin.",ic);}
this.validatePlugInVersion(xmp.QUICKTIME,jc);}
else{var lc=navigator.mimeTypes[xmp.QUICKTIME_MIME_TYPE];if(!lc){throw new xmp.PlugInNotFoundError("Validating native player plugin.",ic);}
if(!lc.enabledPlugin){throw new xmp.PlugInDisabledError("Validating native player plugin.",ic,xmp.QUICKTIME_MIME_TYPE);}
var mc=lc.enabledPlugin.name;if(mc.indexOf(xmp.QUICKTIME)===-1){throw new xmp.PlugInDisabledError("Validating native player plugin.",ic,xmp.QUICKTIME_MIME_TYPE);}
jc=this.getVersionFromString(xmp.MOZILLA_VERSION_DETECTION_JSON,mc);this.validatePlugInVersion(xmp.QUICKTIME,jc);}};xmp.QuickTimePlayer.prototype.validateFlip4Mac=function(){var nc;var oc=this.getPlugInInfo(xmp.FLIP4MAC);var pc=navigator.plugins.length;for(var i=0;i<pc;i++){var qc=navigator.plugins[i];nc=qc.name;var rc=nc.length;if(nc.indexOf(xmp.FLIP4MAC)!==-1){var sc=this.getVersionFromString(xmp.FLIP4MAC_VERSION_DETECTION_JSON,nc);this.validatePlugInVersion(xmp.FLIP4MAC,sc);return;}}
throw new xmp.PlugInNotFoundError("Validating native player plugin.",oc);};xmp.QUICKTIME_WAITING="Waiting";xmp.QUICKTIME_LOADING="Loading";xmp.QUICKTIME_PLAYABLE="Playable";xmp.QUICKTIME_COMPLETE="Complete";xmp.QUICKTIME_ERROR="Error";xmp.QUICKTIME_NORMAL_RATE=1;xmp.QUICKTIME_PAUSE_RATE=0;xmp.QUICKTIME_REWIND_RATE=-5;xmp.QUICKTIME_FAST_FORWARD_RATE=5;xmp.QUICKTIME_VOLUME_MAX=256;xmp.QUICKTIME_INITIAL_LIVE_DURATION=180000;xmp.QUICKTIME_LOAD_BUFFERING="LoadBuffering";xmp.QUICKTIME_WAIT_BUFFERING="WaitBuffering";xmp.QUICKTIME_BUFFERING_COMPLETE="BufferingComplete";xmp.QUICKTIME_STATE_CHANGE_POLLING_INTERVAL_CONFIG="State Change Polling Interval";xmp.QUICKTIME_CONNECTION_TIMEOUT_INTERVAL_CONFIG="Connection Timeout Interval";xmp.QUICKTIME_ERROR_CODE_DELIMITER=",";xmp.QuicktimeStateMachine=function(tc){this.player=tc;this.initTransitionTable();this.initStateChangeHandlers();this.initOperations();this.initErrorCodes();this.live=true;this.stateChangeMonitorTimer=null;this.connectionTimeoutTimer=null;this.bufferingComplete=false;};xmp.QuicktimeStateMachine.prototype.open=function(uc){if(false===this.checkForStaticUrl()){this.initState();this.url=uc.getURI();this.player.getNative().SetURL(this.url);}};xmp.QuicktimeStateMachine.prototype.close=function(){try{this.setState(xmp.FINI,false);this.opened=false;this.stopStateChangeMonitor();this.stopConnectionTimeoutMonitor();this.player.getNative().SetMute(true);this.player.getNative().Stop();}
catch(e){}};xmp.QuicktimeStateMachine.prototype.play=function(){this.player.getNative().Play();this.setState(xmp.PLAY,true);};xmp.QuicktimeStateMachine.prototype.pause=function(){this.player.getNative().SetRate(xmp.QUICKTIME_PAUSE_RATE);this.setState(xmp.PAUSE,true);};xmp.QuicktimeStateMachine.prototype.stop=function(){this.player.getNative().Stop();this.player.getNative().Rewind();this.setState(xmp.STOP,true);};xmp.QuicktimeStateMachine.prototype.rewind=function(){this.player.getNative().SetRate(xmp.QUICKTIME_REWIND_RATE);this.setState(xmp.REWIND,true);};xmp.QuicktimeStateMachine.prototype.fastForward=function(){this.player.getNative().SetRate(xmp.QUICKTIME_FAST_FORWARD_RATE);this.setState(xmp.FAST_FORWARD,true);};xmp.QuicktimeStateMachine.prototype.seek=function(vc){this.player.getNative().SetRate(xmp.QUICKTIME_NORMAL_RATE);this.player.getNative().SetTime(vc*this.player.getNative().GetTimeScale());this.setState(xmp.SEEKABLE,true);};xmp.QuicktimeStateMachine.prototype.ended=function(){this.setState(xmp.ENDED,false);};xmp.QuicktimeStateMachine.prototype.isAvailable=function(wc){var xc=this.operations[this.state];for(var yc=xmp.MapIterator.create(xc);yc.hasNext();yc.next()){var zc=yc.currentValue();if(zc.state===wc){if(false===this.live){return true;}
else{return(true===zc.live);}}}
return false;};xmp.QuicktimeStateMachine.prototype.getPosition=function(){try{return Math.floor(this.player.getNative().GetTime()/this.player.getNative().GetTimeScale());}
catch(e){}
return 0;};xmp.QuicktimeStateMachine.prototype.getDuration=function(){try{var Ac=this.live;var Bc=this.player.getNative().GetDuration();if(true===this.isInitializing()){Ac=this.isLive(Bc);}
return((true===Ac||Bc===0)?0:Math.floor(Bc/this.player.getNative().GetTimeScale()));}
catch(e){}
return 0;};xmp.QuicktimeStateMachine.prototype.getVolume=function(){return Math.abs(Math.floor(((this.player.getNative().GetVolume()+1)/xmp.QUICKTIME_VOLUME_MAX)*100));};xmp.QuicktimeStateMachine.prototype.setVolume=function(Cc){this.player.getNative().SetVolume(Math.floor(((Cc.toFixed(1)+1)*0.01)*xmp.QUICKTIME_VOLUME_MAX));this.volume=Cc;this.muted=this.getMute();};xmp.QuicktimeStateMachine.prototype.getMute=function(){var Dc=this.player.getNative().GetMute();return(Dc===true||Dc===1);};xmp.QuicktimeStateMachine.prototype.setMute=function(Ec){this.player.getNative().SetMute(Ec);this.muted=Ec;this.volume=Math.floor(((this.player.getNative().GetVolume()+1)/xmp.QUICKTIME_VOLUME_MAX)*100);};xmp.QuicktimeStateMachine.prototype.create=function(Fc){this.stateChangePollingInterval=parseInt(this.player.getConfigProperty(xmp.QUICKTIME_STATE_CHANGE_POLLING_INTERVAL_CONFIG),10);if(!this.stateChangePollingInterval){throw new xmp.NativePlayerError("Validating state change polling interval.","Missing state change polling interval.",this.player,null);}
this.connectionTimeoutInterval=parseInt(this.player.getConfigProperty(xmp.QUICKTIME_CONNECTION_TIMEOUT_INTERVAL_CONFIG),10);if(!this.connectionTimeoutInterval){throw new xmp.NativePlayerError("Validating connection timeout interval.","Missing connection timeout interval.",this.player,null);}
this.url=Fc.node.getURI();this.staticUrl=this.url;this.volume=Fc.volume;this.muted=Fc.muted;this.initState();};xmp.QuicktimeStateMachine.prototype.onStateChange=function(Gc,Hc){try{if(this.state===xmp.ERRORS){return;}
if(true===this.canGetPluginStatus()){var Ic=this.getRawPluginStatus();if(!Ic){return;}
var Jc=this.translateState(Ic);if(Jc.length>0){if(false===this.stateHandlers[Jc].apply(this,[Ic,Jc])){return;}}}
if(false===this.isInitializing()){var Kc=this.getPosition();if(this.state!==xmp.ENDED&&Kc>0&&(Kc>=this.getDuration())&&false===this.live){this.setState(xmp.ENDED,true);}}}
catch(e){this.setError(null,e);}};xmp.QuicktimeStateMachine.prototype.onConnectionTimeout=function(Lc,Mc){try{this.stopConnectionTimeoutMonitor();if(this.state===xmp.ERRORS){return;}
if(false===this.opened&&false===this.validateUrl()){var e=this.createConnectionError(this.getRawPluginStatus(),"Connection timeout.","Error connecting to \""+this.url+"\".");throw e;}}
catch(e2){this.setError(null,e2);}};xmp.QuicktimeStateMachine.prototype.translateState=function(Nc){if(Nc.indexOf(xmp.QUICKTIME_ERROR)===-1&&false===this.validateUrl()){return"";}
for(var i=0;i<this.transitionTable.length;i++){var Oc=this.transitionTable[i];if(Nc.indexOf(Oc.nativeState)===0){if(0===Oc.currentState.length){return Oc.transitionState;}
else{for(var j=0;j<Oc.currentState.length;j++){if(this.state===Oc.currentState[j]){return Oc.transitionState;}}}}}
return"";};xmp.QuicktimeStateMachine.prototype.initOperations=function(){this.operations={};this.operations[xmp.INIT]=[];this.operations[xmp.CONNECTING]=[];this.operations[xmp.CONNECTED]=[];this.operations[xmp.OPEN]=[];this.operations[xmp.FINI]=[];this.operations[xmp.PLAY]=[{state:xmp.PAUSE,live:false},{state:xmp.STOP,live:true},{state:xmp.REWIND,live:false},{state:xmp.FAST_FORWARD,live:false},{state:xmp.SEEKABLE,live:false}];this.operations[xmp.PAUSE]=[{state:xmp.PLAY,live:false},{state:xmp.STOP,live:false},{state:xmp.REWIND,live:false},{state:xmp.FAST_FORWARD,live:false},{state:xmp.SEEKABLE,live:false}];this.operations[xmp.STOP]=[{state:xmp.PLAY,live:true},{state:xmp.REWIND,live:false},{state:xmp.FAST_FORWARD,live:false}];this.operations[xmp.REWIND]=[{state:xmp.PLAY,live:false},{state:xmp.STOP,live:false},{state:xmp.PAUSE,live:false},{state:xmp.FAST_FORWARD,live:false},{state:xmp.SEEKABLE,live:false}];this.operations[xmp.FAST_FORWARD]=[{state:xmp.PLAY,live:false},{state:xmp.PAUSE,live:false},{state:xmp.STOP,live:false},{state:xmp.REWIND,live:false},{state:xmp.SEEKABLE,live:false}];this.operations[xmp.SEEKABLE]=[{state:xmp.SEEKABLE,live:false},{state:xmp.PAUSE,live:false},{state:xmp.STOP,live:false},{state:xmp.REWIND,live:false},{state:xmp.FAST_FORWARD,live:false}];this.operations[xmp.ENDED]=[{state:xmp.PLAY,live:false},{state:xmp.FAST_FORWARD,live:false},{state:xmp.SEEKABLE,live:false}];this.operations[xmp.ERRORS]=[];};xmp.QuicktimeStateMachine.prototype.setState=function(Pc,Qc,Rc){this.state=Pc;if(true===Qc){var Sc=((Pc===xmp.QUICKTIME_LOAD_BUFFERING||Pc===xmp.QUICKTIME_WAIT_BUFFERING||Pc===xmp.QUICKTIME_BUFFERING_COMPLETE)?xmp.BUFFERING:Pc);this.player.setState(Sc,Rc);}};xmp.QuicktimeStateMachine.prototype.initTransitionTable=function(){this.transitionTable=[];this.transitionTable.push({nativeState:xmp.QUICKTIME_WAITING,currentState:[xmp.INIT],transitionState:xmp.CONNECTING});this.transitionTable.push({nativeState:xmp.QUICKTIME_WAITING,currentState:[xmp.CONNECTING,xmp.QUICKTIME_WAIT_BUFFERING],transitionState:xmp.QUICKTIME_WAIT_BUFFERING});this.transitionTable.push({nativeState:xmp.QUICKTIME_LOADING,currentState:[xmp.INIT,xmp.CONNECTING,xmp.QUICKTIME_WAIT_BUFFERING],transitionState:xmp.CONNECTED});this.transitionTable.push({nativeState:xmp.QUICKTIME_LOADING,currentState:[xmp.CONNECTED,xmp.QUICKTIME_LOAD_BUFFERING,xmp.OPEN],transitionState:xmp.QUICKTIME_LOAD_BUFFERING});this.transitionTable.push({nativeState:xmp.QUICKTIME_PLAYABLE,currentState:[xmp.PLAY,xmp.PAUSE,xmp.STOP,xmp.REWIND,xmp.FAST_FORWARD,xmp.SEEKABLE,xmp.BUFFERING],transitionState:xmp.BUFFERING});this.transitionTable.push({nativeState:xmp.QUICKTIME_COMPLETE,currentState:[xmp.INIT,xmp.CONNECTING,xmp.CONNECTED,xmp.QUICKTIME_WAIT_BUFFERING,xmp.QUICKTIME_LOAD_BUFFERING],transitionState:xmp.OPEN});this.transitionTable.push({nativeState:xmp.QUICKTIME_COMPLETE,currentState:[xmp.PLAY,xmp.PAUSE,xmp.STOP,xmp.REWIND,xmp.FAST_FORWARD,xmp.SEEKABLE,xmp.OPEN,xmp.BUFFERING],transitionState:xmp.QUICKTIME_BUFFERING_COMPLETE});this.transitionTable.push({nativeState:xmp.QUICKTIME_PLAYABLE,currentState:[xmp.INIT,xmp.CONNECTING,xmp.CONNECTED,xmp.QUICKTIME_WAIT_BUFFERING,xmp.QUICKTIME_LOAD_BUFFERING],transitionState:xmp.OPEN});this.transitionTable.push({nativeState:xmp.QUICKTIME_COMPLETE,currentState:[xmp.QUICKTIME_LOAD_BUFFERING],transitionState:xmp.ERRORS});this.transitionTable.push({nativeState:xmp.QUICKTIME_ERROR,currentState:[],transitionState:xmp.ERRORS});};xmp.QuicktimeStateMachine.prototype.initStateChangeHandlers=function(){this.stateHandlers={};this.stateHandlers[xmp.ERRORS]=this.onError;this.stateHandlers[xmp.CONNECTING]=this.onConnecting;this.stateHandlers[xmp.CONNECTED]=this.onConnected;this.stateHandlers[xmp.OPEN]=this.onOpen;this.stateHandlers[xmp.QUICKTIME_WAIT_BUFFERING]=this.onBuffering;this.stateHandlers[xmp.QUICKTIME_LOAD_BUFFERING]=this.onBuffering;this.stateHandlers[xmp.QUICKTIME_BUFFERING_COMPLETE]=this.onBuffering;this.stateHandlers[xmp.BUFFERING]=this.onBuffering;};xmp.QuicktimeStateMachine.prototype.onError=function(Tc,Uc){this.opened=false;var Vc="Unknown error.";if(true===this.isInitializing()){Vc="Error connecting to \""+this.url+"\".";}
this.setError(null,this.createConnectionError(Tc,"Connecting to media.",Vc));return false;};xmp.QuicktimeStateMachine.prototype.onConnected=function(Wc,Xc){this.player.startMonitor();this.setState(xmp.CONNECTED,true);return true;};xmp.QuicktimeStateMachine.prototype.onConnecting=function(Yc,Zc){this.player.startMonitor();this.setState(xmp.CONNECTING,true);return true;};xmp.QuicktimeStateMachine.prototype.onOpen=function($c,ad){this.opened=true;this.live=this.isLive(this.player.getNative().GetDuration());this.setVolume(this.volume);if(true===this.muted){this.setMute(true);}
this.setState(xmp.OPEN,true);this.player.setState(xmp.FIRST_FRAME_RENDERED);return true;};xmp.QuicktimeStateMachine.prototype.onBuffering=function(bd,cd){this.checkSetOpen();if(this.state!==xmp.QUICKTIME_WAIT_BUFFERING&&this.state!==xmp.QUICKTIME_LOAD_BUFFERING&&this.state!==xmp.QUICKTIME_BUFFERING_COMPLETE&&this.state!==xmp.BUFFERING){this.operations[cd]=this.operations[this.state];}
var dd=this.getRawBytesTotal();var ed=((cd===xmp.QUICKTIME_BUFFERING_COMPLETE)?dd:this.getRawBytesLoaded());var fd=((dd<=0)?0:Math.floor((ed/dd)*100));fd=((99===fd)?100:fd);if(false===this.bufferingComplete&&(false===this.isLive(this.getRawDuration())||cd===xmp.QUICKTIME_WAIT_BUFFERING||cd===xmp.QUICKTIME_LOAD_BUFFERING||cd===xmp.QUICKTIME_BUFFERING_COMPLETE)){this.setState(cd,true,{percent:fd,bytesDownloaded:ed,bytesTotal:dd});}
this.bufferingComplete=(100===fd);if(cd===xmp.QUICKTIME_LOAD_BUFFERING&&true===this.bufferingComplete){this.onOpen(bd,cd);}
return true;};xmp.QuicktimeStateMachine.prototype.isInitializing=function(){return(this.state===xmp.INIT||this.state===xmp.CONNECTING||this.state===xmp.CONNECTED||this.state===xmp.QUICKTIME_WAIT_BUFFERING||this.state===xmp.QUICKTIME_LOAD_BUFFERING);};xmp.QuicktimeStateMachine.prototype.isBuffering=function(){return(this.state===xmp.BUFFERING||this.state===xmp.QUICKTIME_WAIT_BUFFERING||this.state===xmp.QUICKTIME_LOAD_BUFFERING||this.state===xmp.QUICKTIME_BUFFERING_COMPLETE);};xmp.QuicktimeStateMachine.prototype.isLive=function(gd){return(xmp.QUICKTIME_INITIAL_LIVE_DURATION===gd||0===gd||-1===gd);};xmp.QuicktimeStateMachine.prototype.canGetPluginStatus=function(){return(false===this.bufferingComplete);};xmp.QuicktimeStateMachine.prototype.startStateChangeMonitor=function(){if(!this.stateChangeMonitorTimer){this.stateChangeMonitorTimer=this.player.createTimer({object:this,id:"stateChange",interval:this.stateChangePollingInterval,handler:this.onStateChange,context:null});this.stateChangeMonitorTimer.start();}};xmp.QuicktimeStateMachine.prototype.stopStateChangeMonitor=function(){if(this.stateChangeMonitorTimer){this.stateChangeMonitorTimer.stop();this.stateChangeMonitorTimer=null;}};xmp.QuicktimeStateMachine.prototype.startConnectionTimeoutMonitor=function(){if(!this.connectionTimeoutTimer){this.connectionTimeoutTimer=this.player.createTimer({object:this,id:"connectionTimeout",interval:this.connectionTimeoutInterval,handler:this.onConnectionTimeout,context:null});this.connectionTimeoutTimer.start();}};xmp.QuicktimeStateMachine.prototype.stopConnectionTimeoutMonitor=function(){if(this.connectionTimeoutTimer){this.connectionTimeoutTimer.stop();this.connectionTimeoutTimer=null;}};xmp.QuicktimeStateMachine.prototype.initErrorCodes=function(){this.errorCodeDesc={};this.errorCodeDesc[100]="(Continue)";this.errorCodeDesc[101]="(Switching Protocols)";this.errorCodeDesc[200]="(OK)";this.errorCodeDesc[201]="(Created)";this.errorCodeDesc[202]="(Accepted)";this.errorCodeDesc[204]="(No Content)";this.errorCodeDesc[205]="(Reset Content)";this.errorCodeDesc[206]="(Partial Content)";this.errorCodeDesc[300]="(Multiple Choices)";this.errorCodeDesc[301]="(Moved Permanently)";this.errorCodeDesc[302]="(Found)";this.errorCodeDesc[303]="(See Other)";this.errorCodeDesc[304]="(Not Modified)";this.errorCodeDesc[305]="(Use Proxy)";this.errorCodeDesc[306]="(No Longer Used)";this.errorCodeDesc[307]="(Temporary Redirect)";this.errorCodeDesc[400]="(Bad Request)";this.errorCodeDesc[401]="(Not Authorised)";this.errorCodeDesc[402]="(Payment Required)";this.errorCodeDesc[403]="(Forbidden)";this.errorCodeDesc[404]="(Not Found)";this.errorCodeDesc[405]="(Method Not Allowed)";this.errorCodeDesc[406]="(Not Acceptable)";this.errorCodeDesc[407]="(Proxy Authentication Required)";this.errorCodeDesc[408]="(Request Timeout)";this.errorCodeDesc[409]="(Conflict)";this.errorCodeDesc[410]="(Gone)";this.errorCodeDesc[411]="(Length Required)";this.errorCodeDesc[412]="(Precondition Failed)";this.errorCodeDesc[413]="(Request Entity Too Large)";this.errorCodeDesc[414]="(Request URI Too Long)";this.errorCodeDesc[415]="(Unsupported Media Type)";this.errorCodeDesc[416]="(Requested Range Not Satisfiable)";this.errorCodeDesc[417]="(Expectation Failed)";this.errorCodeDesc[451]="(Parameter Not Understood)";this.errorCodeDesc[452]="(Conference Not Found)";this.errorCodeDesc[453]="(Not Enough Bandwidth)";this.errorCodeDesc[454]="(Session Not Founds)";this.errorCodeDesc[455]="(Method Not Valid In This State)";this.errorCodeDesc[456]="(Header Field Not Valid For Resource)";this.errorCodeDesc[457]="(Invalid Range)";this.errorCodeDesc[458]="(Parameter Is Read Only)";this.errorCodeDesc[459]="(Aggregate Operation Not Allowed)";this.errorCodeDesc[460]="(Only Aggregate Operation Allowed)";this.errorCodeDesc[461]="(Unsupported Transport)";this.errorCodeDesc[462]="(Destination Unreachable)";this.errorCodeDesc[500]="(Internal Server Error)";this.errorCodeDesc[501]="(Not Implemented)";this.errorCodeDesc[502]="(Bad Gateway)";this.errorCodeDesc[503]="(Service Unavailable)";this.errorCodeDesc[504]="(Gateway Timeout)";this.errorCodeDesc[505]="(HTTP Version Not Supported)";};xmp.QuicktimeStateMachine.prototype.getErrorCodeDesc=function(hd){var jd=((this.errorCodeDesc[hd])?this.errorCodeDesc[hd]:"(Unknown)");return hd+" "+jd;};xmp.QuicktimeStateMachine.prototype.getErrorCodes=function(kd){var ld=[];var md=kd.substring(kd.indexOf(":")+1);if(md.indexOf(xmp.QUICKTIME_ERROR_CODE_DELIMITER)===-1){ld.push(this.getErrorCodeDesc(parseInt(md,10)));}
else{while(md.length>0){var nd=md.indexOf(xmp.QUICKTIME_ERROR_CODE_DELIMITER);if(nd===-1){ld.push(this.getErrorCodeDesc(parseInt(md,10)));break;}
else{ld.push(this.getErrorCodeDesc(parseInt(md.substring(0,nd),10)));md=md.substring(nd+1);}}}
return ld;};xmp.QuicktimeStateMachine.prototype.initState=function(){this.opened=false;this.bufferingComplete=false;this.setState(xmp.INIT,false);this.startStateChangeMonitor();this.startConnectionTimeoutMonitor();};xmp.QuicktimeStateMachine.prototype.checkSetOpen=function(){if(false===this.opened&&this.getPosition()>0){this.onOpen("",xmp.OPEN);}};xmp.QuicktimeStateMachine.prototype.createConnectionError=function(od,pd,qd){var rd=[];if(od&&od.indexOf(xmp.QUICKTIME_ERROR)===0){rd.push({label:"QuickTime Error Codes",text:this.getErrorCodes(od).join(", ")});}
return new xmp.NativePlayerConnectionError(pd,qd,this.player,rd);};xmp.QuicktimeStateMachine.prototype.getRawDuration=function(){try{return this.player.getNative().GetDuration();}
catch(e){}
return 0;};xmp.QuicktimeStateMachine.prototype.getRawMaxTimeLoaded=function(){try{return this.player.getNative().GetMaxTimeLoaded();}
catch(e){}
return 0;};xmp.QuicktimeStateMachine.prototype.getRawBytesLoaded=function(){try{return this.player.getNative().GetMaxBytesLoaded();}
catch(e){}
return 0;};xmp.QuicktimeStateMachine.prototype.getRawBytesTotal=function(){try{return this.player.getNative().GetMovieSize();}
catch(e){}
return 0;};xmp.QuicktimeStateMachine.prototype.getRawPluginStatus=function(){try{return this.player.getNative().GetPluginStatus();}
catch(e){}
return null;};xmp.QuicktimeStateMachine.prototype.checkForStaticUrl=function(){if(this.staticUrl){this.staticUrl=null;return true;}
return false;};xmp.QuicktimeStateMachine.prototype.setError=function(sd,e){this.setState(xmp.ERRORS,false);this.player.setError(sd,e);};xmp.QuicktimeStateMachine.prototype.validateUrl=function(){try{var td=this.player.getNative().GetURL();if(!td){return false;}
return(td.length>0&&(td===this.url));}
catch(e){}
return false;};xmp.WINDOWS_MEDIA="WindowsMedia";xmp.WINDOWS_MEDIA_MIME_TYPE="video/x-ms-wmv";xmp.OPEN_STATE_CHANGE="OpenState";xmp.PLAY_STATE_CHANGE="PlayState";xmp.WINDOWS_MEDIA_ENDED=8;xmp.WINDOWS_MEDIA_PLAYING=3;xmp.WINDOWS_MEDIA_STOPPED=1;xmp.WINDOWS_MEDIA_CONNECTING=10;xmp.WINDOWS_MEDIA_LOADING=11;xmp.WINDOWS_MEDIA_OPEN=13;xmp.WINDOWS_MEDIA_ACTIVEX_PROGID="WMPlayer.OCX.7";xmp.WINDOWS_MEDIA_PLAYER_PLAY_STATE_CHANGE_METHOD="onPlayStateChange";xmp.WINDOWS_MEDIA_PLAYER_OPEN_STATE_CHANGE_METHOD="onOpenStateChange";xmp.WINDOWS_MEDIA_PLAYER_BUFFERING_METHOD="onBuffering";xmp.WINDOWS_MEDIA_PLAYER_TRIGGER_METHOD="onTrigger";xmp.WINDOWS_MEDIA_PLAYER_ERROR_METHOD="onError";xmp.WindowsMediaPlayer=function(ud,vd){xmp.WindowsMediaPlayer.ctor.call(this,xmp.WINDOWS_MEDIA,ud,vd);this.initCallbackStates();};xmp.DERIVE_CLASS(xmp.AbstractNativePlayer,xmp.WindowsMediaPlayer);xmp.WindowsMediaPlayer.prototype.open=function(wd){this.getNative().URL=wd.getURI();};xmp.WindowsMediaPlayer.prototype.close=function(){this.getNative().close();xmp.WindowsMediaPlayer.base.close.call(this);};xmp.WindowsMediaPlayer.prototype.play=function(){this.getNative().controls.play();xmp.WindowsMediaPlayer.base.play.call(this);this.setState(xmp.PLAY);};xmp.WindowsMediaPlayer.prototype.pause=function(){this.getNative().controls.pause();xmp.WindowsMediaPlayer.base.pause.call(this);this.setState(xmp.PAUSE);};xmp.WindowsMediaPlayer.prototype.stop=function(){this.getNative().controls.stop();xmp.WindowsMediaPlayer.base.stop.call(this);this.setState(xmp.STOP);};xmp.WindowsMediaPlayer.prototype.rewind=function(){this.getNative().controls.fastReverse();xmp.WindowsMediaPlayer.base.rewind.call(this);this.setState(xmp.REWIND);};xmp.WindowsMediaPlayer.prototype.fastForward=function(){this.getNative().controls.fastForward();xmp.WindowsMediaPlayer.base.fastForward.call(this);this.setState(xmp.FAST_FORWARD);};xmp.WindowsMediaPlayer.prototype.seek=function(xd){this.getNative().controls.currentPosition=xd;xmp.WindowsMediaPlayer.base.seek.call(this,xd);this.setState(xmp.SEEKABLE);};xmp.WindowsMediaPlayer.prototype.isAvailable=function(yd){if(yd===xmp.FULLSCREEN){return(true===this.isFullscreenEnabled()&&this.getNative().playState===xmp.WINDOWS_MEDIA_PLAYING);}
return this.getNative().controls.isAvailable(xmp.WindowsMediaUtility.getCommand([yd]));};xmp.WindowsMediaPlayer.prototype.onValidatePlugIn=function(zd){var Ad=this.getPlugInInfo(xmp.WINDOWS_MEDIA);try{var Bd=new ActiveXObject(xmp.WINDOWS_MEDIA_ACTIVEX_PROGID);this.validatePlugInVersion(xmp.WINDOWS_MEDIA,Bd.versionInfo);return;}
catch(e){if((e instanceof xmp.InvalidPlugInVersionError)||(e instanceof xmp.UnsupportedPlugInVersionError)){throw e;}}
throw new xmp.PlugInNotFoundError("Validating native player plugin.",Ad);};xmp.WindowsMediaPlayer.prototype.getPosition=function(){return this.getNative().controls.currentPosition;};xmp.WindowsMediaPlayer.prototype.getDuration=function(){var Cd=this.getNative().currentMedia;if(Cd===null){return 0;}
return Cd.duration;};xmp.WindowsMediaPlayer.prototype.getVolume=function(){return this.getNative().settings.volume;};xmp.WindowsMediaPlayer.prototype.setVolume=function(Dd){this.getNative().settings.volume=Dd;};xmp.WindowsMediaPlayer.prototype.getMute=function(){return this.getNative().settings.mute;};xmp.WindowsMediaPlayer.prototype.setMute=function(Ed){this.getNative().settings.mute=Ed;};xmp.WindowsMediaPlayer.prototype.getFullscreen=function(){return this.getNative().fullScreen;};xmp.WindowsMediaPlayer.prototype.setFullscreen=function(Fd){if(false===this.isFullscreenEnabled()){throw new xmp.NativePlayerUnsupportedError("Invoking \"setFullscreen\" method.","Fullscreen disabled.",this);}
this.getNative().fullScreen=Fd;};xmp.WindowsMediaPlayer.prototype.create=function(Gd){Gd.id=xmp.WINDOWS_MEDIA+Gd.group;xmp.WindowsMediaPlayer.base.create.call(this,Gd);if(Gd.viewport.getType()!==xmp.DHTML_VIEWPORT){throw new xmp.InvalidNativePlayerViewportError("Creating native player.","Invalid native player viewport \""+Gd.viewport.getType()+"\".  Supported viewports:  DHTML",this);}
var Hd=Gd.viewport.getNative();Hd.innerHTML="<object id='"+Gd.id+"' width='"+Hd.style.width+"' height='"+Hd.style.height+"' style='background-color:  #000000; z-index: "+xmp.NATIVE_PLAYER_Z_INDEX+"' classid='clsid:6BF52A52-394A-11d3-B153-00C04F79FAA6'>"+"<param name='uiMode' value='none' />"+"<param name='stretchToFit' value='"+((true===Gd.stretchToFit)?xmp.TRUE:xmp.FALSE)+"' />"+"<param name='enableContextMenu' value='false' />"+"<param name='windowlessVideo' value='"+((true===this.isFullscreenEnabled())?xmp.FALSE:xmp.TRUE)+"' />"+"<param name='volume' value='"+Gd.volume+"'/>"+"<param name='mute' value='"+((true===Gd.mute)?xmp.TRUE:xmp.FALSE)+"'/></object>"+"<script language = 'jscript' for='"+Gd.id+"' event=playstatechange(newstate)>"+this.getCallbackMethod(xmp.WINDOWS_MEDIA_PLAYER_PLAY_STATE_CHANGE_METHOD)+"(newstate);</script>"+"<script language = 'jscript' for='"+Gd.id+"' event=openstatechange(newstate)>"+this.getCallbackMethod(xmp.WINDOWS_MEDIA_PLAYER_OPEN_STATE_CHANGE_METHOD)+"(newstate);</script>"+"<script language = 'jscript' for='"+Gd.id+"' event=buffering(start)>"+this.getCallbackMethod(xmp.WINDOWS_MEDIA_PLAYER_BUFFERING_METHOD)+"(start);</script>"+"<script language = 'jscript' for='"+Gd.id+"' event='scriptcommand(name, data)'>"+this.getCallbackMethod(xmp.WINDOWS_MEDIA_PLAYER_TRIGGER_METHOD)+"(name, data);</script>"+"<script language = 'jscript' for='"+Gd.id+"' event=error()>"+this.getCallbackMethod(xmp.WINDOWS_MEDIA_PLAYER_ERROR_METHOD)+"();</script>";this.setCreated();};xmp.WindowsMediaPlayer.prototype.initCallbackStates=function(){this.callbackStates={};this.callbackStates[xmp.PLAY_STATE_CHANGE]=[{state:xmp.WINDOWS_MEDIA_PLAYING,player_state:xmp.PLAY},{state:xmp.WINDOWS_MEDIA_ENDED,player_state:xmp.ENDED}];this.callbackStates[xmp.OPEN_STATE_CHANGE]=[{state:xmp.WINDOWS_MEDIA_CONNECTING,player_state:xmp.CONNECTING},{state:xmp.WINDOWS_MEDIA_LOADING,player_state:xmp.CONNECTED},{state:xmp.WINDOWS_MEDIA_OPEN,player_state:xmp.OPEN}];};xmp.WindowsMediaPlayer.prototype.translateState=function(Id,Jd){var Kd=this.callbackStates[Id];for(var i=0;i<Kd.length;i++){if(Jd===Kd[i].state){return Kd[i].player_state;}}
return"";};xmp.WindowsMediaPlayer.prototype.onPlayStateChange=function(Ld){try{if(Ld===xmp.WINDOWS_MEDIA_STOPPED){this.getLogger().warn("Play state changed to \"Stopped\".");}
var Md=this.translateState(xmp.PLAY_STATE_CHANGE,Ld);if(Md.length>0){this.setState(Md);}}
catch(e){this.setError("Handling play state change.",e);}};xmp.WindowsMediaPlayer.prototype.onOpenStateChange=function(Nd){try{var Od=this.translateState(xmp.OPEN_STATE_CHANGE,Nd);if(Od.length>0){this.setState(Od);}}
catch(e){this.setError("Handling open state change.",e);}};xmp.WindowsMediaPlayer.prototype.onBuffering=function(Pd){try{var Qd=((true===Pd)?this.getNative().network.bufferingProgress:100);this.setState(xmp.BUFFERING,{percent:Qd,bytesDownloaded:0,bytesTotal:0});if(100===Qd){this.setState(xmp.FIRST_FRAME_RENDERED);}}
catch(e){this.setError("Handling buffering.",e);}};xmp.WindowsMediaPlayer.prototype.onTrigger=function(Rd,Sd){try{this.setTrigger(Rd,Sd);}
catch(e){this.setError("Handling trigger.",e);}};xmp.WindowsMediaPlayer.prototype.onError=function(){try{var Td=null;var Ud=this.getNative().Error.item(0).errorCode;var Vd=this.getNative().Error.item(0).errorDescription;var Wd=[{label:"Windows Media Error Code",text:xmp.WindowsMediaUtility.getErrorCodeDesc(Ud)}];if(true===xmp.WindowsMediaUtility.isConnectionError(Ud)){Td=new xmp.NativePlayerConnectionError("Connecting to media.",Vd,this,Wd);}
else{Td=new xmp.NativePlayerError("Handling error.",Vd,this,Wd);}
this.setError(null,Td);}
catch(e){this.setError("Handling error.",e);}};xmp.WINDOWS_MEDIA_PLUGIN="WindowsMediaPlugIn";xmp.WINDOWS_MEDIA_PLUGIN_CONNECTING="1";xmp.WINDOWS_MEDIA_PLUGIN_CONNECTED="2";xmp.WINDOWS_MEDIA_PLUGIN_OPEN="3";xmp.WINDOWS_MEDIA_PLUGIN_ENDED="4";xmp.WINDOWS_MEDIA_PLUGIN_BUFFERING="5";xmp.WINDOWS_MEDIA_PLUGIN_PLAYING="6";xmp.WINDOW_MEDIA_PLUGIN_STATE_CHANGE_METHOD="onStateChange";xmp.WINDOW_MEDIA_PLUGIN_ERROR_METHOD="onError";xmp.WINDOW_MEDIA_PLUGIN_TRIGGER_METHOD="onTrigger";xmp.WINDOWS_MEDIA_PLUGIN_MIME_TYPE="video/x-turner-wmv";xmp.TURNER_MEDIA_PLUGIN_NAME="Turner Media Plugin";xmp.TURNER_MEDIA_PLUGIN="TurnerMedia";xmp.WindowsMediaPlugInPlayer=function(Xd,Yd){xmp.WindowsMediaPlugInPlayer.ctor.call(this,xmp.WINDOWS_MEDIA_PLUGIN,Xd,Yd);this.initCallbackStates();};xmp.DERIVE_CLASS(xmp.AbstractNativePlayer,xmp.WindowsMediaPlugInPlayer);xmp.WindowsMediaPlugInPlayer.prototype.open=function(Zd){this.setState(xmp.CONNECTING);this.getNative().url=Zd.getURI();};xmp.WindowsMediaPlugInPlayer.prototype.close=function(){this.getNative().close();xmp.WindowsMediaPlugInPlayer.base.close.call(this);};xmp.WindowsMediaPlugInPlayer.prototype.play=function(){this.getNative().play();xmp.WindowsMediaPlugInPlayer.base.play.call(this);this.setState(xmp.PLAY);};xmp.WindowsMediaPlugInPlayer.prototype.pause=function(){this.getNative().pause();xmp.WindowsMediaPlugInPlayer.base.pause.call(this);this.setState(xmp.PAUSE);};xmp.WindowsMediaPlugInPlayer.prototype.stop=function(){this.getNative().stop();xmp.WindowsMediaPlugInPlayer.base.stop.call(this);this.setState(xmp.STOP);};xmp.WindowsMediaPlugInPlayer.prototype.rewind=function(){this.getNative().rewind();xmp.WindowsMediaPlugInPlayer.base.rewind.call(this);this.setState(xmp.REWIND);};xmp.WindowsMediaPlugInPlayer.prototype.fastForward=function(){this.getNative().fastForward();xmp.WindowsMediaPlugInPlayer.base.rewind.call(this);this.setState(xmp.FAST_FORWARD);};xmp.WindowsMediaPlugInPlayer.prototype.seek=function($d){this.getNative().seek($d);xmp.WindowsMediaPlugInPlayer.base.rewind.call(this);this.setState(xmp.SEEKABLE);};xmp.WindowsMediaPlugInPlayer.prototype.isAvailable=function(ae){return this.getNative().isAvailable(xmp.WindowsMediaUtility.getCommand([ae]));};xmp.WindowsMediaPlugInPlayer.prototype.onValidatePlugIn=function(be){var ce=this.getPlugInInfo(xmp.TURNER_MEDIA_PLUGIN);var de=navigator.mimeTypes[xmp.WINDOWS_MEDIA_PLUGIN_MIME_TYPE];if(!de){throw new xmp.PlugInNotFoundError("Validating native player plugin.",ce);}
if(!de.enabledPlugin){throw new xmp.PlugInDisabledError("Validating native player plugin.",ce,xmp.WINDOWS_MEDIA_PLUGIN_MIME_TYPE);}
var ee=de.enabledPlugin.name;if(ee.indexOf(xmp.TURNER_MEDIA_PLUGIN_NAME)===-1){throw new xmp.PlugInDisabledError("Validating native player plugin.",ce,xmp.WINDOWS_MEDIA_PLUGIN_MIME_TYPE);}
var fe=this.getVersionFromString(xmp.MOZILLA_VERSION_DETECTION_JSON,ee);this.validatePlugInVersion(xmp.TURNER_MEDIA_PLUGIN,fe);};xmp.WindowsMediaPlugInPlayer.prototype.getPosition=function(){return this.getNative().position;};xmp.WindowsMediaPlugInPlayer.prototype.getDuration=function(){return this.getNative().duration;};xmp.WindowsMediaPlugInPlayer.prototype.getVolume=function(){return this.getNative().volume;};xmp.WindowsMediaPlugInPlayer.prototype.setVolume=function(ge){this.getNative().volume=Math.floor(ge);};xmp.WindowsMediaPlugInPlayer.prototype.getMute=function(){return this.getNative().mute;};xmp.WindowsMediaPlugInPlayer.prototype.setMute=function(he){this.getNative().mute=he;};xmp.WindowsMediaPlugInPlayer.prototype.getFullscreen=function(){return this.getNative().fullscreen;};xmp.WindowsMediaPlugInPlayer.prototype.setFullscreen=function(ie){this.getNative().fullscreen=ie;};xmp.WindowsMediaPlugInPlayer.prototype.create=function(je){je.id=xmp.WINDOWS_MEDIA_PLUGIN+je.group;xmp.WindowsMediaPlugInPlayer.base.create.call(this,je);if(je.viewport.getType()!==xmp.DHTML_VIEWPORT){throw new xmp.InvalidNativePlayerViewportError("Creating native player.","Invalid native player viewport \""+je.viewport.getType()+"\".  Supported viewports:  DHTML",this);}
var ke=je.viewport.getNative();ke.innerHTML="<embed id='"+je.id+"' type='"+xmp.WINDOWS_MEDIA_PLUGIN_MIME_TYPE+"' statechangecallback='"+this.createCallbackMethod(xmp.WINDOW_MEDIA_PLUGIN_STATE_CHANGE_METHOD)+"' errorcallback='"+this.createCallbackMethod(xmp.WINDOW_MEDIA_PLUGIN_ERROR_METHOD)+"' triggercallback='"+this.createCallbackMethod(xmp.WINDOW_MEDIA_PLUGIN_TRIGGER_METHOD)+"' "+"fullscreenenabled='"+((true===this.isFullscreenEnabled())?xmp.TRUE:xmp.FALSE)+"' uimode='none' stretchtofit='"+((true===je.stretchToFit)?xmp.TRUE:xmp.FALSE)+"' windowlessvideo='true'"+"' volume='"+je.volume+"' mute='"+((true===je.mute)?xmp.TRUE:xmp.FALSE)+"' enablecontextmenu='false' width='"+ke.style.width+"' height='"+ke.style.height+"' style='background-color:  #000000; z-index: "+xmp.NATIVE_PLAYER_Z_INDEX+"' />";this.setCreated();};xmp.WindowsMediaPlugInPlayer.prototype.initCallbackStates=function(){this.callbackStates={};this.callbackStates[xmp.WINDOWS_MEDIA_PLUGIN_CONNECTING]=xmp.CONNECTING;this.callbackStates[xmp.WINDOWS_MEDIA_PLUGIN_CONNECTED]=xmp.CONNECTED;this.callbackStates[xmp.WINDOWS_MEDIA_PLUGIN_OPEN]=xmp.OPEN;this.callbackStates[xmp.WINDOWS_MEDIA_PLUGIN_ENDED]=xmp.ENDED;this.callbackStates[xmp.WINDOWS_MEDIA_PLUGIN_BUFFERING]=xmp.BUFFERING;this.callbackStates[xmp.WINDOWS_MEDIA_PLUGIN_PLAYING]=xmp.PLAY;};xmp.WindowsMediaPlugInPlayer.prototype.translateState=function(le){var me=this.callbackStates[le];return((me)?me:"");};xmp.WindowsMediaPlugInPlayer.prototype.onStateChange=function(ne,oe){try{var pe=this.translateState(ne);if(pe.length>0){var qe=((pe===xmp.BUFFERING)?{percent:parseInt(oe,10),bytesDownloaded:0,bytesTotal:0}:null);this.setState(pe,qe);if(pe===xmp.BUFFERING&&100===qe.percent){this.setState(xmp.FIRST_FRAME_RENDERED);}}}
catch(e){this.setError("Handling state change.",e);}};xmp.WindowsMediaPlugInPlayer.prototype.onError=function(re,se){try{var te=null;var ue=parseInt(se,10);var ve=[{label:"Windows Media Error Code",text:xmp.WindowsMediaUtility.getErrorCodeDesc(ue)}];if(true===xmp.WindowsMediaUtility.isConnectionError(ue)){te=new xmp.NativePlayerConnectionError("Connecting to media.",re,this,ve);}
else{te=new xmp.NativePlayerError("Handling error.",re,this,ve);}
this.setError(null,te);}
catch(e){this.setError("Handling error.",e);}};xmp.WindowsMediaPlugInPlayer.prototype.onTrigger=function(we,xe){try{this.setTrigger(we,xe);}
catch(e){this.setError("Handling trigger.",e);}};xmp.WindowsMediaPlugInPlayer.prototype.createCallbackMethod=function(ye){return xmp.escapeHtml(this.getCallbackMethod(ye),false,false);};xmp.WindowsMediaUtility=function(){xmp.WINDOWS_MEDIA_PLAY="play";xmp.WINDOWS_MEDIA_PAUSE="pause";xmp.WINDOWS_MEDIA_STOP="stop";xmp.WINDOWS_MEDIA_REWIND="fastReverse";xmp.WINDOWS_MEDIA_FAST_FORWARD="fastForward";xmp.WINDOWS_MEDIA_SEEK="currentPosition";return{getCommand:function(ze){if(!this.commands){this.commands={};this.commands[xmp.PLAY]=xmp.WINDOWS_MEDIA_PLAY;this.commands[xmp.PAUSE]=xmp.WINDOWS_MEDIA_PAUSE;this.commands[xmp.STOP]=xmp.WINDOWS_MEDIA_STOP;this.commands[xmp.REWIND]=xmp.WINDOWS_MEDIA_REWIND;this.commands[xmp.FAST_FORWARD]=xmp.WINDOWS_MEDIA_FAST_FORWARD;this.commands[xmp.SEEKABLE]=xmp.WINDOWS_MEDIA_SEEK;this.commands[xmp.FULLSCREEN]=xmp.FULLSCREEN.toLowerCase();}
return this.commands[ze];},getErrorCodeDesc:function(Ae){this.initConnectionErrorCodes();return((this.connectionErrorCodes[Ae])?this.connectionErrorCodes[Ae]:Ae);},isConnectionError:function(Be){this.initConnectionErrorCodes();return((this.connectionErrorCodes[Be])?true:false);},initConnectionErrorCodes:function(){if(!this.connectionErrorCodes){this.connectionErrorCodes={};this.connectionErrorCodes[-1072885352]="NS_E_WMP_SERVER_INACCESSIBLE (0xC00D1198)";this.connectionErrorCodes[-1072885353]="NS_E_WMP_CANNOT_FIND_FILE (0xC00D1197)";this.connectionErrorCodes[-1072885325]="NS_E_WMP_SERVER_NOT_RESPONDING (0xC00D11B3)";this.connectionErrorCodes[-1072885328]="NS_E_WMP_SERVER_UNAVAILABLE (0xC00D11B0)";this.connectionErrorCodes[-1072885322]="NS_E_WMP_NETWORK_FIREWALL (0xC00D11B6)";this.connectionErrorCodes[-1072885320]="NS_E_WMP_PROXY_CONNECT_TIMEOUT (0xC00D11B8)";this.connectionErrorCodes[-1072885312]="NS_E_WMP_NETWORK_ERROR (0xC00D11C0)";this.connectionErrorCodes[-1072885311]="NS_E_WMP_CONNECT_TIMEOUT (0xC00D11C1)";this.connectionErrorCodes[-1072885309]="NS_E_WMP_SERVER_DNS_TIMEOUT (0xC00D11C3)";this.connectionErrorCodes[-1072885308]="NS_E_WMP_PROXY_NOT_FOUND (0xC00D11C4)";}}};}();