// Turner XMP, Release Build, © 2007 Turner Broadcasting System, Inc. A Time Warner Company.  File: xmp_playerapi_native, Version: 0.1.555.2010

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_TRANSPARENCY="wmode";xmp.ALLOW_FULLSCREEN_ACCESS="allowFullScreen";xmp.ALWAYS_ACCESS="always";xmp.QUALITY="quality";xmp.QUALITY_HIGH="high";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=La.split(" ");var Na=Ma[2].split(".");var Oa=Na[0];var Pa=Na[1];var Qa=Ma[3];if(Qa===""){Qa=Ma[4];}
if(Qa[0]==="d"){Qa=Qa.substring(1);}else if(Qa[0]==="r"){Qa=Qa.substring(1);if(Qa.indexOf("d")>0){Qa=Qa.substring(0,Qa.indexOf("d"));}}
var Ra=Oa+"."+Pa+"."+Qa;return Ra;}
return"";};xmp.FlashPlayer.prototype.create=function(Sa){if(true===this.attach(Sa)){return;}
Sa.id=xmp.FLASH+Sa.group;xmp.FlashPlayer.base.create.call(this,Sa);var Ta=Sa.viewport.getNative();var Ua=new SWFObject(xmp.makeSWFPath(xmp.FLASH_PLAYER_SWF_BASE_NAME,true),Sa.id,Ta.style.width,Ta.style.height,xmp.FLASH_VERSION,xmp.BLACK_BACKGROUND_COLOR);Ua.addParam(xmp.ALLOW_SCRIPT_ACCESS,xmp.ALWAYS_ACCESS);Ua.addParam(xmp.QUALITY,xmp.QUALITY_HIGH);Ua.addParam(xmp.ALLOW_TRANSPARENCY,"transparent");Ua.addParam(xmp.ALLOW_FULLSCREEN_ACCESS,xmp.TRUE);Ua.addVariable(xmp.FLASH_BUFFER_TIME,this.getConfigProperty(xmp.FLASH_BUFFER_TIME_CONFIG));Ua.addVariable(xmp.FLASH_STREAMING_VIDEO_ADAPTER,this.getConfigProperty(xmp.FLASH_STREAMING_VIDEO_ADAPTER_CONFIG));Ua.addVariable(xmp.FLASH_FULLSCREEN_ENABLED,((true===this.isFullscreenEnabled())?xmp.TRUE:xmp.FALSE));Ua.addVariable(xmp.FLASH_INITIALIZATION_CALLBACK,this.getCallbackMethod(xmp.FLASH_PLAYER_INITIALIZATION_METHOD));Ua.addVariable(xmp.FLASH_STATE_CHANGE_CALLBACK,this.getCallbackMethod(xmp.FLASH_PLAYER_STATE_CHANGE_METHOD));Ua.addVariable(xmp.FLASH_TRIGGER_CALLBACK,this.getCallbackMethod(xmp.FLASH_PLAYER_TRIGGER_METHOD));Ua.addVariable(xmp.FLASH_STATE_EXECUTE_COMMAND_CALLBACK,this.getCallbackMethod(xmp.FLASH_PLAYER_EXECUTE_COMMAND_METHOD));Ua.addVariable(xmp.FLASH_ERROR_CALLBACK,this.getCallbackMethod(xmp.FLASH_PLAYER_ERROR_METHOD));Ua.addVariable(xmp.VOLUME,Sa.volume);Ua.addVariable(xmp.MUTE,((true===Sa.mute)?xmp.TRUE:xmp.FALSE));Ua.write(Ta.id);};xmp.FlashPlayer.prototype.attach=function(Va){Va.id=Va.viewport.getName();xmp.FlashPlayer.base.attach.call(this,Va);if(Va.viewport.getType()!==xmp.DHTML_VIEWPORT&&Va.viewport.getType()!==xmp.FLASH_VIEWPORT){throw new xmp.InvalidNativePlayerViewportError("Creating native player.","Invalid native player viewport \""+Va.viewport.getType()+"\".  Supported viewports:  DHTML, Flash",this);}
if(Va.viewport.getType()!==xmp.FLASH_VIEWPORT){return false;}
var Wa=[{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:Va.volume},{name:xmp.MUTE,value:((true===Va.mute)?xmp.TRUE:xmp.FALSE)}];var Xa=Wa.length;for(var i=0;i<Xa;i++){var Ya=Wa[i];this.getNative().SetVariable(Ya.name,Ya.value);}
this.setCreated();return true;};xmp.FlashPlayer.prototype.translateState=function(Za){return Za;};xmp.FlashPlayer.prototype.getActiveXVersion=function($a){var ab=$a.GetVariable(xmp.FLASH_VERSION_VARIABLE);var bb=ab.split(" ")[1];return bb.replace(/,/g,xmp.VERSION_DELIMITER);};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(cb,db){try{var eb=this.translateState(cb);if(eb.length>0){this.setState(eb,db);}}
catch(e){this.setError("Handling state change.",e);}};xmp.FlashPlayer.prototype.onTrigger=function(fb,gb){try{this.setTrigger(fb,gb);}
catch(e){this.setError("Handling trigger.",e);}};xmp.FlashPlayer.prototype.onExecuteCommand=function(hb,ib){var jb=null;try{jb=xmp.FlashPlayer.base.executeCommand.call(this,hb,ib);}
catch(e){this.setError("Execute command.",e);}
return jb;};xmp.FlashPlayer.prototype.onError=function(kb,lb,mb){try{var nb=[{label:"Flash Error Type",text:kb}];if(mb){nb.push({label:"Flash Error Code",text:mb});}
var ob=((kb===xmp.FLASH_CONNECTION_ERROR)?new xmp.NativePlayerConnectionError("Connecting to media.",lb,this,nb):new xmp.NativePlayerError("Handling error.",lb,this,nb));this.setError(null,ob);}
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(pb,qb){xmp.ImagePlayer.ctor.call(this,xmp.IMAGE_PLAYER,pb,qb);};xmp.DERIVE_CLASS(xmp.AbstractNativePlayer,xmp.ImagePlayer);xmp.ImagePlayer.prototype.open=function(rb){this.url=rb.getURI();this.timeLimit=rb.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(sb){return(sb===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(tb){if(true===this.attach(tb)){return;}
tb.id=xmp.IMAGE_PLAYER+tb.group;xmp.ImagePlayer.base.create.call(this,tb);this.volume=tb.volume;this.mute=tb.mute;var ub=tb.viewport.getNative();ub.innerHTML="<img style='background-color:  #000000' id='"+tb.id+"' width='"+(ub.style.width)+"' height='"+(ub.style.height)+"' src='"+tb.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(vb,wb){this.position++;};xmp.ImagePlayer.prototype.attach=function(xb){xb.id=xb.viewport.getName();this.volume=xb.volume;this.mute=xb.mute;xmp.ImagePlayer.base.attach.call(this,xb);if(xb.viewport.getType()!==xmp.DHTML_VIEWPORT&&xb.viewport.getType()!==xmp.FLASH_VIEWPORT){throw new xmp.InvalidNativePlayerViewportError("Creating native player.","Invalid native player viewport \""+xb.viewport.getType()+"\".  Supported viewports:  DHTML,  Flash",this);}
if(xb.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,xb.group);this.setCreated();return true;};xmp.ImagePlayer.prototype.isDHTML=function(){return(this.getNative().tagName.toUpperCase()===xmp.IMAGE_TAG);};xmp.ImagePlayer.prototype.createCallbackMethod=function(yb){return this.getCallbackMethod(yb).replace(/\'/g,"\"");};xmp.ImagePlayer.prototype.translateState=function(zb){return zb;};xmp.ImagePlayer.prototype.onInit=function(){try{this.setCreated();}
catch(e){this.setError("Initializing.",e);}};xmp.ImagePlayer.prototype.onStateChange=function(Ab,Bb){try{var Cb=this.translateState(Ab);if(Cb.length>0){this.setState(Cb,Bb);}}
catch(e){this.setError("Handling state change.",e);}};xmp.ImagePlayer.prototype.onError=function(Db,Eb,Fb){try{var Gb=null;if(true===this.isDHTML()){Gb=new xmp.NativePlayerConnectionError("Connecting to media.","Unable to connect to \""+this.getNative().src+"\"",this);}
else{var Hb=[{label:"Flash Error Type",text:Db}];if(Fb){Hb.push({label:"Flash Error Code",text:Fb});}
Gb=((Db===xmp.FLASH_CONNECTION_ERROR)?new xmp.NativePlayerConnectionError("Connecting to media.",Eb,this,Hb):new xmp.NativePlayerError("Handling error.",Eb,this,Hb));}
this.setError(null,Gb);}
catch(e){this.setError("Handling error.",e);}};xmp.MOCK_NATIVE="MOCK_NATIVE";xmp.MOCK_MIME_TYPE="application/xmp-mock";xmp.MockNativePlayer=function(Ib,Jb){xmp.MockNativePlayer.ctor.call(this,xmp.MOCK_NATIVE,Ib,Jb);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(Kb){this.node=Kb;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(Lb,Mb){xmp.MockNativePlayer.base.onSetState.call(this,Lb,Mb);var Nb=Lb.getMetadata(xmp.CONTEXT,{});if(Nb.type===xmp.PLAY){this.simulatePlay();}};xmp.MockNativePlayer.prototype.play=function(){this.setState(xmp.PLAY);};xmp.MockNativePlayer.prototype.simulatePlay=function(){var Ob=this.node;this.logger.info("play(): "+Ob.getURI());this.logger.info("Node type: "+Ob.getNodeTypeName());this.playInstance++;var Pb=this.createTimer({object:this,id:"position change",interval:this.realTimePositionChangeInterval,handler:this.onSimulatedPositionChange,context:this.playInstance});Pb.start();this.startMonitor();};xmp.MockNativePlayer.prototype.onSimulatedPositionChange=function(Qb,Rb){var Sb=this.node;var Tb=Qb.getMetadata(xmp.CONTEXT,-1);if(!Sb||Tb!==this.playInstance){Rb.stop();}
else if(this.position>=this.duration){Rb.stop();this.stopMonitor();this.setState(xmp.ENDED);}
else{this.position+=this.positionChangeInterval;}};xmp.MockNativePlayer.prototype._getDuration=function(){var Ub=-1;var Vb=this.node;if(Vb.isContentType()||Vb.isAdType()){var Wb=Vb.getPlayableData();Ub=Wb.getTotalRunTime();}
if(Ub<=0){Ub=3;}
return Ub;};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(Xb){if(this.node!==null){this.logger.info("seek(): "+this.node.getURI()+" to "+Xb);}
xmp.MockNativePlayer.base.seek.call(this);this.setPosition(Xb);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(Yb){return true;};xmp.MockNativePlayer.prototype.getPosition=function(){return this.position;};xmp.MockNativePlayer.prototype.getDuration=function(){return this.duration;};xmp.MockNativePlayer.prototype.validate=function(Zb){};xmp.MockNativePlayer.prototype.onValidatePlugIn=function($b){};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(ac,bc){return this.listener.onNativePlayerExecuteCommand(ac,bc);};xmp.MockNativePlayer.prototype.create=function(cc){this.data=cc;};xmp.MockNativePlayer.prototype.attach=function(dc){this.data=dc;};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.QuickTimePlayer=function(ec,fc){this.state=new xmp.QuicktimeStateMachine(this);xmp.QuickTimePlayer.ctor.call(this,xmp.QUICKTIME,ec,fc);};xmp.DERIVE_CLASS(xmp.AbstractNativePlayer,xmp.QuickTimePlayer);xmp.QuickTimePlayer.prototype.open=function(gc){this.state.open(gc);};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(hc){xmp.QuickTimePlayer.base.seek.call(this,hc);this.state.seek(hc);};xmp.QuickTimePlayer.prototype.ended=function(){xmp.QuickTimePlayer.base.ended.call(this);this.state.ended();};xmp.QuickTimePlayer.prototype.isAvailable=function(ic){return this.state.isAvailable(ic);};xmp.QuickTimePlayer.prototype.onValidatePlugIn=function(jc){this.validateQuicktime();if(jc.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(kc){this.state.setVolume(kc);};xmp.QuickTimePlayer.prototype.getMute=function(){return this.state.getMute();};xmp.QuickTimePlayer.prototype.setMute=function(lc){this.state.setMute(lc);};xmp.QuickTimePlayer.prototype.create=function(mc){mc.id=xmp.QUICKTIME+mc.group;xmp.QuickTimePlayer.base.create.call(this,mc);if(mc.viewport.getType()!==xmp.DHTML_VIEWPORT){throw new xmp.InvalidNativePlayerViewportError("Creating native player.","Invalid native player viewport \""+mc.viewport.getType()+"\".  Supported viewports:  DHTML",this);}
var nc=mc.viewport.getNative();if(true===xmp.isIEBrowser()){nc.innerHTML="<object id='"+mc.id+"' width='"+nc.style.width+"' height='"+nc.style.height+"' classid='clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B'"+" style='background-color:  #000000; z-index: "+xmp.NATIVE_PLAYER_Z_INDEX+"' >"+"<param name='src' value='"+mc.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===mc.stretchToFit)?"TOFIT":"ASPECT")+"' />"+"<param name='loop' value='false' />"+"<param name='kioskmode' value='true' /></object>";}
else{nc.innerHTML="<embed type='video/quicktime' name='"+mc.id+"' width='"+nc.style.width+"' height='"+nc.style.height+"' src='"+mc.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===mc.stretchToFit)?"TOFIT":"ASPECT")+"' loop='false' kioskmode='true'></embed>";}
this.state.create(mc);this.setCreated();};xmp.QuickTimePlayer.prototype.validateQuicktime=function(){var oc=this.getPlugInInfo(xmp.QUICKTIME);var pc="0.0.0.0";if(true===xmp.isIEBrowser()){try{var qc=new ActiveXObject(xmp.QUICKTIME_VERSION_CHECK_PROGID);var rc=qc.QuickTimeVersion.toString(16);pc=rc.substr(0,1)+"."+rc.substr(1,1)+"."+rc.substr(2,1)+"."+rc.substr(3);}
catch(e){throw new xmp.PlugInNotFoundError("Validating native player plugin.",oc);}
this.validatePlugInVersion(xmp.QUICKTIME,pc);}
else{var sc=navigator.mimeTypes[xmp.QUICKTIME_MIME_TYPE];if(!sc){throw new xmp.PlugInNotFoundError("Validating native player plugin.",oc);}
if(!sc.enabledPlugin){throw new xmp.PlugInDisabledError("Validating native player plugin.",oc,xmp.QUICKTIME_MIME_TYPE);}
var tc=sc.enabledPlugin.name;if(tc.indexOf(xmp.QUICKTIME)===-1){throw new xmp.PlugInDisabledError("Validating native player plugin.",oc,xmp.QUICKTIME_MIME_TYPE);}
pc=tc.split(" ")[2];this.validatePlugInVersion(xmp.QUICKTIME,pc);}};xmp.QuickTimePlayer.prototype.validateFlip4Mac=function(){var uc;var vc=this.getPlugInInfo(xmp.FLIP4MAC);var wc=navigator.plugins.length;for(var i=0;i<wc;i++){var xc=navigator.plugins[i];uc=xc.name;var yc=uc.length;if(uc.indexOf(xmp.FLIP4MAC)!==-1){var zc=uc.split(" ")[4];this.validatePlugInVersion(xmp.FLIP4MAC,zc);return;}}
throw new xmp.PlugInNotFoundError("Validating native player plugin.",vc);};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(Ac){this.player=Ac;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(Bc){if(false===this.checkForStaticUrl()){this.initState();this.url=Bc.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(Cc){this.player.getNative().SetRate(xmp.QUICKTIME_NORMAL_RATE);this.player.getNative().SetTime(Cc*this.player.getNative().GetTimeScale());this.setState(xmp.SEEKABLE,true);};xmp.QuicktimeStateMachine.prototype.ended=function(){this.setState(xmp.ENDED,false);};xmp.QuicktimeStateMachine.prototype.isAvailable=function(Dc){var Ec=this.operations[this.state];for(var Fc=xmp.MapIterator.create(Ec);Fc.hasNext();Fc.next()){var Gc=Fc.currentValue();if(Gc.state===Dc){if(false===this.live){return true;}
else{return(true===Gc.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 Hc=this.live;var Ic=this.player.getNative().GetDuration();if(true===this.isInitializing()){Hc=this.isLive(Ic);}
return((true===Hc||Ic===0)?0:Math.floor(Ic/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(Jc){this.player.getNative().SetVolume(Math.floor(((Jc.toFixed(1)+1)*0.01)*xmp.QUICKTIME_VOLUME_MAX));this.volume=Jc;this.muted=this.getMute();};xmp.QuicktimeStateMachine.prototype.getMute=function(){var Kc=this.player.getNative().GetMute();return(Kc===true||Kc===1);};xmp.QuicktimeStateMachine.prototype.setMute=function(Lc){this.player.getNative().SetMute(Lc);this.muted=Lc;this.volume=Math.floor(((this.player.getNative().GetVolume()+1)/xmp.QUICKTIME_VOLUME_MAX)*100);};xmp.QuicktimeStateMachine.prototype.create=function(Mc){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=Mc.node.getURI();this.staticUrl=this.url;this.volume=Mc.volume;this.muted=Mc.muted;this.initState();};xmp.QuicktimeStateMachine.prototype.onStateChange=function(Nc,Oc){try{if(this.state===xmp.ERRORS){return;}
if(true===this.canGetPluginStatus()){var Pc=this.getRawPluginStatus();if(!Pc){return;}
var Qc=this.translateState(Pc);if(Qc.length>0){if(false===this.stateHandlers[Qc].apply(this,[Pc,Qc])){return;}}}
if(false===this.isInitializing()){var Rc=this.getPosition();if(this.state!==xmp.ENDED&&Rc>0&&(Rc>=this.getDuration())&&false===this.live){this.setState(xmp.ENDED,true);}}}
catch(e){this.setError(null,e);}};xmp.QuicktimeStateMachine.prototype.onConnectionTimeout=function(Sc,Tc){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(Uc){if(Uc.indexOf(xmp.QUICKTIME_ERROR)===-1&&false===this.validateUrl()){return"";}
for(var i=0;i<this.transitionTable.length;i++){var Vc=this.transitionTable[i];if(Uc.indexOf(Vc.nativeState)===0){if(0===Vc.currentState.length){return Vc.transitionState;}
else{for(var j=0;j<Vc.currentState.length;j++){if(this.state===Vc.currentState[j]){return Vc.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(Wc,Xc,Yc){this.state=Wc;if(true===Xc){var Zc=((Wc===xmp.QUICKTIME_LOAD_BUFFERING||Wc===xmp.QUICKTIME_WAIT_BUFFERING||Wc===xmp.QUICKTIME_BUFFERING_COMPLETE)?xmp.BUFFERING:Wc);this.player.setState(Zc,Yc);}};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($c,ad){this.opened=false;var bd="Unknown error.";if(true===this.isInitializing()){bd="Error connecting to \""+this.url+"\".";}
this.setError(null,this.createConnectionError($c,"Connecting to media.",bd));return false;};xmp.QuicktimeStateMachine.prototype.onConnected=function(cd,dd){this.player.startMonitor();this.setState(xmp.CONNECTED,true);return true;};xmp.QuicktimeStateMachine.prototype.onConnecting=function(ed,fd){this.player.startMonitor();this.setState(xmp.CONNECTING,true);return true;};xmp.QuicktimeStateMachine.prototype.onOpen=function(gd,hd){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(jd,kd){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[kd]=this.operations[this.state];}
var ld=this.getRawBytesTotal();var md=((kd===xmp.QUICKTIME_BUFFERING_COMPLETE)?ld:this.getRawBytesLoaded());var nd=((ld<=0)?0:Math.floor((md/ld)*100));nd=((99===nd)?100:nd);if(false===this.bufferingComplete&&(false===this.isLive(this.getRawDuration())||kd===xmp.QUICKTIME_WAIT_BUFFERING||kd===xmp.QUICKTIME_LOAD_BUFFERING||kd===xmp.QUICKTIME_BUFFERING_COMPLETE)){this.setState(kd,true,{percent:nd,bytesDownloaded:md,bytesTotal:ld});}
this.bufferingComplete=(100===nd);if(kd===xmp.QUICKTIME_LOAD_BUFFERING&&true===this.bufferingComplete){this.onOpen(jd,kd);}
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(od){return(xmp.QUICKTIME_INITIAL_LIVE_DURATION===od||0===od||-1===od);};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(pd){var qd=((this.errorCodeDesc[pd])?this.errorCodeDesc[pd]:"(Unknown)");return pd+" "+qd;};xmp.QuicktimeStateMachine.prototype.getErrorCodes=function(rd){var sd=[];var td=rd.substring(rd.indexOf(":")+1);if(td.indexOf(xmp.QUICKTIME_ERROR_CODE_DELIMITER)===-1){sd.push(this.getErrorCodeDesc(parseInt(td,10)));}
else{while(td.length>0){var ud=td.indexOf(xmp.QUICKTIME_ERROR_CODE_DELIMITER);if(ud===-1){sd.push(this.getErrorCodeDesc(parseInt(td,10)));break;}
else{sd.push(this.getErrorCodeDesc(parseInt(td.substring(0,ud),10)));td=td.substring(ud+1);}}}
return sd;};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(vd,wd,xd){var yd=[];if(vd&&vd.indexOf(xmp.QUICKTIME_ERROR)===0){yd.push({label:"QuickTime Error Codes",text:this.getErrorCodes(vd).join(", ")});}
return new xmp.NativePlayerConnectionError(wd,xd,this.player,yd);};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(zd,e){this.setState(xmp.ERRORS,false);this.player.setError(zd,e);};xmp.QuicktimeStateMachine.prototype.validateUrl=function(){try{var Ad=this.player.getNative().GetURL();if(!Ad){return false;}
return(Ad.length>0&&(Ad===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(Bd,Cd){xmp.WindowsMediaPlayer.ctor.call(this,xmp.WINDOWS_MEDIA,Bd,Cd);this.initCallbackStates();};xmp.DERIVE_CLASS(xmp.AbstractNativePlayer,xmp.WindowsMediaPlayer);xmp.WindowsMediaPlayer.prototype.open=function(Dd){this.getNative().URL=Dd.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(Ed){this.getNative().controls.currentPosition=Ed;xmp.WindowsMediaPlayer.base.seek.call(this,Ed);this.setState(xmp.SEEKABLE);};xmp.WindowsMediaPlayer.prototype.isAvailable=function(Fd){if(Fd===xmp.FULLSCREEN){return(true===this.isFullscreenEnabled()&&this.getNative().playState===xmp.WINDOWS_MEDIA_PLAYING);}
return this.getNative().controls.isAvailable(xmp.WindowsMediaUtility.getCommand([Fd]));};xmp.WindowsMediaPlayer.prototype.onValidatePlugIn=function(Gd){var Hd=this.getPlugInInfo(xmp.WINDOWS_MEDIA);try{var Id=new ActiveXObject(xmp.WINDOWS_MEDIA_ACTIVEX_PROGID);this.validatePlugInVersion(xmp.WINDOWS_MEDIA,Id.versionInfo);return;}
catch(e){if((e instanceof xmp.InvalidPlugInVersionError)||(e instanceof xmp.UnsupportedPlugInVersionError)){throw e;}}
throw new xmp.PlugInNotFoundError("Validating native player plugin.",Hd);};xmp.WindowsMediaPlayer.prototype.getPosition=function(){return this.getNative().controls.currentPosition;};xmp.WindowsMediaPlayer.prototype.getDuration=function(){var Jd=this.getNative().currentMedia;if(Jd===null){return 0;}
return Jd.duration;};xmp.WindowsMediaPlayer.prototype.getVolume=function(){return this.getNative().settings.volume;};xmp.WindowsMediaPlayer.prototype.setVolume=function(Kd){this.getNative().settings.volume=Kd;};xmp.WindowsMediaPlayer.prototype.getMute=function(){return this.getNative().settings.mute;};xmp.WindowsMediaPlayer.prototype.setMute=function(Ld){this.getNative().settings.mute=Ld;};xmp.WindowsMediaPlayer.prototype.getFullscreen=function(){return this.getNative().fullScreen;};xmp.WindowsMediaPlayer.prototype.setFullscreen=function(Md){if(false===this.isFullscreenEnabled()){throw new xmp.NativePlayerUnsupportedError("Invoking \"setFullscreen\" method.","Fullscreen disabled.",this);}
this.getNative().fullScreen=Md;};xmp.WindowsMediaPlayer.prototype.create=function(Nd){Nd.id=xmp.WINDOWS_MEDIA+Nd.group;xmp.WindowsMediaPlayer.base.create.call(this,Nd);if(Nd.viewport.getType()!==xmp.DHTML_VIEWPORT){throw new xmp.InvalidNativePlayerViewportError("Creating native player.","Invalid native player viewport \""+Nd.viewport.getType()+"\".  Supported viewports:  DHTML",this);}
var Od=Nd.viewport.getNative();Od.innerHTML="<object id='"+Nd.id+"' width='"+Od.style.width+"' height='"+Od.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===Nd.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='"+Nd.volume+"'/>"+"<param name='mute' value='"+((true===Nd.mute)?xmp.TRUE:xmp.FALSE)+"'/></object>"+"<script language = 'jscript' for='"+Nd.id+"' event=playstatechange(newstate)>"+this.getCallbackMethod(xmp.WINDOWS_MEDIA_PLAYER_PLAY_STATE_CHANGE_METHOD)+"(newstate);</script>"+"<script language = 'jscript' for='"+Nd.id+"' event=openstatechange(newstate)>"+this.getCallbackMethod(xmp.WINDOWS_MEDIA_PLAYER_OPEN_STATE_CHANGE_METHOD)+"(newstate);</script>"+"<script language = 'jscript' for='"+Nd.id+"' event=buffering(start)>"+this.getCallbackMethod(xmp.WINDOWS_MEDIA_PLAYER_BUFFERING_METHOD)+"(start);</script>"+"<script language = 'jscript' for='"+Nd.id+"' event='scriptcommand(name, data)'>"+this.getCallbackMethod(xmp.WINDOWS_MEDIA_PLAYER_TRIGGER_METHOD)+"(name, data);</script>"+"<script language = 'jscript' for='"+Nd.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(Pd,Qd){var Rd=this.callbackStates[Pd];for(var i=0;i<Rd.length;i++){if(Qd===Rd[i].state){return Rd[i].player_state;}}
return"";};xmp.WindowsMediaPlayer.prototype.onPlayStateChange=function(Sd){try{if(Sd===xmp.WINDOWS_MEDIA_STOPPED){this.getLogger().warn("Play state changed to \"Stopped\".");}
var Td=this.translateState(xmp.PLAY_STATE_CHANGE,Sd);if(Td.length>0){this.setState(Td);}}
catch(e){this.setError("Handling play state change.",e);}};xmp.WindowsMediaPlayer.prototype.onOpenStateChange=function(Ud){try{var Vd=this.translateState(xmp.OPEN_STATE_CHANGE,Ud);if(Vd.length>0){this.setState(Vd);}}
catch(e){this.setError("Handling open state change.",e);}};xmp.WindowsMediaPlayer.prototype.onBuffering=function(Wd){try{var Xd=((true===Wd)?this.getNative().network.bufferingProgress:100);this.setState(xmp.BUFFERING,{percent:Xd,bytesDownloaded:0,bytesTotal:0});if(100===Xd){this.setState(xmp.FIRST_FRAME_RENDERED);}}
catch(e){this.setError("Handling buffering.",e);}};xmp.WindowsMediaPlayer.prototype.onTrigger=function(Yd,Zd){try{this.setTrigger(Yd,Zd);}
catch(e){this.setError("Handling trigger.",e);}};xmp.WindowsMediaPlayer.prototype.onError=function(){try{var $d=null;var ae=this.getNative().Error.item(0).errorCode;var be=this.getNative().Error.item(0).errorDescription;var ce=[{label:"Windows Media Error Code",text:xmp.WindowsMediaUtility.getErrorCodeDesc(ae)}];if(true===xmp.WindowsMediaUtility.isConnectionError(ae)){$d=new xmp.NativePlayerConnectionError("Connecting to media.",be,this,ce);}
else{$d=new xmp.NativePlayerError("Handling error.",be,this,ce);}
this.setError(null,$d);}
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(de,ee){xmp.WindowsMediaPlugInPlayer.ctor.call(this,xmp.WINDOWS_MEDIA_PLUGIN,de,ee);this.initCallbackStates();};xmp.DERIVE_CLASS(xmp.AbstractNativePlayer,xmp.WindowsMediaPlugInPlayer);xmp.WindowsMediaPlugInPlayer.prototype.open=function(fe){this.setState(xmp.CONNECTING);this.getNative().url=fe.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(ge){this.getNative().seek(ge);xmp.WindowsMediaPlugInPlayer.base.rewind.call(this);this.setState(xmp.SEEKABLE);};xmp.WindowsMediaPlugInPlayer.prototype.isAvailable=function(he){return this.getNative().isAvailable(xmp.WindowsMediaUtility.getCommand([he]));};xmp.WindowsMediaPlugInPlayer.prototype.onValidatePlugIn=function(ie){var je=this.getPlugInInfo(xmp.TURNER_MEDIA_PLUGIN);var ke=navigator.mimeTypes[xmp.WINDOWS_MEDIA_PLUGIN_MIME_TYPE];if(!ke){throw new xmp.PlugInNotFoundError("Validating native player plugin.",je);}
if(!ke.enabledPlugin){throw new xmp.PlugInDisabledError("Validating native player plugin.",je,xmp.WINDOWS_MEDIA_PLUGIN_MIME_TYPE);}
var le=ke.enabledPlugin.name;if(le.indexOf(xmp.TURNER_MEDIA_PLUGIN_NAME)===-1){throw new xmp.PlugInDisabledError("Validating native player plugin.",je,xmp.WINDOWS_MEDIA_PLUGIN_MIME_TYPE);}
this.validatePlugInVersion(xmp.TURNER_MEDIA_PLUGIN,le.substr(le.lastIndexOf(" ")+1));};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(me){this.getNative().volume=Math.floor(me);};xmp.WindowsMediaPlugInPlayer.prototype.getMute=function(){return this.getNative().mute;};xmp.WindowsMediaPlugInPlayer.prototype.setMute=function(ne){this.getNative().mute=ne;};xmp.WindowsMediaPlugInPlayer.prototype.getFullscreen=function(){return this.getNative().fullscreen;};xmp.WindowsMediaPlugInPlayer.prototype.setFullscreen=function(oe){this.getNative().fullscreen=oe;};xmp.WindowsMediaPlugInPlayer.prototype.create=function(pe){pe.id=xmp.WINDOWS_MEDIA_PLUGIN+pe.group;xmp.WindowsMediaPlugInPlayer.base.create.call(this,pe);if(pe.viewport.getType()!==xmp.DHTML_VIEWPORT){throw new xmp.InvalidNativePlayerViewportError("Creating native player.","Invalid native player viewport \""+pe.viewport.getType()+"\".  Supported viewports:  DHTML",this);}
var qe=pe.viewport.getNative();qe.innerHTML="<embed id='"+pe.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===pe.stretchToFit)?xmp.TRUE:xmp.FALSE)+"' windowlessvideo='true'"+"' volume='"+pe.volume+"' mute='"+((true===pe.mute)?xmp.TRUE:xmp.FALSE)+"' enablecontextmenu='false' width='"+qe.style.width+"' height='"+qe.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(re){var se=this.callbackStates[re];return((se)?se:"");};xmp.WindowsMediaPlugInPlayer.prototype.onStateChange=function(te,ue){try{var ve=this.translateState(te);if(ve.length>0){var we=((ve===xmp.BUFFERING)?{percent:parseInt(ue,10),bytesDownloaded:0,bytesTotal:0}:null);this.setState(ve,we);if(ve===xmp.BUFFERING&&100===we.percent){this.setState(xmp.FIRST_FRAME_RENDERED);}}}
catch(e){this.setError("Handling state change.",e);}};xmp.WindowsMediaPlugInPlayer.prototype.onError=function(xe,ye){try{var ze=null;var Ae=parseInt(ye,10);var Be=[{label:"Windows Media Error Code",text:xmp.WindowsMediaUtility.getErrorCodeDesc(Ae)}];if(true===xmp.WindowsMediaUtility.isConnectionError(Ae)){ze=new xmp.NativePlayerConnectionError("Connecting to media.",xe,this,Be);}
else{ze=new xmp.NativePlayerError("Handling error.",xe,this,Be);}
this.setError(null,ze);}
catch(e){this.setError("Handling error.",e);}};xmp.WindowsMediaPlugInPlayer.prototype.onTrigger=function(Ce,De){try{this.setTrigger(Ce,De);}
catch(e){this.setError("Handling trigger.",e);}};xmp.WindowsMediaPlugInPlayer.prototype.createCallbackMethod=function(Ee){return xmp.escapeHtml(this.getCallbackMethod(Ee),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(Fe){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[Fe];},getErrorCodeDesc:function(Ge){this.initConnectionErrorCodes();return((this.connectionErrorCodes[Ge])?this.connectionErrorCodes[Ge]:Ge);},isConnectionError:function(He){this.initConnectionErrorCodes();return((this.connectionErrorCodes[He])?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)";}}};}();
