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

xmp.createNamespace("xmp.baseplayer");xmp.baseplayer.Bootstrapper=function(){this._boot_state=0;this._callbackObj=null;};xmp.baseplayer.Bootstrapper.prototype.init=function(){this._addSystemLoggerListeners();};xmp.baseplayer.Bootstrapper.prototype.isNew=function(){return(this._boot_state===0);};xmp.baseplayer.Bootstrapper.prototype.isOk=function(){return(this._boot_state===1);};xmp.baseplayer.Bootstrapper.prototype.bootStrap=function(aa){this._boot_state=-1;this._callbackObj=aa;var cb=new xmp.util.Callback('Bootstrapper_bootStrap',this._onBootStrap,this);xmp.net.AjaxRequestManager.getInstance().init(cb);};xmp.baseplayer.Bootstrapper.prototype._onInternalUserDetectionInited=function(ba){this._boot_state=1;this._callbackObj.handleBootstrappedInternal(null);};xmp.baseplayer.Bootstrapper.prototype._onBootStrap=function(ca,da){if(da==='Ready'){this._boot_state=0;var ea=new xmp.util.Callback('Bootstrapper._onInternalUserDetectionInited',this._onInternalUserDetectionInited,this);xmp.InternalUserDetection.getInstance().init(ea);}
else{this._boot_state=-1;this._callbackObj.handleBootstrappedInternal(da);}};xmp.baseplayer.Bootstrapper.prototype._addSystemLoggerListeners=function(){var fa=xmp.util.SettingsManager.getInstance().getGlobalContextNode();var ga=fa.getNodeForPath('Instrumentation');var ha=ga.getBoolean('enabled',false);if(ha===true){var ia=ga.getString('thresholdLevel','critical');var ja=xmp.util.LogLevels.fromString(ia);var ka=new xmp.baseplayer.InstrumentationLoggerListener(ja);xmp.util.Logger.getInstance().addListener(ka);}
var la=xmp.getQueryArgOpt('xmpErrorThreshold','fatal');var ma=xmp.util.LogLevels.fromString(la);ma=Math.min(xmp.util.LogLevels.WARN,ma);var na=new xmp.baseplayer.ErrorLoggerListener(ma);xmp.util.Logger.getInstance().addListener(na);};xmp.baseplayer.Bootstrapper._cacheHtmlObjects=function(){var oa=xmp.util.SettingsManager.getInstance().getContextNode().getNodeForPath('CacheSlates');var pa=oa.retrieveKeys();for(var i=0;i<pa.length;i++){var qa=pa[i];var ra=oa.getString(qa,"").split(",");var sa=xmp.baseplayer.MetaFileLoaderFactory.getInstance().create(qa);sa.setIds(ra,null);sa.load();}};xmp.createNamespace("xmp.baseplayer.listeners");xmp.baseplayer.listeners.AbstractNodeListener=function(id,ta){xmp.validateArguments(arguments,[xmp.STRING_TYPE,xmp.OBJECT_TYPE],"AbstractNodeListener.ctor");if(id===null||id.length===0||ta===null){throw new xmp.util.internals.InvalidArgsError("The 'id' argument must be non-empty, "+"and the 'player' argument must be non-null.");}
this._id=id;this._player=ta;};xmp.baseplayer.listeners.AbstractNodeListener.prototype.getId=function(){return this._id;};xmp.baseplayer.listeners.AbstractNodeListener.prototype.getPlayer=function(){return this._player;};xmp.baseplayer.listeners.AbstractNodeListener.prototype.canUserControl=function(ua){return true;};xmp.baseplayer.listeners.AbstractNodeListener.prototype.handleInitialize=function(va){};xmp.baseplayer.listeners.AbstractNodeListener.prototype.handleDynamicRules=function(wa){};xmp.baseplayer.listeners.AbstractNodeListener.prototype.handleComplete=function(xa){};xmp.baseplayer.listeners.AbstractNodeListener.prototype.canCompleteNow=function(ya){return true;};xmp.baseplayer.listeners.AbstractNodeListener.prototype.handleCompleteAsynch=function(za,Aa){};xmp.baseplayer.listeners.AbstractNodeListener.prototype.handleRender=function(Ba){};xmp.baseplayer.listeners.AbstractNodeListener.prototype.handleOpen=function(Ca){};xmp.baseplayer.listeners.AbstractNodeListener.prototype.handleConnecting=function(Da){};xmp.baseplayer.listeners.AbstractNodeListener.prototype.handleConnected=function(Ea){};xmp.baseplayer.listeners.AbstractNodeListener.prototype.handlePlay=function(Fa){};xmp.baseplayer.listeners.AbstractNodeListener.prototype.handleFirstFrameRendered=function(Ga){};xmp.baseplayer.listeners.AbstractNodeListener.prototype.handlePause=function(Ha){};xmp.baseplayer.listeners.AbstractNodeListener.prototype.handleStop=function(Ia){};xmp.baseplayer.listeners.AbstractNodeListener.prototype.handleRewind=function(Ja){};xmp.baseplayer.listeners.AbstractNodeListener.prototype.handleFastForward=function(Ka){};xmp.baseplayer.listeners.AbstractNodeListener.prototype.handleSeekable=function(La){};xmp.baseplayer.listeners.AbstractNodeListener.prototype.handleEnded=function(Ma){};xmp.baseplayer.listeners.AbstractNodeListener.prototype.handleBuffering=function(Na,Oa){};xmp.baseplayer.listeners.AbstractNodeListener.prototype.handleTimelineChange=function(Pa,Qa,Ra){};xmp.baseplayer.listeners.AbstractNodeListener.prototype.handleError=function(Sa,e){};xmp.baseplayer.listeners.AbstractNodeListener.prototype.handleOverrideAdResources=function(Ta,Ua){};xmp.baseplayer.listeners.AbstractNodeListener.prototype.handleValidate=function(Va){};xmp.createNamespace("xmp.baseplayer.listeners");xmp.baseplayer.listeners.DefaultBaseNodeListener=function(Wa,Xa){xmp.baseplayer.listeners.DefaultBaseNodeListener.ctor.call(this,Wa,Xa);this._bnl_logger=new xmp.util.internals.CategoryLogger('DefaultBaseNodeListener');};xmp.DERIVE_CLASS(xmp.baseplayer.listeners.AbstractNodeListener,xmp.baseplayer.listeners.DefaultBaseNodeListener);xmp.baseplayer.listeners.DefaultBaseNodeListener.prototype.handleRender=function(Ya){this.getPlayer().getMediaPlayer().open(Ya);};xmp.baseplayer.listeners.DefaultBaseNodeListener.prototype.handleEnded=function(Za){this.getPlayer().advance();};xmp.baseplayer.listeners.DefaultBaseNodeListener.prototype.handleError=function($a,e){this._bnl_logger.warn("Dropping node: "+$a.getBestId()+', error: '+xmp.extractErrorMessage(e));this.getPlayer().advance();};xmp.createNamespace("xmp.baseplayer.listeners");xmp.baseplayer.listeners.DefaultSlateNodeListener=function(ab,bb){xmp.baseplayer.listeners.DefaultSlateNodeListener.ctor.call(this,ab,bb);};xmp.DERIVE_CLASS(xmp.baseplayer.listeners.DefaultBaseNodeListener,xmp.baseplayer.listeners.DefaultSlateNodeListener);xmp.baseplayer.listeners.DefaultSlateNodeListener.prototype.handleInitialize=function(db){var eb=db.getMetadata("url","");if(eb.length>0){db.setURI(eb);}
db.setMimeType(xmp.DHTML_MIME_TYPE);};xmp.baseplayer.listeners.DefaultSlateNodeListener.prototype._findNextContentNode=function(){var fb=this.getPlayer().getLookAheadNodeArray();for(var i=0;i<fb.length;i++){var gb=fb[i];if(gb.isContentType()){return gb;}}
return null;};xmp.createNamespace("xmp.baseplayer.listeners.internal");xmp.baseplayer.listeners.internal.TriggerNodeListener=function(id,hb){xmp.baseplayer.listeners.internal.TriggerNodeListener.ctor.call(this,id,hb);this.tracked_midpoint=false;this.live=false;};xmp.DERIVE_CLASS(xmp.baseplayer.listeners.AbstractNodeListener,xmp.baseplayer.listeners.internal.TriggerNodeListener);xmp.baseplayer.listeners.internal.TriggerNodeListener.prototype.handleRender=function(ib){this.tracked_midpoint=false;this.live=(ib.getStreamingMode()==='live');if(false===this.live){xmp.util.TriggerHelper.handleTrackRequest(ib,this.getPlayer());}
xmp.baseplayer.listeners.internal.TriggerNodeListener.base.handleRender.call(this,ib);};xmp.baseplayer.listeners.internal.TriggerNodeListener.prototype.handleOpen=function(jb){this.tracked_midpoint=false;this.live=(jb.getStreamingMode()==='live');xmp.util.TriggerHelper.handleTrackStart(jb,this.getPlayer());xmp.baseplayer.listeners.internal.TriggerNodeListener.base.handleOpen.call(this,jb);};xmp.baseplayer.listeners.internal.TriggerNodeListener.prototype.handleEnded=function(kb){if(false===this.live){xmp.util.TriggerHelper.handleTrackEnd(kb,this.getPlayer());}
xmp.baseplayer.listeners.internal.TriggerNodeListener.base.handleEnded.call(this,kb);};xmp.baseplayer.listeners.internal.TriggerNodeListener.prototype.handleTimelineChange=function(lb,mb,nb){xmp.baseplayer.listeners.internal.TriggerNodeListener.base.handleTimelineChange.call(this,lb,mb,nb);if(false===this.live&&false===this.tracked_midpoint){if(nb===0){return;}
var ob=(((lb.getTimeLimitInSeconds()!==xmp.NO_TIME_LIMIT)?lb.getTimeLimitInSeconds():nb)/2);if(mb>=ob){xmp.util.TriggerHelper.handleTrackMidpoint(lb,this.getPlayer());this.tracked_midpoint=true;}}};xmp.createNamespace("xmp.baseplayer.listeners.internal");xmp.baseplayer.listeners.internal.AdResNodeListener=function(id,pb){xmp.baseplayer.listeners.internal.AdResNodeListener.ctor.call(this,id,pb);};xmp.DERIVE_CLASS(xmp.baseplayer.listeners.AbstractNodeListener,xmp.baseplayer.listeners.internal.AdResNodeListener);xmp.baseplayer.listeners.internal.AdResNodeListener.prototype.canCompleteNow=function(qb){var rb=qb.getMetaResourceBundle();if(rb.isError()||rb.isLoaded()){this._handleResBundleLoaded(qb,rb);}
if(rb.isError()){return true;}
return rb.isLoaded();};xmp.baseplayer.listeners.internal.AdResNodeListener.prototype.handleCompleteAsynch=function(sb,tb){var ub=xmp.util.SettingsManager.getInstance().getContextNode().getNodeForPath('BasePlayer').getString('videoAdMetaLoader','videoAdMeta');var vb=xmp.baseplayer.MetaFileLoaderFactory.getInstance().create(ub);var wb=new xmp.util.Callback('gotAdCallback',this._gotAdCallback,this);wb.setMetadata('RelayCallback',tb);wb.setMetadata('theNode',sb);vb.setResBundle(sb.getMetaResourceBundle(),wb);vb.load();};xmp.baseplayer.listeners.internal.AdResNodeListener.prototype._gotAdCallback=function(xb,yb){var zb=xb.getMetadata('RelayCallback',{});var Ab=xb.getMetadata('theNode',{});this._handleResBundleLoaded(Ab,yb);zb.call(Ab);};xmp.baseplayer.listeners.internal.AdResNodeListener.prototype._handleResBundleLoaded=function(Bb,Cb){};xmp.createNamespace("xmp.baseplayer.internals");xmp.baseplayer.internals.GenericMetaFileLoader=function(Db,Eb,Fb,Gb,Hb,Ib,Jb){this._THIS_TYPE=Db;this._THIS_LOADER_TYPE=Eb;this._CONTENT_TYPE=Fb;this._APP_ERROR_TYPE=Gb;this._MAX_CACHE_TIME=Hb;this._logger=new xmp.util.internals.CategoryLogger(this._THIS_LOADER_TYPE);this._owner=Ib;this._loaderId=Jb;this._handleArray=[];this._handleMap={};this._perIdCallback=null;this._allLoadedCallback=null;this._loadedCount=0;this._loadCalled=false;};xmp.baseplayer.internals.GenericMetaFileLoader.prototype.getLoaderId=function(){return this._loaderId;};xmp.baseplayer.internals.GenericMetaFileLoader.prototype.setIds=function(Kb,Lb){this._loadCalled=false;this._handleArray=[];this._perIdCallback=Lb;var Mb={};for(var i=0;i<Kb.length;i++){var id=Kb[i];if(!(typeof id==='string'&&id.length>0)){throw new xmp.util.internals.InvalidArgsError("The 'ids' argument must be an array of non-empty strings.");}
if(typeof Mb[id]!=='undefined'){this._logger.warn('Skipping duplicate ID: '+id);continue;}
Mb[id]=id;var Nb=xmp.baseplayer.internals.MetaFileCache.getInstance().findOrCreate(this._THIS_TYPE,id,this,this._MAX_CACHE_TIME);var Ob={h:Nb,ready:false};this._handleArray.push(Ob);this._handleMap[Nb.getId()]=Ob;}
return this._extractLoadableDataArray();};xmp.baseplayer.internals.GenericMetaFileLoader.prototype.setAllLoadedCallback=function(Pb){this._allLoadedCallback=Pb;};xmp.baseplayer.internals.GenericMetaFileLoader.prototype.load=function(){this._loadCalled=true;if(this._handleArray.length===0){this._releaseThis();this._notifyAllLoaded();return;}
this._loadedCount=0;for(var i=0;i<this._handleArray.length;i++){var Qb=this._handleArray[i];if(Qb.ready){this._notifyPerFile(Qb.h);}}};xmp.baseplayer.internals.GenericMetaFileLoader.prototype._extractLoadableDataArray=function(){var Rb=[];for(var i=0;i<this._handleArray.length;i++){var Sb=this._handleArray[i].h;Rb.push(Sb.getDataObject());}
return Rb;};xmp.baseplayer.internals.GenericMetaFileLoader.prototype._notifyPerFile=function(Tb){if(Tb.isLoaded()){this._loadedCount++;this._notifyPerFileCore(Tb);}
if(this._loadedCount>=this._handleArray.length){this._releaseThis();this._notifyAllLoaded();}};xmp.baseplayer.internals.GenericMetaFileLoader.prototype._releaseThis=function(){if(this._owner!==null){this._owner._release(this);this._owner=null;}};xmp.baseplayer.internals.GenericMetaFileLoader.prototype._notifyPerFileCore=function(Ub){try{if(this._perIdCallback!==null){this._perIdCallback.call(Ub.getDataObject());}}
catch(e){this._logger.warn('Error calling per-file-callback',e);}};xmp.baseplayer.internals.GenericMetaFileLoader.prototype._notifyAllLoaded=function(){try{if(this._allLoadedCallback!==null){this._allLoadedCallback.call();}}
catch(e){this._logger.warn('Error calling all-loaded-callback',e);}};xmp.baseplayer.internals.GenericMetaFileLoader.prototype._notifyFileRequestLoaded=function(Vb){if(this._loadCalled){this._notifyPerFile(Vb);}
else{var Wb=this._handleMap[Vb.getId()];if(Wb.h!==Vb){throw new Error('Unexpected, handles not the same reference.');}
Wb.ready=true;}};xmp.baseplayer.internals.GenericMetaFileLoader.GenericLoadable=function(id){xmp.baseplayer.internals.GenericMetaFileLoader.GenericLoadable.ctor.call(this);this._id=id;};xmp.DERIVE_CLASS(xmp.util.Loadable,xmp.baseplayer.internals.GenericMetaFileLoader.GenericLoadable);xmp.baseplayer.internals.GenericMetaFileLoader.GenericLoadable.prototype.getLoadableId=function(){return this._id;};xmp.baseplayer.internals.GenericMetaFileLoader.prototype._createLoadable=function(id){return(new xmp.baseplayer.internals.GenericMetaFileLoader.GenericLoadable(id));};xmp.baseplayer.internals.GenericMetaFileLoader.prototype._loadFileRequest=function(Xb){var Yb=null;try{Yb=this._createLoadable(Xb.getId());Xb._setDataObject(Yb);var Zb=new xmp.util.Callback(this._THIS_LOADER_TYPE+'_'+this.getLoaderId()+'_'+Xb.getId(),this._handleAjaxResponse,this);var $b=xmp.net.AjaxRequestManager.getInstance();Zb.setMetadata('handle',Xb);$b.request(Xb.getId(),Zb,Xb.getType(),Xb.getId(),this._CONTENT_TYPE,null);return xmp.baseplayer.internals.FileRequestHandle.STATE_LOADING;}
catch(e){try{if(Yb!==null){Yb._setErrorMessage(xmp.extractErrorMessage(e));}}
catch(e2){this._logger.warn('Second chance error handling created file request',e2);}
throw e;}};xmp.baseplayer.internals.GenericMetaFileLoader.prototype._handleAjaxResponse=function(ac,bc){var cc=ac.getMetadata('handle',{});var dc=cc.getDataObject();if(!bc.isError()){if(xmp.net.ContentTypes.JSON===this._CONTENT_TYPE){dc._setRawData(bc.getJsonObject());}
else{if(xmp.net.ContentTypes.TEXT!==this._CONTENT_TYPE){throw new Error('Unexpected content type');}
dc._setRawData(bc.getText());}}
else{var ec=new xmp.baseplayer.ApplicationError(bc.getErrorObject(),this._APP_ERROR_TYPE,this._THIS_TYPE,[{label:'url',text:bc.getFullUrl()}]);this._logger.warn(ec.message,ec);cc._setErrorMessage(bc.getErrorMessage());dc._setErrorMessage(bc.getErrorMessage());}
cc._setAsLoaded();};xmp.createNamespace("xmp.baseplayer");xmp.baseplayer.AppErrorCodes=function(){};xmp.baseplayer.AppErrorCodes.data=[];xmp.baseplayer.AppErrorCodes.data.badAdPolicy='Ad policy not found';xmp.baseplayer.AppErrorCodes.data.badAdPattern='Bad ad pattern';xmp.baseplayer.AppErrorCodes.data.FailToGetAdPattern='Failed to get the "ad pattern" JSON:  Make sure that the corresponding value for "rootUrl" in primary.js is correct, and that a valid JSON file exists at the specified location.  Also, make sure that the required cross-domain XML file on the JSON host has the needed site entry.';xmp.baseplayer.AppErrorCodes.data.RulesNotDownLoaded='Failed to get the "rules JavaScript" file:  Make sure that the corresponding value for "rootUrl" in primary.js is correct, and that a valid JS file exists at the specified location.  Also, make sure that the required cross-domain XML file on the JS host has the needed site entry.';xmp.baseplayer.AppErrorCodes.data.missingContent='Missing content';xmp.baseplayer.AppErrorCodes.data.FailToGetDhtmlObject='Failed to load the DHTML object:  Make sure that the corresponding value for "rootUrl" in primary.js is correct, and that a valid DHTML object exists at the specified location.  Also, make sure that the required cross-domain XML file on the DHTML host has the needed site entry.';xmp.baseplayer.AppErrorCodes.data.missingAd='Failed to get the ad:  Make sure that the corresponding value for "rootUrl" in primary.js is correct, and that a valid ad file exists at the specified location.  Also, make sure that the required cross-domain XML file on the ad host has the needed site entry.';xmp.baseplayer.AppErrorCodes.data.badAdJson='Bad ad JSON';xmp.baseplayer.AppErrorCodes.data.FailToGetAdVideo='Failed to get the ad video:  Make sure that the corresponding value for "rootUrl" in primary.js is correct, and that a valid ad-video file exists at the specified location.  Also, make sure that the required cross-domain XML file on the ad-video host has the needed site entry.';xmp.baseplayer.AppErrorCodes.data.missingVideoJson='Failed to get the video JSON:  Make sure that the corresponding value for "rootUrl" in primary.js is correct, and that a valid JSON file exists at the specified location.  Also, make sure that the required cross-domain XML file on the JSON host has the needed site entry.';xmp.baseplayer.AppErrorCodes.data.FailToGetVideoJson='Failed to get the video JSON:  Make sure that the corresponding value for "rootUrl" in primary.js is correct, and that a valid JSON file exists at the specified location.  Also, make sure that the required cross-domain XML file on the JSON host has the needed site entry.';xmp.baseplayer.AppErrorCodes.data.FailToGetPromoJson='Failed to get the promo JSON:  Make sure that the corresponding value for "rootUrl" in primary.js is correct, and that a valid JSON file exists at the specified location.  Also, make sure that the required cross-domain XML file on the JSON host has the needed site entry.';xmp.baseplayer.AppErrorCodes.data.badVideoJson='Exception caught during "all loaded" notification.  The video JSON might be invalid.';xmp.baseplayer.AppErrorCodes.data.mediaPlayerError='Media-player error';xmp.baseplayer.AppErrorCodes.data.badInitialFlashObject='Timed out initializing Flash:  Make sure that the corresponding value for "rootUrl" in primary.js is correct for the initial Flash object.  Also, make sure that the Flash plug-in is installed and that the installation is not corrupted.';xmp.baseplayer.AppErrorCodes.getDescription=function(fc){var gc=xmp.baseplayer.AppErrorCodes.data[fc];if(gc===null){gc='Unknown error: '+fc;}
return gc;};xmp.baseplayer.ApplicationError=function(e,hc,ic,jc){var kc=xmp.baseplayer.AppErrorCodes.getDescription(hc);xmp.baseplayer.ApplicationError.ctor.call(this,"ApplicationError",ic,kc,jc);this.setInnerError(e);};xmp.DERIVE_CLASS(xmp.util.internals.XMPError,xmp.baseplayer.ApplicationError);xmp.baseplayer.ApplicationError.prototype.getInnerError=function(){return this.innerError;};xmp.baseplayer.ApplicationError.prototype.getMessage=function(){return this.message;};xmp.baseplayer.ApplicationError.prototype.getContext=function(){return this.context;};xmp.baseplayer.ApplicationError.prototype.getExtendedInfo=function(){return this.extendedInfo;};xmp.createNamespace("xmp.baseplayer");xmp.baseplayer.BasePlayer=function(id,lc,mc){xmp.util.LogConfigurator.configure();if(xmp.baseplayer.BasePlayer._singleInstance!==null){throw new Error('Only one instance of BasePlayer allowed per browser session.');}
this._nextPlayListContextKey=1;this._playListContextCollection={};this._currentPlayListContext=null;this._logger=new xmp.util.internals.CategoryLogger('BasePlayer');this._id=id;xmp.baseplayer.BasePlayer._playerMap[this.getId()]=this;this._metadataMap=new xmp.util.internals.MetadataMap(true);this._metadataMap._reInitialize(lc);this._parameters=mc;this._mediaPlayer=null;this._nlMap=new xmp.baseplayer._NLMap(this);this._bootStrapper=xmp.baseplayer.BasePlayer._bootStrapper;this._bootStrapper.init();this._options=lc;xmp.baseplayer.BasePlayer._singleInstance=this;};xmp.baseplayer.BasePlayer._playerMap={};xmp.baseplayer.BasePlayer._singleInstance=null;xmp.baseplayer.BasePlayer._bootStrapper=new xmp.baseplayer.Bootstrapper();xmp.baseplayer.BasePlayer._fatalException=xmp.FatalException.createFatalException(xmp.XmpErrorCodes.FATAL_UNSPECIFIED_ERROR,'BasePlayer','not boostrapped yet');xmp.baseplayer.BasePlayer.prototype.getAbsoluteURI=function(nc,oc){if(nc.length>0&&nc.charAt(0)==='/'){var pc="http://"+window.location.host;var qc=pc;if(typeof oc!=='undefined'&&oc!=='defaultRoot'){qc=xmp.util.RootUrlProvider.getInstance().getRootUrl(oc,pc);}
nc=qc+nc;}
return nc;};xmp.baseplayer.BasePlayer.findPlayer=function(id){var rc=xmp.baseplayer.BasePlayer._playerMap[id];return(!rc)?null:rc;};xmp.baseplayer.BasePlayer.configure=function(sc,tc){var uc=[xmp.internal_settings_pref_api];uc=uc.concat(sc);xmp.util.SettingsManager.getInstance().init(uc,tc);var vc=xmp.util.internals.MockTestMode.getInstance();if(vc.isActive()){vc.configure();}};xmp.baseplayer.BasePlayer.prototype.bootStrap=function(){try{if(!this._bootStrapper.isNew()){throw new Error('Already tried to bootstrap.');}
var wc=xmp.baseplayer.BasePlayer._fatalException;xmp.PlayerPolicy.validateBootstrap(this);if(wc===xmp.baseplayer.BasePlayer._fatalException){this._bootStrapper.bootStrap(this);}
else{this.handleBootstrapped(false);}}
catch(e){this.handleBootstrappedInternal(e);}};xmp.baseplayer.BasePlayer.prototype.fini=function(){if(this._mediaPlayer!==null){this._mediaPlayer.fini();this._mediaPlayer=null;}
xmp.ServiceRegistry.fini();};xmp.baseplayer.BasePlayer.prototype.getId=function(){return this._id;};xmp.baseplayer.BasePlayer.prototype.getMediaPlayer=function(){return this._mediaPlayer;};xmp.baseplayer.BasePlayer.prototype.getLookAheadNodeArray=function(){return this._getCurCtx('getLookAheadNodeArray').getLookAheadNodeArray();};xmp.baseplayer.BasePlayer.prototype.getLookBehindNodeArray=function(){return this._getCurCtx('getLookBehindNodeArray').getLookBehindNodeArray();};xmp.baseplayer.BasePlayer.prototype.getMetadata=function(xc,yc){return this._metadataMap._get(xc,yc);};xmp.baseplayer.BasePlayer.prototype.setPlayerContext=function(zc){xmp.util.PlayerStats.getInstance().setValue('playerContext',zc);xmp.util.SettingsManager.getInstance().setContext(zc);xmp.baseplayer.Bootstrapper._cacheHtmlObjects();};xmp.baseplayer.BasePlayer.prototype.createPlayListContext=function(Ac){this._checkXmpState();this._faultMediaPlayer();var Bc=this._getAdPatternRelPath(Ac);var Cc=this._getContextParameters();Cc=Cc.concat(this._parameters);var Dc=this._createPlayListContext(Bc,Cc);this._setCurrentPlayListContext(Dc);var Ec=Dc.getKey();if(this._logger.isDebugEnabled()){this._logger.debug("Created new playlist, key = "+Ec);Dc.debugPrint("Initial State");}
return Ec;};xmp.baseplayer.BasePlayer.prototype.loadContent=function(Fc,Gc){this._checkXmpState();return this._getCurCtx('loadContent').loadContent(Fc,(Gc?Gc:''));};xmp.baseplayer.BasePlayer.prototype.load=function(Hc,Ic,Jc){this._logger.warn('Method "BasePlayer.load" is deprecated, please change code to no longer use this method.');var Kc=this.createPlayListContext(Jc);this.loadContent(Hc,Ic);return Kc;};xmp.baseplayer.BasePlayer.prototype.loadItem=function(Lc,Mc,Nc){this._faultMediaPlayer();var Oc=this._createPlayableNode(Lc,Mc,Nc);var Pc=this._getNodeListener(Oc);Pc.handleInitialize(Oc);Pc.handleValidate(Oc);Pc.handleComplete(Oc);Pc.handleRender(Oc);};xmp.baseplayer.BasePlayer.prototype._createPlayableNode=function(Qc,Rc,Sc){var Tc=new xmp.util.PlayableNode();Tc._setNodeType(new xmp.playlistapi.internals.RuleSetPlayableNodeType(null,Qc,Qc,[],{}));if(Rc){if(Rc.url){Tc.setURI(Rc.url);}
Tc._setData(((Rc.metadata)?Rc.metadata:new xmp.util.PlayableData('DEFAULT')));}
if(Sc){var Uc=Sc.length;for(var i=0;i<Uc;i++){Tc.setMetadata(Sc[i].name,Sc[i].value);}}
return Tc;};xmp.baseplayer.BasePlayer.prototype._getAdPatternRelPath=function(Vc){var Wc='';var Xc=xmp.util.SettingsManager.getInstance().getContextNode().getNodeForPath('BasePlayer/ad patterns');if(typeof(Vc)==='undefined'){var Yc=Xc.retrieveKeys();if(Yc.length>0){Wc=Xc.getString(Yc[0],'');}}
else{if(!xmp.isNonEmptyString(Vc)){throw new xmp.util.internals.InvalidArgsError('The adPatternKey parameter must be a non-empty string');}
Wc=Xc.getString(Vc,'');}
if(!xmp.isNonEmptyString(Wc)){throw new xmp.util.internals.InvalidArgsError('Failed to find ad pattern relative URL.');}
return Wc;};xmp.baseplayer.BasePlayer.prototype._createPlayListContext=function(Zc,$c){var ad=this._nextPlayListContextKey++;var bd=new xmp.baseplayer._PLCtx(ad,this,Zc,$c);this._playListContextCollection[ad]=bd;return bd;};xmp.baseplayer.BasePlayer.prototype.switchPlayList=function(cd){var dd=this._playListContextCollection[cd];if(!dd){throw new xmp.util.internals.InvalidArgsError(""+cd+" is not a valid playlist context key");}
else{if(this._logger.isDebugEnabled()){this._logger.debug("Switching playlist context:");this._currentPlayListContext.debugPrint("old context");this._setCurrentPlayListContext(dd);this._currentPlayListContext.debugPrint("new context");}
this._tryRender();}};xmp.baseplayer.BasePlayer.prototype.hasPlayListContext=function(){return this._currentPlayListContext!==null;};xmp.baseplayer.BasePlayer.prototype._setCurrentPlayListContext=function(ed){if(this._currentPlayListContext){this._currentPlayListContext.setStateListener(null);}
this._currentPlayListContext=ed;this._currentPlayListContext.setStateListener(this);};xmp.baseplayer.BasePlayer.prototype._getCurCtx=function(fd){if(!this._currentPlayListContext){throw new Error('BasePlayer.'+fd+": Cannot perform operation because playlist context has not been set. Call load() first.");}
return this._currentPlayListContext;};xmp.baseplayer.BasePlayer.prototype.appendToPlayList=function(gd,hd){this._checkXmpState();return this._getCurCtx('appendToPlayList').appendToPlayList(gd,((hd)?hd:false));};xmp.baseplayer.BasePlayer.prototype.removeFromPlayList=function(jd){this._checkXmpState();return this._getCurCtx('removeFromPlayList').removeFromPlayList(jd);};xmp.baseplayer.BasePlayer.prototype.insertInPlayList=function(kd,ld,md){this._checkXmpState();return this._getCurCtx('insertInPlayList').insertInPlayList(kd,ld,((md)?md:false));};xmp.baseplayer.BasePlayer.prototype.moveWithinPlayList=function(nd,od,pd){this._checkXmpState();return this._getCurCtx('moveWithinPlayList').moveWithinPlayList(nd,od,((pd)?pd:false));};xmp.baseplayer.BasePlayer.prototype.setCurrentPlayListPosition=function(qd){this._checkXmpState();return this._getCurCtx('setCurrentPlayListPosition').setCurrentPlayListItem(qd);};xmp.baseplayer.BasePlayer.prototype.getCurrentPlayListItem=function(){return this._getCurCtx('getCurrentPlayListItem').getCurrentPlayListItem();};xmp.baseplayer.BasePlayer.prototype.getPlayListItemCount=function(){return this._getCurCtx('getPlayListItemCount').getPlayListItemCount();};xmp.baseplayer.BasePlayer.prototype.getPlayListItem=function(rd){return this._getCurCtx('getPlayListItem').getPlayListItem(rd);};xmp.baseplayer.BasePlayer.prototype.findPlayListItem=function(sd){return this._getCurCtx('findPlayListItem').findPlayListItem(sd);};xmp.baseplayer.BasePlayer.prototype.findPlayListItemIndex=function(td){return this._getCurCtx('findPlayListItemIndex').findPlayListItemIndex(td);};xmp.baseplayer.BasePlayer.prototype.advance=function(){this._checkXmpState();this._getCurCtx('advance').advance();};xmp.baseplayer.BasePlayer.prototype.onAdvance=function(){this._tryRender();};xmp.baseplayer.BasePlayer.prototype._tryRender=function(){if(this._isReady()){var ud=this._currentPlayListContext.getCurrentNode();if(ud){this._renderNode(ud,true);}}};xmp.baseplayer.BasePlayer.prototype.registerNodeListener=function(vd,wd){this._nlMap._registerNodeListener(vd,wd);};xmp.baseplayer.BasePlayer.prototype._initServices=function(xd){if(xd.services){xmp.ServiceRegistry.init(this,xd.services);}};xmp.baseplayer.BasePlayer.prototype.handlePlayListStarted=function(){this._logger.info('PlayList started, override "handlePlayListStarted" to do specific handling.');};xmp.baseplayer.BasePlayer.prototype.handlePlayListEnded=function(){this._logger.info('PlayList ended, override "handlePlayListEnded" to do specific handling.');};xmp.baseplayer.BasePlayer.prototype.handlePlayListModified=function(yd){this._logger.info('PlayList modified, override "handlePlayListModified" to do specific handling.');};xmp.baseplayer.BasePlayer.prototype.handleMediaPlayerReady=function(){this._throwMustOverrideError();};xmp.baseplayer.BasePlayer.prototype.handleCreateViewport=function(zd,Bd,Cd,Dd){this._throwMustOverrideError();};xmp.baseplayer.BasePlayer.prototype.handleDestroyViewport=function(Ed,Fd){var Gd=xmp.findDomElement(Fd);if(Gd){var Hd=xmp.getDomParent(Gd);Hd.removeChild(Gd);}};xmp.baseplayer.BasePlayer.prototype.handleFatalException=function(e){this._throwMustOverrideError();};xmp.baseplayer.BasePlayer.prototype.handleBootstrapped=function(Id){this._throwMustOverrideError();};xmp.baseplayer.BasePlayer.prototype.handleRegisterNodeListeners=function(){this._throwMustOverrideError();};xmp.baseplayer.BasePlayer.prototype.onControlStreamError=function(e){this.handleControlStreamError(e);};xmp.baseplayer.BasePlayer.prototype.handleControlStreamError=function(e){this._throwMustOverrideError();};xmp.baseplayer.BasePlayer.prototype.onControlStreamTriggerInit=function(Jd,Kd){this.handleControlStreamTriggerInit(Jd,Kd);};xmp.baseplayer.BasePlayer.prototype.handleControlStreamTriggerInit=function(Ld,Md){this._throwMustOverrideError();};xmp.baseplayer.BasePlayer.prototype.onControlStreamTrigger=function(Nd,Od){this.handleControlStreamTrigger(Nd,Od);};xmp.baseplayer.BasePlayer.prototype.handleControlStreamTrigger=function(Pd,Qd){this._throwMustOverrideError();};xmp.baseplayer.BasePlayer.prototype.onRetrieveImage=function(Rd,Sd){this.handleRetrieveImage(Rd,Sd);};xmp.baseplayer.BasePlayer.prototype.handleRetrieveImage=function(Td,Ud){this._throwMustOverrideError();};xmp.baseplayer.BasePlayer.prototype.onImageRetrieverError=function(e){this.handleImageRetrieverError(e);};xmp.baseplayer.BasePlayer.prototype.handleImageRetrieverError=function(e){this._throwMustOverrideError();};xmp.baseplayer.BasePlayer.prototype._throwMustOverrideError=function(){throw new xmp.playlistapi.internals.PlayListError('Not implemented, must override.');};xmp.baseplayer.BasePlayer.prototype._getNodeListener=function(Vd){return this._nlMap._getNodeListener(Vd);};xmp.baseplayer.BasePlayer.prototype._faultMediaPlayer=function(){if(this._mediaPlayer===null){this._createMediaPlayer();}};xmp.baseplayer.BasePlayer.prototype._createMediaPlayer=function(){this._mediaPlayer=xmp.MediaPlayerFactory.createPlayer(this.getId(),this);this._mediaPlayer.init();};xmp.baseplayer.BasePlayer.prototype.onInitialized=function(){this.handleMediaPlayerReady();this.handleRegisterNodeListeners();};xmp.baseplayer.BasePlayer.prototype.onTimelineChange=function(Wd,Xd,Yd){this._getNodeListener(Wd).handleTimelineChange(Wd,Xd,Yd);};xmp.baseplayer.BasePlayer.prototype.onStateChange=function(Zd,$d,ae){switch($d){case xmp.OPEN:this._getNodeListener(Zd).handleOpen(Zd);break;case xmp.CONNECTING:this._getNodeListener(Zd).handleConnecting(Zd);break;case xmp.CONNECTED:this._getNodeListener(Zd).handleConnected(Zd);break;case xmp.PLAY:this._getNodeListener(Zd).handlePlay(Zd);break;case xmp.PAUSE:this._getNodeListener(Zd).handlePause(Zd);break;case xmp.STOP:this._getNodeListener(Zd).handleStop(Zd);break;case xmp.REWIND:this._getNodeListener(Zd).handleRewind(Zd);break;case xmp.FAST_FORWARD:this._getNodeListener(Zd).handleFastForward(Zd);break;case xmp.SEEKABLE:this._getNodeListener(Zd).handleSeekable(Zd);break;case xmp.ENDED:this._getNodeListener(Zd).handleEnded(Zd);break;case xmp.FIRST_FRAME_RENDERED:this._getNodeListener(Zd).handleFirstFrameRendered(Zd);break;case xmp.BUFFERING:this._getNodeListener(Zd).handleBuffering(Zd,ae);break;default:this._logger.warn('Unrecognized media player state: '+$d);break;}};xmp.baseplayer.BasePlayer.prototype.onError=function(be,e){this._getNodeListener(be).handleError(be,e);};xmp.baseplayer.BasePlayer.prototype.onCreateViewport=function(ce,de,ee,fe){return this.handleCreateViewport(ce,de,ee,fe);};xmp.baseplayer.BasePlayer.prototype.onDestroyViewport=function(ge,he){this.handleDestroyViewport(ge,he);};xmp.baseplayer.BasePlayer.prototype.onPlugInError=function(e){this._raiseFatalException(e);};xmp.baseplayer.BasePlayer.prototype.onUnsupportedPlatformError=function(e){this._raiseFatalException(e);};xmp.baseplayer.BasePlayer.prototype._getContextParameters=function(){var je=[];var ke=xmp.util.SettingsManager.getInstance().getContextNode().getNodeForPath('pattern parameters');var le=ke.retrieveKeys();for(var i=0;i<le.length;i++){var me=le[i];je.push({name:me,value:ke.getString(me,'')});}
return je;};xmp.baseplayer.BasePlayer.prototype._isReady=function(){return(this._currentPlayListContext!==null);};xmp.baseplayer.BasePlayer.prototype.handleInitializePlayableNode=function(ne){this._getNodeListener(ne).handleInitialize(ne);this._getNodeListener(ne).handleDynamicRules(ne);};xmp.baseplayer.BasePlayer.prototype._isStillCurrentNode=function(oe){var pe=this._currentPlayListContext.getCurrentNode();return(oe===pe);};xmp.baseplayer.BasePlayer.prototype._gotAsynchCompleteCallback=function(qe,se){if(this._isStillCurrentNode(se)){this._renderNode(se,false);}};xmp.baseplayer.BasePlayer.prototype._renderNode=function(te,ue){var ve=null;try{ve=this._getNodeListener(te);if(ue){this._overrideAdRes(ve,te);}
if(!this._isStillCurrentNode(te)){return;}
if(ve.canCompleteNow(te)){if(te.getPlayableData().isError()){ve.handleError(te,te.getPlayableData().getError());return;}
ve.handleValidate(te);ve.handleComplete(te);var we=xmp.util.internals.MockTestMode.getInstance();if(we.isActive()){we.overrideMimeType(te);}
if(!this._isStillCurrentNode(te)){return;}
te.getPlayableData().setRuntimeMetadata('history_played',true);ve.handleRender(te);}
else{if(!ue){throw new Error('_renderNode: prevent infinite loop');}
var xe=new xmp.util.Callback('gotAsynchCompleteCallback',this._gotAsynchCompleteCallback,this);ve.handleCompleteAsynch(te,xe);}}
catch(e){this._logger.warn("Error rendering node: "+te.getBestId(),e);try{ve.handleError(te,e);}
catch(e2){this._logger.warn("Error calling handleError for node: "+te.getBestId(),e2);}}};xmp.baseplayer.BasePlayer.prototype._overrideAdRes=function(ye,ze){var pm=ze.getMetadata('__DIRECTIVE_PARAMETER_MAP__',xmp.util.internals.MetadataMap.defaultObj);if(pm===xmp.util.internals.MetadataMap.defaultObj){pm=this._getCurCtx('_overrideAdRes')._xmpPlayList._getParameterMapInternal().clone();pm.addContextObject('node',ze.getNodeType().getDataObject());}
var Ae=new xmp.playlistapi.AdResourceOverrideContext(ze,pm);ye.handleOverrideAdResources(ze,Ae);};xmp.baseplayer.BasePlayer.prototype.registerRuleClass=function(Be,Ce){this._getCurCtx('registerRuleClass').registerRuleClass(Be,Ce);};xmp.baseplayer.BasePlayer.prototype._checkXmpState=function(){if(xmp.baseplayer.BasePlayer._fatalException!==null){throw new Error('XMP in bad state: '+xmp.extractErrorMessage(xmp.baseplayer.BasePlayer._fatalException));}};xmp.baseplayer.BasePlayer.prototype._raiseFatalException=function(e){try{var De=null;if(e instanceof xmp.FatalException){De=e;}
else{De=xmp.FatalException.createFatalException(xmp.XmpErrorCodes.FATAL_UNSPECIFIED_ERROR,'BasePlayer',xmp.extractErrorMessage(e));}
xmp.baseplayer.BasePlayer._fatalException=De;this._logger.fatal('fatal exception',De);this.handleFatalException(De);}
catch(secondE){xmp.showFatalErrorMessage('Second chance exception while raising fatal exception: '+xmp.extractErrorMessage(secondE));}};xmp.baseplayer.BasePlayer._staticHandleFatalEx=function(cb,e){if(xmp.baseplayer.BasePlayer._singleInstance!==null){xmp.baseplayer.BasePlayer._singleInstance._raiseFatalException(e);}
else{xmp.showFatalErrorMessage(xmp.extractErrorMessage(e));}};xmp.fatalErrorCallback=new xmp.util.Callback('BasePlayer_fatalErrorCallback',xmp.baseplayer.BasePlayer._staticHandleFatalEx,null);xmp.baseplayer.BasePlayer.prototype.handleBootstrappedInternal=function(ex){xmp.baseplayer.BasePlayer._fatalException=null;if(ex===null){try{this._doAfterBootstrap();}
catch(afterEx){this._raiseFatalException(afterEx);ex=afterEx;}}
else{this._raiseFatalException(ex);}
this.handleBootstrapped((ex===null)?true:false);};xmp.baseplayer.BasePlayer.prototype._doAfterBootstrap=function(){this._initServices(this._options);};xmp.baseplayer.BasePlayer.prototype.seek=function(){var Ee=this.getMediaPlayer().getPosition();var Fe=this.getMediaPlayer().getDuration();if((Ee+10)>Fe){if((Ee-10)<0){this.getMediaPlayer().seek(0);}
else{this.getMediaPlayer().seek(Ee-10);}}
else{this.getMediaPlayer().seek(Ee+10);}};xmp.baseplayer.BasePlayer.prototype.setVolume=function(){var Ge=this.getMediaPlayer().getVolume();if((Ge+10)>100){Ge=0;}
else{Ge=Ge+10;}
this.getMediaPlayer().setVolume(Ge);};xmp.baseplayer.BasePlayer.prototype.play=function(){this.getMediaPlayer().getViewport().hideOverlays(xmp.ALL_OVERLAYS);this.getMediaPlayer().play();};xmp.baseplayer.BasePlayer.prototype.pause=function(){this.getMediaPlayer().pause();};xmp.baseplayer.BasePlayer.prototype.stop=function(){this.getMediaPlayer().stop();};xmp.createNamespace("xmp.baseplayer");xmp.baseplayer.EmbeddedConsoleLoggerListener=function(He,Ie,Je,Ke,Le,Me){if(xmp.baseplayer.EmbeddedConsoleLoggerListener._instance!==null){throw new Error('Can have only one instance of EmbeddedConsoleLoggerListener.');}
xmp.baseplayer.EmbeddedConsoleLoggerListener.ctor.call(this,He);xmp.baseplayer.EmbeddedConsoleLoggerListener._instance=this;this._ID_PREFIX='xmp_ec_';var Ne=xmp.util.Logger.getInstance();Ne.addListener(this);Ne.setCategoryFilterArray(Ie);this._consoleDivContainerId=(Me)?Me:null;this._consoleVisible=Je;this._logAreaVisible=true;this._logAreaDims={};this._logAreaDims.h=Ke;this._logAreaDims.w=Le;this._messageQueue=[];this._createLogArea();this.showConsole(this._consoleVisible);};xmp.DERIVE_CLASS(xmp.util.AbstractLoggerListener,xmp.baseplayer.EmbeddedConsoleLoggerListener);xmp.baseplayer.EmbeddedConsoleLoggerListener.create=function(Oe){var Pe=xmp.util.LogLevels.fromString(xmp.getQueryArgOpt('xmpLog','none'));if(Pe===xmp.util.LogLevels.NONE){return null;}
var Qe=new xmp.baseplayer.EmbeddedConsoleLoggerListener(Pe,Oe.exCats,(Pe!==xmp.util.LogLevels.NONE),Oe.h,Oe.w,Oe.cId);return Qe;};xmp.baseplayer.EmbeddedConsoleLoggerListener._instance=null;xmp.baseplayer.EmbeddedConsoleLoggerListener.getInstance=function(){return xmp.baseplayer.EmbeddedConsoleLoggerListener._instance;};xmp.baseplayer.EmbeddedConsoleLoggerListener.prototype.showConsole=function(Re){this._consoleVisible=Re;var Se=window.document.getElementById(this._consoleDivContainerId);if(Se){Se.style.display=this._consoleVisible?'block':'none';}};xmp.baseplayer.EmbeddedConsoleLoggerListener.prototype.isConsoleVisible=function(){return this._consoleVisible;};xmp.baseplayer.EmbeddedConsoleLoggerListener.prototype.clearLogOutput=function(){var Te=window.document.getElementById(this._ID_PREFIX+'log_output_area');if(Te){Te.innerHTML='';}};xmp.baseplayer.EmbeddedConsoleLoggerListener.prototype.toggleLogOutput=function(){var Ue=window.document.getElementById(this._ID_PREFIX+'log_output_area_scroll_clip');if(Ue){this._logAreaVisible=!this._logAreaVisible;Ue.style.display=this._logAreaVisible?'block':'none';}};xmp.baseplayer.EmbeddedConsoleLoggerListener.prototype.handleLogMessage=function(Ve,We,Xe){try{var Ye='<span class="'+this._ID_PREFIX+xmp.util.LogLevels.stringify(Ve)+'_message">'+We+': '+xmp.escapeHtml(Xe,true,true)+'</span>';this._messageQueue.push(Ye);while(this._messageQueue.length>25){this._messageQueue.shift();}
var Ze=window.document.getElementById(this._ID_PREFIX+'log_output_area');if(Ze){while(this._messageQueue.length>0){var $e=this._messageQueue.shift();var p=window.document.createElement('P');p.innerHTML=$e;Ze.appendChild(p);}
var af=window.document.getElementById(this._ID_PREFIX+'log_output_area_scroll_clip');if(af){af.scrollTop=af.scrollHeight;}}}
catch(e){this._handleInternalError('Error in xmp.baseplayer.EmbeddedConsoleLoggerListener.handleLogMessage: '+xmp.extractErrorMessage(e));}};xmp.baseplayer.EmbeddedConsoleLoggerListener.prototype._handleInternalError=function(bf){xmp.showMessage(bf);};xmp.baseplayer.EmbeddedConsoleLoggerListener.prototype._createLogArea=function(){var cf=null;if(this._consoleDivContainerId===null){this._consoleDivContainerId=this._ID_PREFIX+'DebugConsole';cf=window.document.createElement('div');cf.style.display='none';cf.id=this._consoleDivContainerId;xmp.insertDomChildBefore(window.document.body,cf);}
cf=window.document.getElementById(this._consoleDivContainerId);if(cf){cf.innerHTML=this._buildConsoleInnerHtml();}};xmp.baseplayer.EmbeddedConsoleLoggerListener.prototype._buildConsoleInnerHtml=function(){var df='BORDER-RIGHT: #000000 1px solid; BORDER-TOP: #000000 1px solid; BORDER-LEFT: #000000 1px solid; BORDER-BOTTOM: #000000 1px solid; display: block; position:absolute; overflow:auto';df+=('; width:'+this._logAreaDims.w+'px');df+=('; height:'+this._logAreaDims.h+'px');var ih='';ih+='<div style="text-align:left; background-color:white; color:black; font-size: medium;">\n';if(xmp.addDynamicStyle('.'+this._ID_PREFIX+'fatal_message','{ font-weight: bold; color: #FF0000}')){xmp.addDynamicStyle('.'+this._ID_PREFIX+'critical_message','{ font-weight: bold; color: #FF0000}');xmp.addDynamicStyle('.'+this._ID_PREFIX+'warn_message','{ color: #FF0000}');xmp.addDynamicStyle('.'+this._ID_PREFIX+'info_message','{color: #009966}');xmp.addDynamicStyle('.'+this._ID_PREFIX+'debug_message','{color: #0000FF}');}
else{ih+='<style>\n';ih+='.'+this._ID_PREFIX+'fatal_message { font-weight: bold; color: #FF0000}\n';ih+='.'+this._ID_PREFIX+'critical_message { font-weight: bold; color: #FF0000}\n';ih+='.'+this._ID_PREFIX+'warn_message { color: #FF0000}\n';ih+='.'+this._ID_PREFIX+'info_message { color: #009966}\n';ih+='.'+this._ID_PREFIX+'debug_message { color: #0000FF}\n';ih+='</style>\n';}
ih+='<br>\n';ih+='<b>Logging</b>&nbsp;&nbsp;<INPUT TYPE="button" ID="'+this._ID_PREFIX+'ShowHideLogButton" VALUE="Show/Hide Log" onClick="xmp.baseplayer.EmbeddedConsoleLoggerListener.getInstance().toggleLogOutput();"\n';ih+='NAME="'+this._ID_PREFIX+'ShowHideLogButton"> &nbsp; <INPUT TYPE="button" ID="'+this._ID_PREFIX+'ClearLogButton" VALUE="Clear Log" onClick="xmp.baseplayer.EmbeddedConsoleLoggerListener.getInstance().clearLogOutput()"\n';ih+='NAME="'+this._ID_PREFIX+'ClearLogButton">&nbsp;&nbsp;\n';ih+='<br><i>(Log messages are color coded:\n';ih+='<span class="'+this._ID_PREFIX+'fatal_message">Fatal</span>\n';ih+='-\n';ih+='<span class="'+this._ID_PREFIX+'critical_message">Critical</span>\n';ih+='-\n';ih+='<span class="'+this._ID_PREFIX+'warn_message">Warning</span>\n';ih+='-\n';ih+='<span class="'+this._ID_PREFIX+'info_message">Information</span>\n';ih+='-\n';ih+='<span class="'+this._ID_PREFIX+'debug_message">Debug</span>)\n';ih+='</i>\n';ih+='<br>\n';ih+='<br>\n';ih+='<div id="'+this._ID_PREFIX+'log_output_area_scroll_clip" style="'+df+'">\n';ih+='<div id="'+this._ID_PREFIX+'log_output_area">\n';ih+='</div>\n';ih+='</div>\n';ih+='</div>\n';return ih;};xmp.createNamespace("xmp.baseplayer");xmp.baseplayer.ErrorLoggerListener=function(ef){xmp.baseplayer.ErrorLoggerListener.ctor.call(this,ef);};xmp.DERIVE_CLASS(xmp.util.AbstractLoggerListener,xmp.baseplayer.ErrorLoggerListener);xmp.baseplayer.ErrorLoggerListener.prototype.handleLog=function(ff,gf,hf,jf){if(ff>xmp.util.LogLevels.FATAL&&ff<=this.getLogLevel()){this.handleLogError(ff,gf,hf,jf);}};xmp.baseplayer.ErrorLoggerListener.prototype.handleLogError=function(kf,lf,mf,nf){try{var of=xmp.FatalException.createFatalException(xmp.XmpErrorCodes.FATAL_UNSPECIFIED_ERROR,'BasePlayer',xmp.extractErrorMessage(nf));xmp.baseplayer.BasePlayer._fatalException=of;if(nf instanceof xmp.baseplayer.ApplicationError){this.showError(mf,nf);}
xmp.util.Logger.getInstance().fatal("ErrorLogger",mf,nf);}
catch(secondE){xmp.showFatalErrorMessage('Second chance exception while raising fatal exception: '+xmp.extractErrorMessage(secondE));}};xmp.baseplayer.ErrorLoggerListener.prototype.showError=function(pf,qf){if(pf===null||pf===undefined){pf="Unknown error";}
var rf=pf;var sf="";if(qf instanceof xmp.baseplayer.ApplicationError){rf=qf.message;var ie=qf.getInnerError();if(ie!==null&&ie!==undefined){sf=ie.message;}}
if(xmp.isFirefoxBrowser()){this.showErrorFirefox(rf,sf);}
else{this.showErrorIE(rf,sf);}};xmp.baseplayer.ErrorLoggerListener.prototype.showErrorFirefox=function(tf,uf){var re=/[\n\f\r]/gm;tf=tf.replace(re,'<br/>');uf=uf.replace(re,'<br/>');var vf="width=500,height=400,toolbar=0,";vf+="status=0,menubar=0,scrollbars=1,resizable=0";var wf=window.open("","",vf);var xf=wf.document;xf.open();xf.writeln("<html><head>");xf.writeln("<title>Error</title>");xf.writeln("<script type='text/javascript'>");xf.writeln("var showDetails = function()");xf.writeln("{");xf.writeln("  document.getElementById('mode').value = 'Hide Details';");xf.writeln("  document.getElementById('details').innerHTML = '"+uf+"';");xf.writeln("}");xf.writeln("var hideDetails = function()");xf.writeln("{");xf.writeln("  document.getElementById('mode').value = 'Show Details';");xf.writeln("  document.getElementById('details').innerHTML = '';");xf.writeln("}");xf.writeln("var showHideDetails = function()");xf.writeln("{");xf.writeln("  var mv = document.getElementById('mode').value;");xf.writeln("  if (mv === 'Show Details')");xf.writeln("    showDetails();");xf.writeln("  else");xf.writeln("    hideDetails();");xf.writeln("}");xf.writeln("</script>");xf.writeln("</head><body onblur='window.focus();'>");xf.writeln("<p style='color:red'><b>"+tf+"</b></p>");xf.writeln("<fieldset>");xf.writeln("<legend><input type=button id=mode value='Show Details' onclick='showHideDetails();' /></legend>");xf.writeln("<div id=details></div>");xf.writeln("</fieldset>");xf.writeln("<p align=right><input type=button value=Close onclick='window.close();' /></p>");xf.writeln("</body></html>");xf.close();};xmp.baseplayer.ErrorLoggerListener.prototype.showErrorIE=function(yf,zf){xmp.showMessage(yf);};xmp.createNamespace("xmp.baseplayer");xmp.baseplayer.InstrumentationLoggerListener=function(Af){var Bf=Math.min(xmp.util.LogLevels.CRITICAL,Af);xmp.baseplayer.InstrumentationLoggerListener.ctor.call(this,Bf);this._handler=new xmp.baseplayer.InstrumentationLoggerListener._HttpPostHandler();};xmp.DERIVE_CLASS(xmp.util.AbstractLoggerListener,xmp.baseplayer.InstrumentationLoggerListener);xmp.baseplayer.InstrumentationLoggerListener.prototype.handleLog=function(Cf,Df,Ef,Ff){if(Cf<=this.getLogLevel()){this.handleLogError(Cf,Df,Ff);}};xmp.baseplayer.InstrumentationLoggerListener.prototype.handleLogMessage=function(Gf,Hf,If){};xmp.baseplayer.InstrumentationLoggerListener.prototype.handleLogError=function(Jf,Kf,Lf){this._handler.log(xmp.util.PlayerStats.getInstance(),Lf);};xmp.baseplayer.InstrumentationLoggerListener._HttpPostHandler=function(){var Mf=xmp.util.SettingsManager.getInstance().getGlobalContextNode();var Nf=Mf.getNodeForPath('Instrumentation');this._maxPostsPerSession=Nf.getInt('maxPostsPerSession',1);this._numPosts=0;this._postUrl=Nf.getString('postUrl','');this._reportingDiv=null;};xmp.baseplayer.InstrumentationLoggerListener._HttpPostHandler.prototype.createHiddenForm=function(Of,Pf){if(this._postUrl.length>0){var Qf=this.assembleReport(Of,Pf);var Rf=window.document.createElement('div');Rf.style.display='none';window.document.body.insertBefore(Rf,null);var Sf='post';var Tf="<form name='xmp_fatalErrorReportingForm' id='xmp_fatalErrorReportingForm' target='xmp_fatalErrorReportingFormIFrame' ";Tf+=("action='"+this._postUrl+"' ");Tf+=("method='"+Sf+"' ");Tf+=(">");for(var Uf=xmp.MapIterator.create(Qf);Uf.hasNext();Uf.next()){var Vf=Uf.currentKey();var Wf=Uf.currentValue();Tf+=("<input type='hidden' id='"+Vf+"' name='"+Vf+"' value='"+Wf+"'/>");}
Tf+=("</form><iframe id='xmp_fatalErrorReportingFormIFrame' name='xmp_fatalErrorReportingFormIFrame'/>");Rf.innerHTML=Tf;this._reportingDiv=Rf;}};xmp.baseplayer.InstrumentationLoggerListener._HttpPostHandler.prototype.populateHiddenForm=function(Xf,Yf){var Zf=window.document.xmp_fatalErrorReportingForm;var $f=this.assembleReport(Xf,Yf);for(var ag=xmp.MapIterator.create($f);ag.hasNext();ag.next()){var bg=ag.currentKey();var cg=ag.currentValue();Zf[bg].value=cg;}};xmp.baseplayer.InstrumentationLoggerListener._HttpPostHandler.prototype.log=function(dg,eg){if(this._numPosts>=this._maxPostsPerSession){return;}
this._numPosts++;if(this._reportingDiv===null){this.createHiddenForm(dg,eg);}
else{this.populateHiddenForm(dg,eg);}
if(this._reportingDiv){var fg=window.document.xmp_fatalErrorReportingForm;fg.submit();}};xmp.baseplayer.InstrumentationLoggerListener._HttpPostHandler.prototype.assembleReport=function(gg,hg){var ig={};ig.timestamp=((new Date()).getTime()).toString();ig.reason=this._extractErrorCode(hg).toString();ig.detail=hg.message;var jg=gg.getKeys();for(var i=0;i<jg.length;++i){var kg=jg[i];var lg=gg.getValue(kg);ig[kg.toLowerCase()]=lg;}
return ig;};xmp.baseplayer.InstrumentationLoggerListener._HttpPostHandler.prototype._extractErrorCode=function(mg){if(mg instanceof xmp.FatalException){return mg.getFatalErrorCode();}
if(mg instanceof xmp.CriticalException){return mg.getCriticalErrorCode();}
return xmp.XmpErrorCodes.NONE;};xmp.createNamespace("xmp.baseplayer");xmp.baseplayer.MetaFileLoaderFactory=function(){this._loaderIdCount=0;this._map={};this._loaderCtorMap={};this._addLoaderCtors();};xmp.baseplayer.MetaFileLoaderFactory._singeltonInstance=null;xmp.baseplayer.MetaFileLoaderFactory.getInstance=function(){if(xmp.baseplayer.MetaFileLoaderFactory._singeltonInstance===null){xmp.baseplayer.MetaFileLoaderFactory._singeltonInstance=new xmp.baseplayer.MetaFileLoaderFactory();}
return xmp.baseplayer.MetaFileLoaderFactory._singeltonInstance;};xmp.baseplayer.MetaFileLoaderFactory.prototype.create=function(ng){var og=this._createInternal(ng);this._map[og.getLoaderId()]=og;return og;};xmp.baseplayer.MetaFileLoaderFactory.prototype._createInternal=function(pg){this._loaderIdCount++;var id=this._loaderIdCount.toString();var qg=this._loaderCtorMap[pg];if(!qg){throw new Error('Unrecognized serializer type: '+pg);}
var rg=xmp.getNamespacedMethod(qg);var sg=new rg(this,id);return sg;};xmp.baseplayer.MetaFileLoaderFactory.prototype._release=function(tg){if(typeof this._map[tg.getLoaderId()]!=='undefined'){delete this._map[tg.getLoaderId()];}};xmp.baseplayer.MetaFileLoaderFactory.prototype._addLoaderCtors=function(){var ug=xmp.util.SettingsManager.getInstance().getGlobalContextNode().getNodeForPath('loaders');var vg=ug.retrieveChildrenNames();for(var i=0;i<vg.length;i++){var wg=vg[i];var xg=ug.getNodeForPath(wg);var yg=xg.getString('JSClass','');this._loaderCtorMap[wg]=yg;}};xmp.createNamespace("xmp.baseplayer");xmp.baseplayer.PlayListMod=function(zg,id){this._id=id;this._action=zg;xmp.baseplayer.PlayListMod._staticCounter++;this._modNum=xmp.baseplayer.PlayListMod._staticCounter;};xmp.baseplayer.PlayListMod._staticCounter=0;xmp.baseplayer.PlayListMod.prototype.getModNum=function(){return this._modNum;};xmp.baseplayer.PlayListMod.prototype.getId=function(){return this._id;};xmp.baseplayer.PlayListMod.prototype.getAction=function(){return this._action;};xmp.createNamespace("xmp.baseplayer");xmp.baseplayer.TriggerContext=function(){this._triggerType='';this._commandData='';this._metadataMap=new xmp.util.internals.MetadataMap(false);this._node=null;};xmp.baseplayer.TriggerContext.prototype.getTriggerType=function(){return this._triggerType;};xmp.baseplayer.TriggerContext.prototype.setTriggerType=function(Ag){this._triggerType=(Ag)?Ag:'';};xmp.baseplayer.TriggerContext.prototype.getCommandData=function(){return this._commandData;};xmp.baseplayer.TriggerContext.prototype.setCommandData=function(Bg){this._commandData=(Bg)?Bg:'';};xmp.baseplayer.TriggerContext.prototype.getPlayableNode=function(){return this._node;};xmp.baseplayer.TriggerContext.prototype.setPlayableNode=function(Cg){this._node=(Cg)?Cg:null;};xmp.baseplayer.TriggerContext.prototype.getMetadata=function(Dg,Eg){return this._metadataMap._get(Dg,Eg);};xmp.baseplayer.TriggerContext.prototype.setMetadata=function(Fg,Gg){this._metadataMap._set(Fg,Gg);};xmp.createNamespace("xmp.baseplayer");xmp.baseplayer._NLMap=function(Hg){this._player=Hg;this._nodeListernerMap={};this._frameworkListenerMap={};this._frameworkListenerMap.adLoader=new xmp.baseplayer.listeners.internal.AdLoaderNodeListener(this._player);this._frameworkListenerMap.nonAdLoader=new xmp.baseplayer.listeners.internal.NonAdLoaderNodeListener(this._player);this._frameworkListenerMap.promoLoader=new xmp.baseplayer.listeners.internal.PromoLoaderNodeListener(this._player);this._frameworkListenerMap.tracking=new xmp.baseplayer.listeners.internal.TrackingNodeListener(this._player);this._frameworkListenerMap.metering=new xmp.baseplayer.listeners.internal.MeteringNodeListener(this._player);this._frameworkListenerMap.firstFrame=new xmp.baseplayer.listeners.internal.FirstFrameNodeListener(this._player);this._frameworkListenerNameMap={};this._frameworkListenerNameMap.Ad=['adLoader','metering','firstFrame'];this._frameworkListenerNameMap.Promo=['promoLoader','firstFrame'];this._frameworkListenerNameMap.Content=['nonAdLoader','tracking','firstFrame'];this._frameworkListenerNameMap.DEFAULT=['nonAdLoader'];this._registrationArray=[];};xmp.baseplayer._NLMap.prototype._getNodeListener=function(Ig){var Jg=this._nodeListernerMap[Ig.getNodeTypeName()];if(!Jg){Jg=this._createCompositeNodeListener(Ig.getNodeTypeName());this._nodeListernerMap[Ig.getNodeTypeName()]=Jg;}
return Jg;};xmp.baseplayer._NLMap.prototype._registerNodeListener=function(Kg,Lg){xmp.validateArguments(arguments,[xmp.OBJECT_TYPE,xmp.OBJECT_TYPE],"_NLMap.registerNodeListener");if(!Kg||!Lg||(Lg.length===0)){throw new xmp.util.internals.InvalidArgsError("The 'listener' argument must be non-null, and the 'nodeTypeArray' argument must be non-null and non-empty.");}
for(var i=0;i<Lg.length;i++){var Mg=Lg[i];if(!(typeof Mg==='string'&&Mg.length>0)){throw new xmp.util.internals.InvalidArgsError("The 'nodeTypeArray' argument must be an array of non-empty strings.");}}
this._registrationArray.push({l:Kg,nta:Lg});};xmp.baseplayer._NLMap.prototype._getFrameworkListeners=function(Ng){var Og=[];var Pg=xmp.playlistapi.PlayableNodeType.getBaseNodeTypeName(Ng);var Qg=this._frameworkListenerNameMap[Pg];for(var i=0;i<Qg.length;i++){var Rg=Qg[i];var Sg=this._frameworkListenerMap[Rg];Og.push(Sg);}
return Og;};xmp.baseplayer._NLMap.prototype._getVerticalListeners=function(Tg){var Ug=[];for(var i=0;i<this._registrationArray.length;i++){var Vg=this._registrationArray[i];var Wg=Vg.l;var Xg=Vg.nta;for(var j=0;j<Xg.length;j++){var Yg=Xg[j];if((Yg==='*')||(Yg===Tg)){Ug.push(Wg);}}}
return Ug;};xmp.baseplayer._NLMap.prototype._getAndCheckVerticalListeners=function(Zg){var $g=this._getVerticalListeners(Zg);if($g.length===0){throw new xmp.util.internals.InvalidArgsError('No vertical node listener registered for node type: '+Zg);}
return $g;};xmp.baseplayer._NLMap.prototype._validateListeners=function(ah,bh){for(var i=0;i<bh.length;i++){var ch=bh[i];for(var j=i+1;j<bh.length;j++){var dh=bh[j];if(ch===dh){throw new xmp.util.internals.InvalidArgsError('Same listener registered more than once for node type: '+ah);}}}};xmp.baseplayer._NLMap.prototype._createCompositeNodeListener=function(eh){var fh=this._getFrameworkListeners(eh);fh=fh.concat(this._getAndCheckVerticalListeners(eh));this._validateListeners(eh,fh);var gh=new xmp.baseplayer.listeners.CompositeNodeListener(this._player);for(var i=0;i<fh.length;i++){gh.addChild(fh[i]);}
return gh;};xmp.createNamespace("xmp.baseplayer");xmp.baseplayer._PDMapArray=function(){this._array=[];this._map={};};xmp.baseplayer._PDMapArray.prototype.insert=function(hh,jh){if(hh>=this.getCount()){this._array.push(jh);}
else{this._array.splice(hh,0,jh);}
this._map[jh.getMetaResourceId()]=jh;};xmp.baseplayer._PDMapArray.prototype.removeAll=function(){this._array=[];this._map={};};xmp.baseplayer._PDMapArray.prototype.remove=function(kh){var lh=this._array.splice(kh,1)[0];delete this._map[lh.getMetaResourceId()];return lh;};xmp.baseplayer._PDMapArray.prototype.move=function(mh,nh){var oh=this.remove(mh);this.insert(nh,oh);};xmp.baseplayer._PDMapArray.prototype.getCount=function(){return this._array.length;};xmp.baseplayer._PDMapArray.prototype.getAtIndex=function(ph){return this._array[ph];};xmp.baseplayer._PDMapArray.prototype.findItem=function(id){var qh=this._map[id];return(!qh)?null:qh;};xmp.baseplayer._PDMapArray.prototype.findItemIndex=function(id){var rh=this.getCount();for(var i=0;i<rh;i++){if(this.getAtIndex(i).getMetaResourceId()===id){return i;}}
return-1;};xmp.baseplayer._PDMapArray.prototype.extractIdArray=function(sh){var th=[];for(var i=sh;i<this._array.length;i++){var uh=this._array[i];th.push(uh.getMetaResourceId());}
return th;};xmp.createNamespace("xmp.baseplayer");xmp.baseplayer._PLCtx=function(vh,wh,xh,yh){this._AD_PATTERN_CALL_BACK='adPatternCB';this._key=vh;this._owner=wh;this._logger=this._owner._logger;this._latch=null;this._advanceToId="";this._pdMapArray=new xmp.baseplayer._PDMapArray();this._xmpPlayList=null;this._ruleMap=null;this._currentNode=null;this._currentContentNode=null;this._previousNode=null;this._stateListener=null;this._initPlayListData={p:yh,ira:[]};this._modArray=[];this.init(xh);};xmp.baseplayer._PLCtx._staticCbCounter=0;xmp.baseplayer._PLCtx.prototype.debugPrint=function(zh){var Ah=zh+": ";Ah+="key = "+this._key+"; ";Ah+="owner = "+this._owner.getId()+"; ";Ah+="advanceToId = "+this._advanceToId+"; ";Ah+="currently rendering node = "+xmp.util.PlayableNode.safeGetBestId(this._currentNode)+"; ";Ah+="current content node = "+xmp.util.PlayableNode.safeGetBestId(this._currentContentNode)+"; ";Ah+="current playing index = "+this._getCurrentlyPlayingItemIndex()+"; ";this._logger.debug(Ah);};xmp.baseplayer._PLCtx.prototype.getLookAheadNodeArray=function(){return this._xmpPlayList.getLookAheadNodeArray();};xmp.baseplayer._PLCtx.prototype.getLookBehindNodeArray=function(){return this._xmpPlayList.getLookBehindNodeArray();};xmp.baseplayer._PLCtx.prototype.init=function(Bh){xmp.validateArguments(arguments,[xmp.STRING_TYPE],"_PLCtx.init");try{var Ch=new xmp.util.Callback('masterCB',this._latchComplete,this);this._latch=new xmp.util.Latch([],Ch);this._ruleMap=new xmp.baseplayer._RuleMap(this._latch,this);this._initPlayListData.ira=this._ruleMap._loadInvariantRules();this._loadAdPattern(Bh);this._ruleMap._loadRuleImplementations();}
catch(e){this._logger.warn('Error in init',e);throw e;}};xmp.baseplayer._PLCtx.prototype.loadContent=function(Dh,Eh){xmp.validateArguments(arguments,[xmp.OBJECT_TYPE,xmp.STRING_TYPE],"_PLCtx.loadContent");try{var Fh=[];var Gh={};for(var i=0;i<Dh.length;i++){var Hh=Dh[i];if(!xmp.isNonEmptyString(Hh)){throw new xmp.util.internals.InvalidArgsError("The 'mridArray' argument must contain only non-empty strings.");}
if(typeof(Gh[Hh])!=='undefined'){this._logger.info('Dropping duplicate content ID: '+Hh);continue;}
Gh[Hh]=Hh;Fh.push(Hh);}
Dh=Fh;if(Dh.length===0){throw new xmp.util.internals.InvalidArgsError("The 'mridArray' argument must contain at least one unique id.");}
if(Eh.length===0){Eh=Dh[0];}
if(typeof(Gh[Eh])==='undefined'){throw new xmp.util.internals.InvalidArgsError("The 'startResourceId' argument must be empty or refer to an id in 'mridArray'.");}
this._advanceToId=Eh;this._pdMapArray.removeAll();return this.handleLoadContent('loadContent','Batch',Dh,0);}
catch(e){this._logger.warn('Error in loadContent',e);throw e;}};xmp.baseplayer._PLCtx.prototype.handleLoadContent=function(Ih,id,Jh,Kh){var cb=this._createPLModCbObj(Ih,id);this._latch.addCbName(cb.getId());var Lh=xmp.baseplayer.MetaFileLoaderFactory.getInstance().create('videoContentMeta');var Mh=Lh.setIds(Jh,null);Lh.setAllLoadedCallback(cb);for(var i=0;i<Mh.length;i++){var Nh=Mh[i];Nh.reInitRuntimeMetadata();this._pdMapArray.insert(Kh+i,Nh);}
Lh.load();return cb.getMetadata('_modNum',0);};xmp.baseplayer._PLCtx.prototype.getKey=function(){return this._key;};xmp.baseplayer._PLCtx.prototype.setStateListener=function(Oh){this._stateListener=Oh;};xmp.baseplayer._PLCtx.prototype.appendToPlayList=function(Ph,Qh){var Rh=null;var Sh=this.getPlayListItemCount();if(Sh>0){Rh=this.getPlayListItem(Sh-1).getMetaResourceId();}
return this.insertInPlayListEx('append',Ph,Rh,Qh);};xmp.baseplayer._PLCtx.prototype.removeFromPlayList=function(Th){var Uh=this.findPlayListItemIndex(Th);if(Uh<0){return-1;}
this._pdMapArray.remove(Uh);return this._doLatchAsynch('remove',Th);};xmp.baseplayer._PLCtx.prototype.insertInPlayList=function(Vh,Wh,Xh){return this.insertInPlayListEx('insert',Vh,Wh,Xh);};xmp.baseplayer._PLCtx.prototype.insertInPlayListEx=function(Yh,Zh,$h,ai){var bi=this._validateInsertAndMoveArgs(Zh,$h,ai,false);if(ai||!this._isRunning()){this._advanceToId=Zh;}
return this.handleLoadContent(Yh,Zh,[Zh],bi.a+1);};xmp.baseplayer._PLCtx.prototype.moveWithinPlayList=function(ci,di,ei){var fi=this._validateInsertAndMoveArgs(ci,di,ei,true);var gi=fi.a;if(fi.a<fi.i){gi++;}
this._pdMapArray.move(fi.i,gi);if(ei){this._advanceToId=ci;}
return this._doLatchAsynch('move',ci);};xmp.baseplayer._PLCtx.prototype.setCurrentPlayListItem=function(hi){var ii=this.findPlayListItemIndex(hi);if(ii<0){throw new xmp.util.internals.InvalidArgsError("The 'mrid' argument must refer to an exising playlist item.");}
this._advanceToId=hi;return this._doLatchAsynch('setCur',hi);};xmp.baseplayer._PLCtx.prototype.getCurrentPlayListItem=function(){var ji=this._currentNode;if(this._isValidNode(ji)){if(ji.isContentType()){return ji.getPlayableData().getMetaResourceId();}
else{var a=this.getLookAheadNodeArray();for(var i=0;i<a.length;i++){var ki=a[i];if(ki.isContentType()){return ki.getPlayableData().getMetaResourceId();}}}}
return'';};xmp.baseplayer._PLCtx.prototype.getPlayListItemCount=function(){return this._pdMapArray.getCount();};xmp.baseplayer._PLCtx.prototype.getPlayListItem=function(li){return this._pdMapArray.getAtIndex(li);};xmp.baseplayer._PLCtx.prototype.findPlayListItem=function(mi){return this._pdMapArray.findItem(mi);};xmp.baseplayer._PLCtx.prototype.findPlayListItemIndex=function(ni){return this._pdMapArray.findItemIndex(ni);};xmp.baseplayer._PLCtx.prototype.registerRuleClass=function(oi,pi){this._ruleMap.registerRuleClass(oi,pi);this._xmpPlayList.addRuleFactory(oi,this._ruleMap);};xmp.baseplayer._PLCtx.prototype._loadAdPattern=function(qi){var cb=new xmp.util.Callback(this._AD_PATTERN_CALL_BACK,this._adPatternCb,this);this._latch.addCbName(cb.getId());xmp.net.AjaxRequestManager.getInstance().request(qi,cb,'adPolicy',qi,xmp.net.ContentTypes.JSON,null);};xmp.baseplayer._PLCtx.prototype._adPatternCb=function(cb,ri){var si=null;if(ri.isError()){si={e:ri.getErrorObject(),j:null};var ti=new xmp.baseplayer.ApplicationError(ri.getErrorObject(),'FailToGetAdPattern',null,[{label:"Url",text:ri.getFullUrl()}]);this._logger.warn(ti.message,ti);}
else{si={e:null,j:ri.getJsonObject()};}
this._latch.called(cb.getId(),si);if(this._logger.isDebugEnabled()){this._logger.debug("_PLCtx._adPatternCb");}};xmp.baseplayer._PLCtx.prototype._PLModCb=function(cb){this._latch.called(cb.getId(),null);if(this._logger.isDebugEnabled()){this._logger.debug("_PLCtx._PLModCb: "+cb.getId());}};xmp.baseplayer._PLCtx.prototype._latchComplete=function(cb){if(!this._xmpPlayList){var ui=cb.getMetadata(this._AD_PATTERN_CALL_BACK,{});this._initXmpPlayList(ui);}
var vi=this._isRunning();var wi=this._getCurrentlyPlayingItemIndex();if(this._logger.isDebugEnabled()){var xi='Latch Complete, run state = '+this._calcRunState()+', count = '+this.getPlayListItemCount()+', current index = '+wi+', _advanceToId = '+this._advanceToId;this._logger.debug(xi);}
var yi=this._calcAdvanceToIndex();var zi=-1;if(yi>=0){zi=yi;}
else{if(wi<0&&vi){wi=-1;}
zi=(wi+1);}
if(zi<0){this._logger.warn('Invalid refreshFromIndex, correcting to 0: '+zi);zi=0;}
this._xmpPlayList.setContentMetaResourceIds(this._pdMapArray.extractIdArray(zi));this._xmpPlayList.getIterator().first();if(yi>=0&&this._canAdvance()){this.advance();}
this._notifyPLMods();};xmp.baseplayer._PLCtx.prototype._initXmpPlayList=function(Ai){try{if(Ai.e!==null){throw Ai.e;}
this._xmpPlayList=new xmp.playlistapi.AdPatternPlayList(this,Ai.j,this._initPlayListData.ira,this._initPlayListData.p);var Bi=this._xmpPlayList.getRuleIdArray();this._ruleMap._registerRules(Bi);this._xmpPlayList.loadRuleFactoryArray([this._ruleMap]);}
catch(e){this._logger.warn('Error initializing playlist',e);}};xmp.baseplayer._PLCtx.prototype.getCurrentNode=function(){return this._currentNode;};xmp.baseplayer._PLCtx.prototype.advance=function(){if(this._xmpPlayList.getIterator().hasNext()){var Ci=this._xmpPlayList.getIterator().next();this._previousNode=this._currentNode;if(this._currentNode===null){this._notifyPLStarted();}
this._currentNode=Ci;if(Ci.isContentType()){this._currentContentNode=Ci;}
if(this._stateListener){this._stateListener.onAdvance();}}
else{this._currentNode=null;this._currentContentNode=null;this._notifyPLEnded();}};xmp.baseplayer._PLCtx.prototype._calcAdvanceToIndex=function(){var Di=-1;if(this._advanceToId.length>0){Di=this.findPlayListItemIndex(this._advanceToId);if((Di<0)&&this._logger.isDebugEnabled()){this._logger.debug("_PLCtx._calcAdvanceToIndex: "+this._advanceToId+" is not a valid play list item id; cannot advance to it.");}}
this._advanceToId='';return Di;};xmp.baseplayer._PLCtx.prototype._canAdvance=function(){var Ei=this._isRunning();var Fi=this._currentNode;return(!Ei||(Ei&&this._owner._getNodeListener(Fi).canUserControl(Fi)));};xmp.baseplayer._PLCtx.prototype._isRunning=function(){return this._isValidNode(this._currentNode);};xmp.baseplayer._PLCtx.prototype._isValidNode=function(Gi){return(Gi&&Gi.isValid()&&Gi.getPlayableData());};xmp.baseplayer._PLCtx.prototype.handleInitializePlayableNode=function(Hi){this._owner.handleInitializePlayableNode(Hi);};xmp.baseplayer._PLCtx.prototype._createPLModCbObj=function(Ii,id){xmp.baseplayer._PLCtx._staticCbCounter++;var c=xmp.baseplayer._PLCtx._staticCbCounter.toString();var Ji='PLModCb_'+c+'_'+Ii+':'+id;var cb=new xmp.util.Callback(Ji,this._PLModCb,this);var Ki=new xmp.baseplayer.PlayListMod(Ii,id);cb.setMetadata('_modNum',Ki.getModNum());this._modArray.push(Ki);return cb;};xmp.baseplayer._PLCtx.prototype._doLatchAsynch=function(Li,id){var cb=this._createPLModCbObj(Li,id);this._latch.addCbName(cb.getId());xmp.util.Timer.doSimpleCallback(cb);return cb.getMetadata('_modNum',0);};xmp.baseplayer._PLCtx.prototype._getCurrentlyPlayingItemIndex=function(){var Mi=this._currentContentNode;if(this._isValidNode(Mi)){return this.findPlayListItemIndex(Mi.getPlayableData().getMetaResourceId());}
return-1;};xmp.baseplayer._PLCtx.prototype._getPlayableData=function(Ni){return this.findPlayListItem(Ni);};xmp.baseplayer._PLCtx.prototype._validateInsertAndMoveArgs=function(Oi,Pi,Qi,Ri){var Si={a:-1,i:-1};if(!(xmp.isNonEmptyString(Oi)&&(Pi===null||xmp.isNonEmptyString(Pi)))){throw new xmp.util.internals.InvalidArgsError("The 'mrid' argument must be a non-null, non-empty string, "+"and the 'afterMrid' must EITHER be null OR a a non-null, non-empty string");}
if(Oi===Pi){throw new xmp.util.internals.InvalidArgsError("The 'mrid' argument must NOT be the same value as the 'afterMrid' value.");}
if(typeof(Qi)!=='boolean'){throw new xmp.util.internals.InvalidArgsError("The 'setPos' argument must be of boolean type.");}
if(Pi!==null){Si.a=this.findPlayListItemIndex(Pi);if(Si.a<0){throw new xmp.util.internals.InvalidArgsError("The 'afterMrid' argument must be set to null, or must refer to an exising playlist item.");}}
Si.i=this.findPlayListItemIndex(Oi);if(Ri){if(Si.i<0){throw new xmp.util.internals.InvalidArgsError("The 'mrid' argument must refer to an exising playlist item when moving.");}}
else{if(Si.i>-1){throw new xmp.util.internals.InvalidArgsError("The 'mrid' argument must NOT refer to an exising playlist item when inserting/appending.");}}
return Si;};xmp.baseplayer._PLCtx.prototype._calcRunState=function(){if(this._isRunning()){return'running';}
else{return this._isValidNode(this._previousNode)?'stopped':'never started';}};xmp.baseplayer._PLCtx.prototype._notifyPLStarted=function(){try{this._owner.handlePlayListStarted();}
catch(e){this._logger.warn('Error calling handlePlayListStarted',e);}};xmp.baseplayer._PLCtx.prototype._notifyPLEnded=function(){try{this._owner.handlePlayListEnded();}
catch(e){this._logger.warn('Error calling handlePlayListEnded',e);}};xmp.baseplayer._PLCtx.prototype._notifyPLMods=function(){var Ti=[];Ti=Ti.concat(this._modArray);this._modArray=[];try{this._owner.handlePlayListModified(Ti);}
catch(e){this._logger.warn('Error calling handlePlayListModified',e);}};xmp.createNamespace("xmp.baseplayer");xmp.baseplayer._RuleMap=function(Ui,Vi){this._logger=new xmp.util.internals.CategoryLogger('_RuleMap');this._ruleIdArray=[];this._ruleIdToConstructorMap={};this._latch=Ui;this._player=Vi;};xmp.baseplayer._RuleMap.prototype.registerRuleClass=function(Wi,Xi){if(!(xmp.isNonEmptyString(Wi)&&xmp.isNonEmptyString(Xi))){throw new xmp.util.internals.InvalidArgsError("The 'ruleId' and 'ruleFullyQualifiedConstructor' arguments must be non-null, non-empty strings.");}
if(typeof(this._ruleIdToConstructorMap[Wi])==='undefined'){this._ruleIdArray.push(Wi);this._ruleIdToConstructorMap[Wi]=Xi;}};xmp.baseplayer._RuleMap.prototype._loadInvariantRules=function(){var Yi=xmp.util.SettingsManager.getInstance().getContextNode();if(!Yi.nodeExists('invariantRules')){return[];}
var Zi=Yi.getNodeForPath('invariantRules');var $i=Zi.retrieveKeys();var aj="[";for(var i=0;i<$i.length;i++){var bj=$i[i];aj+=Zi.getString(bj,'');if(i!==($i.length-1)){aj+=",";}}
aj+="]";try{return xmp.net.AjaxRequestManager.getInstance()._parseJson(aj);}
catch(e){this._logger.warn('Error loading invariant rule ids.',e);throw e;}};xmp.baseplayer._RuleMap.prototype._registerRules=function(cj){var dj=xmp.util.SettingsManager.getInstance().getContextNode().getNodeForPath('BasePlayer').getString('rule classes namespace','');for(var i=0;i<cj.length;i++){var ej=cj[i];var fj=ej;if(dj.length>0){fj=(dj+'.'+fj);}
this.registerRuleClass(ej,fj);}};xmp.baseplayer._RuleMap.prototype._loadRuleImplementations=function(){var gj=xmp.util.SettingsManager.getInstance().getContextNode().getNodeForPath('BasePlayer').getString('rule classes relative URL','');var cb=new xmp.util.Callback('getRulesCB',this._ruleImplementationsCb,this);this._latch.addCbName(cb.getId());if(gj==='NONE'){cb.setMetadata('no_rules','true');cb.callAsynch([]);}
else{xmp.net.AjaxRequestManager.getInstance().request(gj,cb,'ruleClasses',gj,xmp.net.ContentTypes.TEXT,null);}};xmp.baseplayer._RuleMap.prototype._ruleImplementationsCb=function(cb,hj){if(cb.getMetadata('no_rules','false')==='true'){this._latch.called(cb.getId(),{e:null});return;}
if(hj.isError()){var ij=new xmp.baseplayer.ApplicationError(hj.getErrorObject(),'RulesNotDownLoaded',null,[{label:"Url",text:hj.getFullUrl()}]);this._logger.warn(ij.message,ij);this._latch.called(cb.getId(),{e:hj.getErrorObject()});}
else{try{xmp.net.AjaxRequestManager.getInstance()._parseJavaScript(hj.getText());this._latch.called(cb.getId(),{e:null});}
catch(e){var kj=(e instanceof Error)?e:new Error('UKNOWN ERROR');this._latch.called(cb.getId(),{e:kj});}}};xmp.baseplayer._RuleMap.prototype.getCreatableRuleIds=function(){return this._ruleIdArray;};xmp.baseplayer._RuleMap.prototype.createRule=function(lj){var mj=this._ruleIdToConstructorMap[lj];if(!mj){return null;}
var nj=xmp.getNamespacedMethod(mj);var oj=new nj(this._player);return oj;};xmp.createNamespace("xmp.baseplayer.internals");xmp.baseplayer.internals.Ad=function(){};xmp.baseplayer.internals.Ad.prototype.buildRelativeURL=function(pj,qj,rj,sj){var tj=xmp.util.SettingsManager.getInstance().getContextNode().getNodeForPath('BasePlayer/Additional segvars').getString(pj,'');var uj='';if(qj>0){uj=this._makeQueryPair('tile',qj);}
uj=this._appendToQuery(uj,rj);uj=this._appendToQuery(uj,tj);uj=this._appendToQuery(uj,sj);return uj;};xmp.baseplayer.internals.Ad.getAdServerRoot=function(){return xmp.util.RootUrlProvider.getInstance().getRootUrl('adServer');};xmp.baseplayer.internals.Ad.getAdManRoot=function(){return xmp.util.RootUrlProvider.getInstance().getRootUrl('adMan');};xmp.baseplayer.internals.Ad.prototype._appendToQuery=function(vj,wj){var xj=vj;if(wj&&wj.length!==0){if(xj.length>0){xj+='&';}
xj+=wj;}
return xj;};xmp.baseplayer.internals.Ad.prototype.setPingImage=function(yj){return xmp.baseplayer.internals.AdMeteringImagePool.getInstance().setPingImage(yj);};xmp.baseplayer.internals.Ad.createCompanionAdId=function(){return Math.floor((new Date()).getTime()/1000);};xmp.baseplayer.internals.Ad.prototype._makeQueryPair=function(zj,Aj){if(!Aj){Aj='';}
return zj+'='+escape(Aj.toString());};xmp.baseplayer.internals.Ad._singeltonInstance=null;xmp.baseplayer.internals.Ad.getInstance=function(){if(xmp.baseplayer.internals.Ad._singeltonInstance===null){xmp.baseplayer.internals.Ad._singeltonInstance=new xmp.baseplayer.internals.Ad();}
return xmp.baseplayer.internals.Ad._singeltonInstance;};xmp.createNamespace("xmp.baseplayer.internals");xmp.baseplayer.internals.AdMeteringImagePool=function(){this._initializedState=-1;this._adMeteringImage='';this._POOL_SIZE=10;this._BASE_IMG_NAME='AdMeteringImg_';};xmp.baseplayer.internals.AdMeteringImagePool._imgPingCounter=-1;xmp.baseplayer.internals.AdMeteringImagePool._singeltonInstance=null;xmp.baseplayer.internals.AdMeteringImagePool.getInstance=function(){if(xmp.baseplayer.internals.AdMeteringImagePool._singeltonInstance===null){xmp.baseplayer.internals.AdMeteringImagePool._singeltonInstance=new xmp.baseplayer.internals.AdMeteringImagePool();}
return xmp.baseplayer.internals.AdMeteringImagePool._singeltonInstance;};xmp.baseplayer.internals.AdMeteringImagePool.prototype.setPingImage=function(Bj){this._init();if(this._initializedState!==1){return'';}
xmp.baseplayer.internals.AdMeteringImagePool._imgPingCounter++;var Cj=xmp.baseplayer.internals.AdMeteringImagePool._imgPingCounter%this._POOL_SIZE;var Dj=this._BASE_IMG_NAME+Cj.toString();var Ej=window.document.images[Dj];if(!Ej){throw new Error('Unexpectded did not find DOM image'+Dj);}
Ej.src=Bj;return Dj;};xmp.baseplayer.internals.AdMeteringImagePool.prototype._init=function(){if(this._initializedState===-1){try{var Fj=xmp.util.SettingsManager.getInstance().getContextNode();var Gj=Fj.getNodeForPath('BasePlayer');this._adMeteringImage=xmp.trimString(Gj.getString('Ad metering image URL',''));if(this._adMeteringImage.length===0){var Hj='Ad metering image URL not specified in primary configuration';throw new Error(Hj);}
var Ij=window.document.createElement('div');Ij.style.display='none';window.document.body.insertBefore(Ij,null);for(var i=0;i<this._POOL_SIZE;i++){var Jj=window.document.createElement('img');Jj.src=this._adMeteringImage;Jj.id=this._BASE_IMG_NAME+i.toString();Jj.name=Jj.id;Jj.alt='';Jj.align='right';Jj.width=Jj.height=Jj.border=Jj.vspace=Jj.hspace=0;Ij.insertBefore(Jj,null);}}
catch(e){xmp.handleFatalError(e);this._initializedState=0;throw e;}
this._initializedState=1;}};xmp.createNamespace("xmp.baseplayer.internals");xmp.baseplayer.internals.DhtmlObjectMetaFileLoader=function(Kj,Lj){xmp.baseplayer.internals.DhtmlObjectMetaFileLoader.ctor.call(this,'dhtmlObject','DhtmlObjectMetaFileLoader',xmp.net.ContentTypes.JSON,'FailToGetDhtmlObject',-1,Kj,Lj);};xmp.DERIVE_CLASS(xmp.baseplayer.internals.GenericMetaFileLoader,xmp.baseplayer.internals.DhtmlObjectMetaFileLoader);xmp.createNamespace("xmp.baseplayer.internals");xmp.baseplayer.internals.ErrorDhtmlObjectMetaFileLoader=function(Mj,Nj){xmp.baseplayer.internals.ErrorDhtmlObjectMetaFileLoader.ctor.call(this,'errorDhtmlObject','ErrorDhtmlObjectMetaFileLoader',xmp.net.ContentTypes.JSON,'FailToGetDhtmlObject',-1,Mj,Nj);};xmp.DERIVE_CLASS(xmp.baseplayer.internals.GenericMetaFileLoader,xmp.baseplayer.internals.ErrorDhtmlObjectMetaFileLoader);xmp.createNamespace("xmp.baseplayer.internals");xmp.baseplayer.internals.FileRequestHandle=function(Oj,id,Pj){this._id=id;this._type=Oj;this._dataObject=null;this._loadState=xmp.baseplayer.internals.FileRequestHandle.STATE_CREATED;this._listenerArray=[];this._errorMessage=null;this._maxCacheTime=Pj;this._createdTime=this._getCurrentTimeInSeconds();};xmp.baseplayer.internals.FileRequestHandle.STATE_CREATED=0;xmp.baseplayer.internals.FileRequestHandle.STATE_LOADING=1;xmp.baseplayer.internals.FileRequestHandle.STATE_LOADED=2;xmp.baseplayer.internals.FileRequestHandle.prototype.getId=function(){return this._id;};xmp.baseplayer.internals.FileRequestHandle.prototype.getType=function(){return this._type;};xmp.baseplayer.internals.FileRequestHandle.prototype.isNew=function(){return(this._loadState===xmp.baseplayer.internals.FileRequestHandle.STATE_CREATED);};xmp.baseplayer.internals.FileRequestHandle.prototype.isLoading=function(){return(this._loadState===xmp.baseplayer.internals.FileRequestHandle.STATE_LOADING);};xmp.baseplayer.internals.FileRequestHandle.prototype.isLoaded=function(){return(this._loadState===xmp.baseplayer.internals.FileRequestHandle.STATE_LOADED);};xmp.baseplayer.internals.FileRequestHandle.prototype.getDataObject=function(){return this._dataObject;};xmp.baseplayer.internals.FileRequestHandle.prototype._setDataObject=function(Qj){this._dataObject=Qj;};xmp.baseplayer.internals.FileRequestHandle.prototype._setAsLoading=function(){if(this._loadState!==xmp.baseplayer.internals.FileRequestHandle.STATE_LOADED){this._loadState=xmp.baseplayer.internals.FileRequestHandle.STATE_LOADING;}};xmp.baseplayer.internals.FileRequestHandle.prototype._setAsLoaded=function(){this._loadState=xmp.baseplayer.internals.FileRequestHandle.STATE_LOADED;this._notifyListeners();};xmp.baseplayer.internals.FileRequestHandle.prototype._notifyListener=function(Rj){var Sj=new xmp.util.Callback('onExecuteCB',this._onExecuteTimer,this);Sj.setMetadata('listener',Rj);var Tj=new xmp.util.Timer(this.getId(),xmp.DEFAULT_TIMER_INTERVAL,1,Sj);Tj.start();};xmp.baseplayer.internals.FileRequestHandle.prototype._onExecuteTimer=function(Uj,Vj){var Wj=Uj.getMetadata('listener',{});Wj._notifyFileRequestLoaded(this);};xmp.baseplayer.internals.FileRequestHandle.prototype._notifyListeners=function(){for(var i=0;i<this._listenerArray.length;i++){var Xj=this._listenerArray[i];this._notifyListener(Xj);}
this._listenerArray=[];};xmp.baseplayer.internals.FileRequestHandle.prototype._addListener=function(Yj){this._listenerArray.push(Yj);};xmp.baseplayer.internals.FileRequestHandle.prototype._setErrorMessage=function(Zj){this._errorMessage=Zj;};xmp.baseplayer.internals.FileRequestHandle.prototype._isError=function(){return(this._errorMessage!==null);};xmp.baseplayer.internals.FileRequestHandle.prototype._getErrorMessage=function(){return this._errorMessage;};xmp.baseplayer.internals.FileRequestHandle.prototype._getCurrentTimeInSeconds=function(){return Math.floor((new Date()).getTime()/1000);};xmp.baseplayer.internals.FileRequestHandle.prototype._getAgeInSeconds=function(){return(this._getCurrentTimeInSeconds()-this._createdTime);};xmp.baseplayer.internals.FileRequestHandle.prototype._isExpiredFromCache=function(){if(this._maxCacheTime<=-1){return false;}
if(this._maxCacheTime===0){return true;}
if(this._maxCacheTime<=this._getAgeInSeconds()){return true;}
return false;};xmp.createNamespace("xmp.baseplayer.internals");xmp.baseplayer.internals.MetaFileCache=function(){this._map={};this._logger=new xmp.util.internals.CategoryLogger('FileRequestHandle');};xmp.baseplayer.internals.MetaFileCache._singeltonInstance=null;xmp.baseplayer.internals.MetaFileCache.getInstance=function(){if(xmp.baseplayer.internals.MetaFileCache._singeltonInstance===null){xmp.baseplayer.internals.MetaFileCache._singeltonInstance=new xmp.baseplayer.internals.MetaFileCache();}
return xmp.baseplayer.internals.MetaFileCache._singeltonInstance;};xmp.baseplayer.internals.MetaFileCache.prototype.add=function($j){this._map[this._makeKeyH($j)]=$j;};xmp.baseplayer.internals.MetaFileCache.prototype.find=function(ak,id){var bk=this._map[this._makeKey(ak,id)];return(!bk)?null:bk;};xmp.baseplayer.internals.MetaFileCache.prototype.findOrCreate=function(ck,id,dk,ek){this._checkForExpiredHandles();var fk=this.find(ck,id);if(fk===null){fk=new xmp.baseplayer.internals.FileRequestHandle(ck,id,ek);this.add(fk);fk._addListener(dk);if(this._logger.isDebugEnabled()){this._logger.debug('Request handle NOT in cache, loading now: '+this._makeKeyH(fk));}
try{var gk=dk._loadFileRequest(fk);switch(gk){case xmp.baseplayer.internals.FileRequestHandle.STATE_LOADING:fk._setAsLoading();break;case xmp.baseplayer.internals.FileRequestHandle.STATE_LOADED:fk._setAsLoaded();break;default:throw new Error('Unexpected load state.');}}
catch(e){fk._setErrorMessage(xmp.extractErrorMessage(e));fk._setAsLoaded();}}
else{if(fk.isLoading()){if(this._logger.isDebugEnabled()){this._logger.debug('Request handle FOUND in cache, ANOTHER LOADER is loading, will wait: '+this._makeKeyH(fk));}
fk._addListener(dk);}
else if(fk.isLoaded()){if(this._logger.isDebugEnabled()){this._logger.debug('Request handle FOUND in cache, already loaded: '+this._makeKeyH(fk));}
fk._notifyListener(dk);}}
return fk;};xmp.baseplayer.internals.MetaFileCache.prototype._makeKey=function(hk,id){return(hk+'|'+id);};xmp.baseplayer.internals.MetaFileCache.prototype._makeKeyH=function(ik){return this._makeKey(ik.getType(),ik.getId());};xmp.baseplayer.internals.MetaFileCache.prototype._checkForExpiredHandles=function(){var jk=[];var kk='';var lk=null;for(var mk=xmp.MapIterator.create(this._map);mk.hasNext();mk.next()){kk=mk.currentKey();lk=mk.currentValue();if(this._isHandleExpired(lk,kk)){jk.push(lk);}}
for(var i=0;i<jk.length;i++){lk=jk[i];try{kk=this._makeKeyH(lk);delete this._map[kk];}
catch(e){this._logger.debug('Error removing request handle from cache.',e);}}};xmp.baseplayer.internals.MetaFileCache.prototype._isHandleExpired=function(nk,pk){try{if(nk._isExpiredFromCache()){this._logger.debug('Request handle expired, will remove from cache.');return true;}
return false;}
catch(e){this._logger.warn('Error checking for expiration: '+pk,e);}
return false;};xmp.createNamespace("xmp.baseplayer.internals");xmp.baseplayer.internals.NullTrigger=function(qk){this._logger=new xmp.util.internals.CategoryLogger('NullTrigger');this._type=qk;};xmp.baseplayer.internals.NullTrigger.prototype.getType=function(){return this._type;};xmp.baseplayer.internals.NullTrigger.prototype.doCommands=function(rk){if(this._logger.isDebugEnabled()){this._logger.debug('Trigger type: '+this.getType()+', Null Trigger, no commands to do.');}};xmp.createNamespace("xmp.baseplayer.internals");xmp.baseplayer.internals.Trigger=function(sk,tk){this._logger=new xmp.util.internals.CategoryLogger('Trigger');this._type=sk;this._triggerCommandArray=tk;};xmp.baseplayer.internals.Trigger.getTrigger=function(uk,vk){var wk=[];if(uk.getPlayableData().isLoaded()){var xk=uk.getPlayableData().getDataObject().triggers;if(typeof xk==='object'){for(var i=0;i<xk.length;i++){var yk=xk[i];if(typeof yk==='object'&&yk.trigger===vk&&typeof yk.commands==='object'&&yk.commands.length>0){wk=xmp.baseplayer.internals.Trigger._cloneTriggerCommands(yk.commands);break;}}}
var zk=xmp.util.SettingsManager.getInstance().getContextNode().getNodeForPath('NodeTriggers/'+uk.getNodeTypeName()).getString(vk,'');if(zk.length>0){var Ak=null;try{Ak=xmp.net.AjaxRequestManager.prototype._parseJson(zk);}
catch(e){Ak=null;this._logger.warn('Error getting global trigger for type: '+uk.getNodeTypeName(),e);}
if(Ak!==null){wk=Ak.concat(wk);}}}
if(wk.length>0){return new xmp.baseplayer.internals.Trigger(vk,wk);}
else{return new xmp.baseplayer.internals.NullTrigger(vk);}};xmp.baseplayer.internals.Trigger._cloneTriggerCommands=function(Bk){var Ck=[];for(var i=0;i<Bk.length;i++){var Dk=Bk[i];Ck.push({type:Dk.type,data:Dk.data});}
return Ck;};xmp.baseplayer.internals.Trigger.prototype.getType=function(){return this._type;};xmp.baseplayer.internals.Trigger.prototype.doCommands=function(Ek){for(var i=0;i<this._triggerCommandArray.length;i++){var Fk=null;try{Fk=this._triggerCommandArray[i];var Gk=xmp.baseplayer.internals.TriggerCommandFactory.getInstance().create(Fk.type);Ek.setCommandData(Fk.data);Ek.setTriggerType(this.getType());Gk.doCommand(Ek);}
catch(e){this._logger.warn('Error invoking trigger command, type: '+Fk.type+', data: '+Fk.data,e);}}};xmp.createNamespace("xmp.baseplayer.internals");xmp.baseplayer.internals.TriggerCommandFactory=function(){this._logger=new xmp.util.internals.CategoryLogger('TriggerCommandFactory');xmp.util.SettingsManager.getInstance().addContextChangeListener(new xmp.util.Callback('TriggerCommandFactory',this._handleContextChange,this));this._triggerCommandMap=null;this._faultCfg();};xmp.baseplayer.internals.TriggerCommandFactory._singeltonInstance=null;xmp.baseplayer.internals.TriggerCommandFactory.getInstance=function(){if(xmp.baseplayer.internals.TriggerCommandFactory._singeltonInstance===null){xmp.baseplayer.internals.TriggerCommandFactory._singeltonInstance=new xmp.baseplayer.internals.TriggerCommandFactory();}
return xmp.baseplayer.internals.TriggerCommandFactory._singeltonInstance;};xmp.baseplayer.internals.TriggerCommandFactory.prototype.create=function(Hk){var Ik=this._triggerCommandMap[Hk];if(!Ik){return(new xmp.baseplayer.internals.NullTriggerCommand(Hk));}
try{var Jk=xmp.getNamespacedMethod(Ik);var Kk=new Jk();return Kk;}
catch(e){this._logger.warn('Error creating Trigger Command: '+Hk,e);return(new xmp.baseplayer.internals.NullTriggerCommand(Hk));}};xmp.baseplayer.internals.TriggerCommandFactory.prototype._faultCfg=function(){if(this._triggerCommandMap===null){this._triggerCommandMap={};var Lk=xmp.util.SettingsManager.getInstance().getContextNode().getNodeForPath('TriggerCommands');var Mk=Lk.retrieveKeys();for(var i=0;i<Mk.length;i++){var Nk=Mk[i];var Ok=Lk.getString(Nk,'');this._triggerCommandMap[Nk]=Ok;}
this._triggerCommandMap.setImg='xmp.baseplayer.internals.SetImageTriggerCommand';this._triggerCommandMap.echo='xmp.baseplayer.internals.EchoTriggerCommand';}};xmp.baseplayer.internals.TriggerCommandFactory.prototype._handleContextChange=function(){this._triggerCommandMap=null;this._faultCfg();};xmp.baseplayer.internals.NullTriggerCommand=function(Pk){this._type=Pk;this._logger=new xmp.util.internals.CategoryLogger('NullTriggerCommand');};xmp.baseplayer.internals.NullTriggerCommand.prototype.doCommand=function(Qk){if(this._logger.isDebugEnabled()){this._logger.debug('Trigger Command unrecognized: '+this._type);}};xmp.baseplayer.internals.EchoTriggerCommand=function(){this._logger=new xmp.util.internals.CategoryLogger('EchoTriggerCommand');};xmp.baseplayer.internals.EchoTriggerCommand.prototype.doCommand=function(Rk){var Sk=Rk.getCommandData();xmp.baseplayer.internals.AdStatusReporter.report(this._logger,'Trigger type: '+Rk.getTriggerType()+', Doing "echo" command, data = '+Sk);};xmp.baseplayer.internals.SetImageTriggerCommand=function(){this._logger=new xmp.util.internals.CategoryLogger('SetImageTriggerCommand');};xmp.baseplayer.internals.SetImageTriggerCommand.prototype.doCommand=function(Tk){var Uk=this._cleanImageData(Tk.getCommandData());var Vk=xmp.baseplayer.internals.Ad.getInstance().setPingImage(Uk);xmp.baseplayer.internals.AdStatusReporter.report(this._logger,'Trigger type: '+Tk.getTriggerType()+', Doing "setImg" command, data = '+Uk+', using img dom ID: '+Vk);};xmp.baseplayer.internals.SetImageTriggerCommand.prototype._cleanImageData=function(Wk){var Xk=Wk.indexOf('\"');if(Xk===-1){return Wk;}
Wk=Wk.substr(Xk+1);var Yk=Wk.indexOf('\"');Wk=Wk.substr(0,Yk);return Wk;};xmp.baseplayer.internals.AdStatusReporter=function(){};xmp.baseplayer.internals.AdStatusReporter._cb=null;xmp.baseplayer.internals.AdStatusReporter.dummySetAdStatus=function(){};xmp.baseplayer.internals.AdStatusReporter.report=function(Zk,$k){if(xmp.baseplayer.internals.AdStatusReporter._cb===null){var p=xmp.baseplayer.BasePlayer._singleInstance;if((p)&&(p.setAdStatus)){xmp.baseplayer.internals.AdStatusReporter._cb=new xmp.util.Callback('adStatus',p.setAdStatus,p);}
else{xmp.baseplayer.internals.AdStatusReporter._cb=new xmp.util.Callback('adStatus',xmp.baseplayer.internals.AdStatusReporter.dummySetAdStatus,null);}
xmp.baseplayer.internals.AdStatusReporter._cb.setAddThisToCallback(false);}
try{xmp.baseplayer.internals.AdStatusReporter._cb.call('SMARTCOUNT: '+$k);}
catch(ex){}
if(Zk.isDebugEnabled()){Zk.debug($k);}};xmp.createNamespace("xmp.baseplayer.internals");xmp.baseplayer.internals.VideoAdMetaFileLoader=function(al,bl){this._CLASS_NAME='VideoAdMetaFileLoader';this._AD_MAN_TYPE='adMan';this._AD_SERVER_TYPE='adServer';this._logger=new xmp.util.internals.CategoryLogger(this._CLASS_NAME);this._THIS_TYPE='videoAdMeta';this._owner=al;this._loaderId=bl;this._resBundle=null;this._callback=null;this._companionAdId=xmp.baseplayer.internals.Ad.createCompanionAdId();this._latchCompleteCb=this._createCb(null,'LatchComplete',this._handleLatchComplete);this._latch=new xmp.util.Latch([],this._latchCompleteCb);};xmp.baseplayer.internals.VideoAdMetaFileLoader.prototype.getLoaderId=function(){return this._loaderId;};xmp.baseplayer.internals.VideoAdMetaFileLoader.prototype.setResBundle=function(cl,dl){this._resBundle=cl;this._callback=dl;};xmp.baseplayer.internals.VideoAdMetaFileLoader.prototype.load=function(){try{if(this._shortCircuit()){return;}
this._latchCompleteCb.setMetadata('LatchPhase',this._AD_MAN_TYPE);var el=this._resBundle.getResourceTypes();for(var i=0;i<el.length;i++){var fl=this._resBundle.getMetaResource(el[i]);fl.setCompanionAdId(this._companionAdId);this._loadARM(fl,this._AD_MAN_TYPE,xmp.net.ContentTypes.TEXT,fl.getId());}}
catch(e){this._handleError(e);}};xmp.baseplayer.internals.VideoAdMetaFileLoader.prototype._shortCircuit=function(){if(this._resBundle.getCount()===0){this._resBundle._setRawData('Loaded (no resources)');}
if(this._resBundle.isLoaded()||this._resBundle.isError()){xmp.util.Timer.doSimpleCallback(this._createCb(null,'endAsynch',this._end));return true;}
return false;};xmp.baseplayer.internals.VideoAdMetaFileLoader.prototype._handleLatchComplete=function(cb){try{var gl=this._latchCompleteCb.getMetadata('LatchPhase','');if(gl===this._AD_MAN_TYPE){this._doAdManComplete();}
else if(gl===this._AD_SERVER_TYPE){this._doAdServerComplete();}
else{throw new Error('Unrecognized phase: '+gl);}}
catch(e){this._handleError(e);}};xmp.baseplayer.internals.VideoAdMetaFileLoader.prototype._doAdManComplete=function(){this._latchCompleteCb.setMetadata('LatchPhase',this._AD_SERVER_TYPE);var hl=this._resBundle.getResourceTypes();var il=0;for(var i=0;i<hl.length;i++){var jl=this._resBundle.getMetaResource(hl[i]);var kl=this._makeCbName(jl,this._AD_MAN_TYPE);var ll=this._latchCompleteCb.getMetadata(kl,xmp.util.internals.MetadataMap.defaultObj);if(!ll.isError()){var ml=this._buildAdServerRelUrl(jl,ll.getText());if(jl.getType()==='primary'){il++;this._loadARM(jl,this._AD_SERVER_TYPE,xmp.net.ContentTypes.JSON,ml);}
else if(jl.getType()==='synch_unit'){var nl=xmp.baseplayer.internals.Ad.getAdServerRoot();jl._setRawData(nl+ml);jl.setDataType('url');}}
else{jl._setErrorMessage(ll.getErrorMessage());}}
if(il===0){this._end();}};xmp.baseplayer.internals.VideoAdMetaFileLoader.prototype._doAdServerComplete=function(){var ol=this._resBundle.getMetaResource('primary');var pl=this._makeCbName(ol,this._AD_SERVER_TYPE);var ql=this._latchCompleteCb.getMetadata(pl,xmp.util.internals.MetadataMap.defaultObj);if(!ql.isError()){ol._setRawData(ql.getJsonObject());}
else{ol._setErrorMessage(ql.getErrorMessage());}
this._end();};xmp.baseplayer.internals.VideoAdMetaFileLoader.prototype._handleError=function(e){this._handleErrorMessage(xmp.extractErrorMessage(e));};xmp.baseplayer.internals.VideoAdMetaFileLoader.prototype._handleErrorMessage=function(rl){this._resBundle._setErrorMessage(rl);this._end();};xmp.baseplayer.internals.VideoAdMetaFileLoader.prototype._end=function(){if(this._owner!==null){this._owner._release(this);this._owner=null;}
if(!this._resBundle.isError()){var sl=this._resBundle.getMetaResource('primary');if(sl!==null&&sl.isError()){this._resBundle._setErrorMessage('Primary Resource Error: '+sl.getErrorMessage());}}
if(!this._resBundle.isError()){this._resBundle._setRawData('Loaded');}
try{this._callback.call(this._resBundle);}
catch(e){this._logger.warn('Error calling callback',e);}};xmp.baseplayer.internals.VideoAdMetaFileLoader.prototype._createCb=function(tl,ul,vl){return(new xmp.util.Callback(this._makeCbName(tl,ul),vl,this));};xmp.baseplayer.internals.VideoAdMetaFileLoader.prototype._makeCbName=function(wl,xl){var yl=(wl!==null)?wl.getType():'';return(this._CLASS_NAME+'_'+xl+'_'+yl+'_'+this._loaderId);};xmp.baseplayer.internals.VideoAdMetaFileLoader.prototype._buildAdServerRelUrl=function(zl,Al){var Bl=xmp.trimString(Al);var Cl=zl.getMetadata('segvars','');return xmp.baseplayer.internals.Ad.getInstance().buildRelativeURL(zl.getType(),this._companionAdId,Bl,Cl);};xmp.baseplayer.internals.VideoAdMetaFileLoader.prototype._loadARM=function(Dl,El,Fl,Gl){var cb=this._createCb(Dl,El,this._handleARMResponse);this._latch.addCbName(cb.getId());xmp.net.AjaxRequestManager.getInstance().request(Gl,cb,El,Gl,Fl,null);};xmp.baseplayer.internals.VideoAdMetaFileLoader.prototype._handleARMResponse=function(Hl,Il){if(Il.isError()){var Jl=new xmp.baseplayer.ApplicationError(Il.getErrorObject(),'FailToGetAdVideo',null,[{label:"Url",text:Il.getFullUrl()}]);this._logger.warn(Jl.message,Jl);}
this._latch.called(Hl.getId(),Il);};xmp.createNamespace("xmp.baseplayer.internals");xmp.baseplayer.internals.VideoCompositeAdMetaFileLoader=function(Kl,Ll){this._CLASS_NAME='VideoCompositeAdMetaFileLoader';this._AD_MAN_TYPE='adMan';this._AD_SERVER_TYPE='adServer';this._logger=new xmp.util.internals.CategoryLogger(this._CLASS_NAME);this._THIS_TYPE='videoCompositeAdMeta';this._owner=Kl;this._loaderId=Ll;this._resBundle=null;this._callback=null;this._companionAdId=xmp.baseplayer.internals.Ad.createCompanionAdId();};xmp.baseplayer.internals.VideoCompositeAdMetaFileLoader.prototype.getLoaderId=function(){return this._loaderId;};xmp.baseplayer.internals.VideoCompositeAdMetaFileLoader.prototype.setResBundle=function(Ml,Nl){this._resBundle=Ml;this._callback=Nl;};xmp.baseplayer.internals.VideoCompositeAdMetaFileLoader.prototype.load=function(){try{if(this._shortCircuit()){return;}
xmp.baseplayer.internals.AdServerPageController.getInstance().waitUntilReady(new xmp.util.Callback('_doCompositeJob',this._doCompositeJob,this));}
catch(e){this._handleError(e);}};xmp.baseplayer.internals.VideoCompositeAdMetaFileLoader.prototype._doCompositeJob=function(){try{var Ol=this._createJobJson();var Pl='tile='+this._companionAdId.toString();this._logger.info(Ol);var cb=this._createCb(null,'adCompositor',this._handleARMResponse);var Ql=xmp.baseplayer.internals.AdServerPageController.getInstance().getData('NGUserIDCookie','false');var Rl=[{name:'job_json',value:xmp.Base64.encode(Ol),type:xmp.net.AjaxRequestManager.POST_FORM_TYPE},{name:'NGUserID',value:Ql,type:xmp.net.AjaxRequestManager.POST_FORM_TYPE},{name:'adDEmas',value:xmp.util.Cookie.read('adDEmas'),type:xmp.net.AjaxRequestManager.POST_FORM_TYPE}];xmp.net.AjaxRequestManager.getInstance().request(Pl,cb,'adCompositor',Pl,xmp.net.ContentTypes.JSON,Rl);}
catch(e){this._handleError(e);}};xmp.baseplayer.internals.VideoCompositeAdMetaFileLoader.prototype._shortCircuit=function(){if(this._resBundle.getCount()===0){this._resBundle._setRawData('Loaded (no resources)');}
if(this._resBundle.isLoaded()||this._resBundle.isError()){xmp.util.Timer.doSimpleCallback(this._createCb(null,'endAsynch',this._end));return true;}
return false;};xmp.baseplayer.internals.VideoCompositeAdMetaFileLoader.prototype._createJobJson=function(){var jj="{ inmeta: { adManRoot: '"+xmp.baseplayer.internals.Ad.getAdManRoot()+"', adServerRoot: '"+xmp.baseplayer.internals.Ad.getAdServerRoot()+"'}, inoutmeta: { debug: {} }, commands: [";var Sl=this._resBundle.getResourceTypes();for(var i=0;i<Sl.length;i++){var Tl=Sl[i];var Ul=this._resBundle.getMetaResource(Tl);var Vl=this._getDataType(Ul);Ul.setDataType(Vl);Ul.setCompanionAdId(this._companionAdId);var Wl=this._buildAdServerRelUrl(Ul,'');var Xl="{ type: 'loadAd', inmeta: { type: '"+Tl+"', dataType: '"+Vl+"', "+"query: '"+Wl+"', id: '"+Ul.getId()+"'}, "+"inoutmeta: { data: '', error: '', debug: {}}}";jj+=Xl;if(i!==(Sl.length-1)){jj+=', ';}}
jj+=']}';return jj;};xmp.baseplayer.internals.VideoCompositeAdMetaFileLoader.prototype._getDataType=function(Yl){var Zl=Yl.getType();var $l=xmp.util.SettingsManager.getInstance().getContextNode().getNodeForPath('ad data types');return $l.getString(Zl,'default');};xmp.baseplayer.internals.VideoCompositeAdMetaFileLoader.prototype._handleError=function(e){this._handleErrorMessage(xmp.extractErrorMessage(e));};xmp.baseplayer.internals.VideoCompositeAdMetaFileLoader.prototype._handleErrorMessage=function(am){this._resBundle._setErrorMessage(am);this._end();};xmp.baseplayer.internals.VideoCompositeAdMetaFileLoader.prototype._end=function(){if(this._owner!==null){this._owner._release(this);this._owner=null;}
if(!this._resBundle.isError()){if(this._resBundle.getCount()===this._resBundle.getErrorCount()){this._resBundle._setErrorMessage('All resources in composite failed.');}}
if(!this._resBundle.isError()){this._resBundle._setRawData('Loaded');}
try{this._callback.call(this._resBundle);}
catch(e){this._logger.warn('Error calling callback',e);}};xmp.baseplayer.internals.VideoCompositeAdMetaFileLoader.prototype._createCb=function(bm,cm,dm){return(new xmp.util.Callback(this._makeCbName(bm,cm),dm,this));};xmp.baseplayer.internals.VideoCompositeAdMetaFileLoader.prototype._makeCbName=function(em,fm){var gm=(em!==null)?em.getType():'';return(this._CLASS_NAME+'_'+fm+'_'+gm+'_'+this._loaderId);};xmp.baseplayer.internals.VideoCompositeAdMetaFileLoader.prototype._buildAdServerRelUrl=function(hm,im){var jm=xmp.trimString(im);var km=hm.getMetadata('segvars','');return xmp.baseplayer.internals.Ad.getInstance().buildRelativeURL(hm.getType(),this._companionAdId,jm,km);};xmp.baseplayer.internals.VideoCompositeAdMetaFileLoader.prototype._handleARMResponse=function(lm,mm){if(mm.isError()){var nm=new xmp.baseplayer.ApplicationError(mm.getErrorObject(),'FailToGetAdVideo',null,[{label:"Url",text:mm.getFullUrl()}]);this._logger.warn(nm.message);this._failAll(mm.getErrorMessage());this._end();return;}
var om=mm.getJsonObject();var qm=this._decodeOpt(om.jobError,'');if(qm.length!==0){this._logger.warn('jobError: '+qm);this._failAll('composite jobError: '+qm);this._end();return;}
var rm=this._getOpt(om.inoutmeta.debug.job_duration,0);this._logger.info("Servlet job duration (ms): "+rm);var sm=this._resBundle.getResourceTypes();for(var i=0;i<sm.length;i++){var tm=sm[i];var um=this._resBundle.getMetaResource(tm);var vm=null;for(var j=0;j<om.commands.length;j++){if(om.commands[j].inmeta.type===tm){vm=om.commands[j];break;}}
var wm=this._decodeOpt(vm.inoutmeta.debug.adServerUrl,'NOT_FOUND');var xm=this._decodeOpt(vm.inoutmeta.debug.fullAdManUrl,'NOT_FOUND');var ym=this._decodeOpt(vm.inoutmeta.data,'');var zm=this._decodeOpt(vm.inoutmeta.error,'');var Am=vm.inmeta.dataType;var Bm='Ad type: '+tm+', dataType: '+Am+', adServerUrl: '+wm+', fullAdManUrl: '+xm;if((zm.length===0)&&this._logger.isInfoEnabled()){this._logger.info(Bm);this._logger.info('Data: '+ym);}
if(zm.length!==0){this._logger.warn(Bm);this._logger.warn('Error: '+zm);um._setErrorMessage(zm);continue;}
if(Am==='url'){var Cm=xmp.baseplayer.internals.Ad.getAdServerRoot();um._setRawData(Cm+ym);}
else if(Am==='videoJson'){try{var Dm=xmp.net.AjaxRequestManager.getInstance()._parseJson(ym);um._setRawData(Dm);}
catch(parseEx){this._logger.warn('Parse error with ad type: '+tm+', '+xmp.extractErrorMessage(parseEx));um._setErrorMessage(xmp.extractErrorMessage(parseEx));}}
else{um._setRawData(ym);}}
this._end();};xmp.baseplayer.internals.VideoCompositeAdMetaFileLoader.prototype._failAll=function(Em){this._resBundle._setErrorMessage(Em);var Fm=this._resBundle.getResourceTypes();for(var i=0;i<Fm.length;i++){var Gm=Fm[i];var Hm=this._resBundle.getMetaResource(Gm);Hm._setErrorMessage(Em);}};xmp.baseplayer.internals.VideoCompositeAdMetaFileLoader.prototype._getOpt=function(Im,Jm){if(typeof(Im)!=='undefined'){return Im;}
return Jm;};xmp.baseplayer.internals.VideoCompositeAdMetaFileLoader.prototype._decodeOpt=function(Km,Lm){if(xmp.isNonEmptyString(Km)){return xmp.Base64.decode(Km);}
return Lm;};xmp.updateAdServerData=function(Mm){xmp.baseplayer.internals.AdServerPageController.getInstance().update(Mm);};xmp.baseplayer.internals.AdServerPageController=function(){this._READY_POLL_INTERVAL=250;this._IFRAME_ID='xmp_AdServerPageController';this._logger=new xmp.util.internals.CategoryLogger('AdServerPageController');this._dataMap={};this._readyCB=null;this._readyTimer=null;this._gotData=false;this._startTime=-1;this._readyTries=0;this._refreshCount=0;this._refreshTimer=null;this._init();};xmp.baseplayer.internals.AdServerPageController._instance=null;xmp.baseplayer.internals.AdServerPageController.getInstance=function(){if(xmp.baseplayer.internals.AdServerPageController._instance===null){xmp.baseplayer.internals.AdServerPageController._instance=new xmp.baseplayer.internals.AdServerPageController();}
return xmp.baseplayer.internals.AdServerPageController._instance;};xmp.baseplayer.internals.AdServerPageController.prototype.waitUntilReady=function(cb){this._readyCB=null;this._stopReadyTimer();this._startTime=-1;this._readyTries=0;if(this._gotData){cb.call();return;}
this._readyCB=cb;this._startTime=this.getNowMs();var Nm=new xmp.util.Callback('_readyTest',this._readyTest,this);this._readyTimer=new xmp.util.Timer(Nm.getId(),this._READY_POLL_INTERVAL,1000,Nm);this._readyTimer.start();};xmp.baseplayer.internals.AdServerPageController.prototype.getNowMs=function(){return(new Date()).getTime();};xmp.baseplayer.internals.AdServerPageController.prototype.getData=function(Om,Pm){var Qm=this._dataMap[Om];return(Qm)?Qm:Pm;};xmp.baseplayer.internals.AdServerPageController.prototype.update=function(Rm){for(var Sm=xmp.MapIterator.create(Rm);Sm.hasNext();Sm.next()){var Tm=Sm.currentKey();this._dataMap[Tm]=Sm.currentValue();if(this._logger.isInfoEnabled()){this._logger.info('Updated key: '+Tm+', value: '+this._dataMap[Tm]);}}
this._gotData=true;this._refreshCount++;this._logger.info('Data updated, count: '+this._refreshCount);};xmp.baseplayer.internals.AdServerPageController.prototype._stopReadyTimer=function(){if(this._readyTimer!==null){this._readyTimer.stop();this._readyTimer=null;}};xmp.baseplayer.internals.AdServerPageController.prototype._readyTest=function(cb,Um){this._readyTries++;if(this._gotData){this._stopReadyTimer();this._logger.info('Got data, try: '+this._readyTries);}
else{var Vm=this.getNowMs()-this._startTime;if(Vm>30000){this._stopReadyTimer();this._logger.warn('Failed to get initial ad server data.');}
else{return;}}
if(this._readyCB!==null){this._readyCB.call();this._readyCB=null;}};xmp.baseplayer.internals.AdServerPageController.prototype._init=function(){var Wm=window.document.createElement('div');Wm.style.display='none';xmp.insertDomChildBefore(window.document.body,Wm);var Xm=this._getCfgNode().getString('adServerDataPage','');if(Xm.toLowerCase().indexOf('http')!==0){var Ym=xmp.util.SettingsManager.getInstance().getGlobalContextNode().getNodeForPath('rootUrlMap/adServer');Xm=Ym+Xm;}
var Zm='<iframe hspace="0" vspace="0" marginHeight="0" marginWidth="0" src="'+Xm+'" border="0" frameBorder="0" height="0" width="0" scrolling="no"  id="'+this._IFRAME_ID+'" name="'+this._IFRAME_ID+'" style="position: absolute; visibility: hidden;" ></iframe>';Wm.innerHTML=Zm;var cb=new xmp.util.Callback('_doRefresh',this._doRefresh,this);this._refreshTimer=new xmp.util.Timer(cb.getId(),30000,-1,cb);this._refreshTimer.start();};xmp.baseplayer.internals.AdServerPageController.prototype._doRefresh=function(){try{this._logger.info('Attempting to refresh.');var $m=window.frames[this._IFRAME_ID];$m.xmp_cnn_updateAdServerData();}
catch(ex){this._logger.warn('Failed to refresh.',ex);}};xmp.baseplayer.internals.AdServerPageController.prototype._getCfgNode=function(){return xmp.util.SettingsManager.getInstance().getGlobalContextNode().getNodeForPath('loaders/videoCompositeAdMeta/cfg');};xmp.createNamespace("xmp.baseplayer.internals");xmp.baseplayer.internals.VideoCompositeAdMetaFileLoader2=function(an,bn){this._CLASS_NAME='VideoCompositeAdMetaFileLoader2';this._AD_MAN_TYPE='adMan';this._AD_SERVER_TYPE='adServer';this._DELIM='__@@$$@@__';this._DELIM_RE=/__@@\$\$@@__/gm;this._AD_REQUEST_ID_PREFIX='ad';this._logger=new xmp.util.internals.CategoryLogger(this._CLASS_NAME);this._THIS_TYPE='videoCompositeAdMeta';this._owner=an;this._loaderId=bn;this._resBundle=null;this._callback=null;this._latchCompleteCb=this._createCb(null,'LatchComplete',this._handleLatchComplete);this._latch=new xmp.util.Latch([],this._latchCompleteCb);this._adDataArray=[];this._companionAdId=xmp.baseplayer.internals.Ad.createCompanionAdId();};xmp.baseplayer.internals.VideoCompositeAdMetaFileLoader2.prototype.getLoaderId=function(){return this._loaderId;};xmp.baseplayer.internals.VideoCompositeAdMetaFileLoader2.prototype.setResBundle=function(cn,dn){this._resBundle=cn;this._callback=dn;};xmp.baseplayer.internals.VideoCompositeAdMetaFileLoader2.prototype.load=function(){try{if(this._shortCircuit()){return;}
this._loadAdMan();}
catch(e){this._handleError(e);}};xmp.baseplayer.internals.VideoCompositeAdMetaFileLoader2.prototype._shortCircuit=function(){if(this._resBundle.getCount()===0){this._resBundle._setRawData('Loaded (no resources)');}
if(this._resBundle.isLoaded()||this._resBundle.isError()){xmp.util.Timer.doSimpleCallback(this._createCb(null,'endAsynch',this._end));return true;}
return false;};xmp.baseplayer.internals.VideoCompositeAdMetaFileLoader2.prototype._getDataType=function(en){var fn=en.getType();var gn=xmp.util.SettingsManager.getInstance().getContextNode().getNodeForPath('ad data types');return gn.getString(fn,'default');};xmp.baseplayer.internals.VideoCompositeAdMetaFileLoader2.prototype._handleError=function(e){this._handleErrorMessage(xmp.extractErrorMessage(e));};xmp.baseplayer.internals.VideoCompositeAdMetaFileLoader2.prototype._handleErrorMessage=function(hn){this._resBundle._setErrorMessage(hn);this._end();};xmp.baseplayer.internals.VideoCompositeAdMetaFileLoader2.prototype._end=function(){if(this._owner!==null){this._owner._release(this);this._owner=null;}
if(!this._resBundle.isError()){if(this._resBundle.getCount()===this._resBundle.getErrorCount()){this._resBundle._setErrorMessage('All resources in composite failed.');}}
if(!this._resBundle.isError()){this._resBundle._setRawData('Loaded');}
try{this._callback.call(this._resBundle);}
catch(e){this._logger.warn('Error calling callback',e);}};xmp.baseplayer.internals.VideoCompositeAdMetaFileLoader2.prototype._createCb=function(jn,kn,ln){return(new xmp.util.Callback(this._makeCbName(jn,kn),ln,this));};xmp.baseplayer.internals.VideoCompositeAdMetaFileLoader2.prototype._makeCbName=function(mn,nn){var on=(mn!==null)?mn.getType():'';return(this._CLASS_NAME+'_'+nn+'_'+on+'_'+this._loaderId);};xmp.baseplayer.internals.VideoCompositeAdMetaFileLoader2.prototype._buildAdServerRelUrl=function(pn,qn){var rn=xmp.trimString(qn);var sn=pn.getMetadata('segvars','');return xmp.baseplayer.internals.Ad.getInstance().buildRelativeURL(pn.getType(),this._companionAdId,rn,sn);};xmp.baseplayer.internals.VideoCompositeAdMetaFileLoader2.prototype._crackRawData=function(tn){var un=tn.indexOf('\n');if(un===-1){throw new Error('Ad server returned malformed composite - missing line feed between header and data.');}
var vn=xmp.trimString(tn.substr(0,un));if(vn.length===0){throw new Error('Ad server returned malformed composite - empty string header.');}
if(0!==vn.indexOf(this._AD_REQUEST_ID_PREFIX)){throw new Error('Ad server returned malformed composite - header does not begin with "'+this._DELIM+' '+this._AD_REQUEST_ID_PREFIX+'".');}
var wn=tn.substr(un+1);un=vn.indexOf(' ');if(un===-1){throw new Error('Ad server returned malformed composite - missing space in header between ID and status.');}
var id=xmp.trimString(vn.substr(0,un));var xn=xmp.trimString(vn.substr(un+1));if(!(xn==='OK'||xn==='ERROR')){throw new Error('Ad server returned malformed composite - status must be either "OK" or "ERROR".');}
var yn=(xn==='OK');if(yn&&(xmp.trimString(wn).length===0)){yn=false;wn='No data returned by ad server (or only white space).';}
return{'adReqId':id,'data':wn,'ok':yn};};xmp.baseplayer.internals.VideoCompositeAdMetaFileLoader2.prototype._breakComposite=function(zn){var An={};var Bn=zn.indexOf(this._DELIM);if(Bn===-1){return An;}
if(Bn>0){zn=zn.substr(Bn);}
var Cn=zn.split(this._DELIM_RE);for(var i=1;i<Cn.length;i++){var Dn=this._crackRawData(Cn[i]);An[Dn.adReqId]=Dn;}
return An;};xmp.baseplayer.internals.VideoCompositeAdMetaFileLoader2.prototype._handleAdServerARMResponse=function(En,Fn){try{this._handleAdServerARMResponseInternal(En,Fn);}
catch(e){this._failAll(xmp.extractErrorMessage(e));this._handleError(e);}};xmp.baseplayer.internals.VideoCompositeAdMetaFileLoader2.prototype._handleAdServerARMResponseInternal=function(Gn,Hn){if(Hn.isError()){var In=new xmp.baseplayer.ApplicationError(Hn.getErrorObject(),'FailToGetAdVideo',null,[{label:"Url",text:Hn.getFullUrl()}]);this._logger.warn(In.message);this._failAll(Hn.getErrorMessage());this._end();return;}
var Jn=this._breakComposite(Hn.getText());for(var i=0;i<this._adDataArray.length;i++){var Kn=this._adDataArray[i];var Ln=Jn[Kn.adReqId];if(typeof(Ln)==='undefined'){throw new Error('Ajax response missing ad request ID: '+Kn.adReqId+' for res type: '+Kn.res.getType());}
if(Ln.ok){if(Kn.res.getDataType()==='videoJson'){try{var Mn=xmp.net.AjaxRequestManager.getInstance()._parseJson(Ln.data);Kn.res._setRawData(Mn);}
catch(parseEx){this._logger.warn('Parse error with ad type: '+Kn.res.getType()+', '+xmp.extractErrorMessage(parseEx));Kn.res._setErrorMessage(xmp.extractErrorMessage(parseEx));}}
else{Kn.res._setRawData(Ln.data);}}
else{Kn.res._setErrorMessage(Ln.data);}}
this._end();};xmp.baseplayer.internals.VideoCompositeAdMetaFileLoader2.prototype._failAll=function(Nn){this._resBundle._setErrorMessage(Nn);var On=this._resBundle.getResourceTypes();for(var i=0;i<On.length;i++){var Pn=On[i];var Qn=this._resBundle.getMetaResource(Pn);Qn._setErrorMessage(Nn);}};xmp.baseplayer.internals.VideoCompositeAdMetaFileLoader2.prototype._loadAdMan=function(){var Rn=this._resBundle.getResourceTypes();for(var i=0;i<Rn.length;i++){var Sn=this._resBundle.getMetaResource(Rn[i]);Sn.setCompanionAdId(this._companionAdId);var Tn=this._getDataType(Sn);Sn.setDataType(Tn);this._loadARM(Sn,this._AD_MAN_TYPE,xmp.net.ContentTypes.TEXT,Sn.getId());}};xmp.baseplayer.internals.VideoCompositeAdMetaFileLoader2.prototype._loadARM=function(Un,Vn,Wn,Xn){var cb=this._createCb(Un,Vn,this._handleAdManARMResponse);this._latch.addCbName(cb.getId());xmp.net.AjaxRequestManager.getInstance().request(Xn,cb,Vn,Xn,Wn,null);};xmp.baseplayer.internals.VideoCompositeAdMetaFileLoader2.prototype._handleAdManARMResponse=function(Yn,Zn){if(Zn.isError()){var $n=new xmp.baseplayer.ApplicationError(Zn.getErrorObject(),'FailToGetAdVideo',null,[{label:"Url",text:Zn.getFullUrl()}]);this._logger.warn($n.message,$n);}
this._latch.called(Yn.getId(),Zn);};xmp.baseplayer.internals.VideoCompositeAdMetaFileLoader2.prototype._handleLatchComplete=function(cb){try{this._doAdManComplete();}
catch(e){this._handleError(e);}};xmp.baseplayer.internals.VideoCompositeAdMetaFileLoader2.prototype._doAdManComplete=function(){var ao=this._resBundle.getResourceTypes();var bo=[];this._adDataArray=[];for(var i=0;i<ao.length;i++){var co=this._resBundle.getMetaResource(ao[i]);var eo=this._makeCbName(co,this._AD_MAN_TYPE);var fo=this._latchCompleteCb.getMetadata(eo,xmp.util.internals.MetadataMap.defaultObj);if(!fo.isError()){var go=this._AD_REQUEST_ID_PREFIX+xmp.zeroPad(bo.length,2);var ho=this._buildAdServerRelUrl(co,fo.getText());bo.push({name:go,value:ho,type:xmp.net.AjaxRequestManager.POST_FORM_TYPE});this._adDataArray.push({'adReqId':go,'res':co});}
else{co._setErrorMessage(fo.getErrorMessage());}}
if(bo.length===0){this._end();}
else{bo.reverse();var io='/multi';var cb=this._createCb(null,'adCompositor',this._handleAdServerARMResponse);xmp.net.AjaxRequestManager.getInstance().request(io,cb,'adCompositor',io,xmp.net.ContentTypes.TEXT,bo);}};xmp.createNamespace("xmp.baseplayer.internals");xmp.baseplayer.internals.VideoContentMetaFileLoader=function(jo,ko){this._logger=new xmp.util.internals.CategoryLogger('VideoContentMetaFileLoader');this._THIS_TYPE='videoContentMeta';this._owner=jo;this._loaderId=ko;this._handleArray=[];this._handleMap={};this._perIdCallback=null;this._allLoadedCallback=null;this._loadedCount=0;this._loadCalled=false;};xmp.baseplayer.internals.VideoContentMetaFileLoader.prototype.getLoaderId=function(){return this._loaderId;};xmp.baseplayer.internals.VideoContentMetaFileLoader.prototype.setIds=function(lo,mo){this._loadCalled=false;this._handleArray=[];this._perIdCallback=mo;var no={};for(var i=0;i<lo.length;i++){var id=lo[i];if(!(typeof id==='string'&&id.length>0)){throw new xmp.util.internals.InvalidArgsError("The 'ids' argument must be an array of non-empty strings.");}
if(typeof no[id]!=='undefined'){this._logger.warn('Skipping duplicate ID: '+id);continue;}
no[id]=id;var oo=xmp.baseplayer.internals.MetaFileCache.getInstance().findOrCreate(this._THIS_TYPE,id,this,-1);var po={h:oo,ready:false};this._handleArray.push(po);this._handleMap[oo.getId()]=po;}
return this._extractPlayableDataArray();};xmp.baseplayer.internals.VideoContentMetaFileLoader.prototype.setAllLoadedCallback=function(qo){this._allLoadedCallback=qo;};xmp.baseplayer.internals.VideoContentMetaFileLoader.prototype.load=function(){this._loadCalled=true;if(this._handleArray.length===0){this._releaseThis();this._notifyAllLoaded();return;}
this._loadedCount=0;for(var i=0;i<this._handleArray.length;i++){var ro=this._handleArray[i];if(ro.ready){this._notifyPerFile(ro.h);}}};xmp.baseplayer.internals.VideoContentMetaFileLoader.prototype._extractPlayableDataArray=function(){var so=[];for(var i=0;i<this._handleArray.length;i++){var to=this._handleArray[i].h;so.push(to.getDataObject());}
return so;};xmp.baseplayer.internals.VideoContentMetaFileLoader.prototype._notifyPerFile=function(uo){if(uo.isLoaded()){this._loadedCount++;this._notifyPerFileCore(uo);}
if(this._loadedCount>=this._handleArray.length){this._releaseThis();this._notifyAllLoaded();}};xmp.baseplayer.internals.VideoContentMetaFileLoader.prototype._releaseThis=function(){if(this._owner!==null){this._owner._release(this);this._owner=null;}};xmp.baseplayer.internals.VideoContentMetaFileLoader.prototype._notifyPerFileCore=function(vo){try{if(this._perIdCallback!==null){this._perIdCallback.call(vo.getDataObject());}}
catch(e){this._logger.warn('Error calling per-file-callback',e);}};xmp.baseplayer.internals.VideoContentMetaFileLoader.prototype._notifyAllLoaded=function(){try{if(this._allLoadedCallback!==null){this._allLoadedCallback.call();}}
catch(e){var wo=new xmp.baseplayer.ApplicationError(e,'badVideoJson',e.context,null);this._logger.warn(wo.message,wo);}};xmp.baseplayer.internals.VideoContentMetaFileLoader.prototype._notifyFileRequestLoaded=function(xo){if(this._loadCalled){this._notifyPerFile(xo);}
else{var yo=this._handleMap[xo.getId()];if(yo.h!==xo){throw new Error('Unexpected, handles not the same reference.');}
yo.ready=true;}};xmp.baseplayer.internals.VideoContentMetaFileLoader.prototype._loadFileRequest=function(zo){var Ao=null;try{Ao=new xmp.util.PlayableData(zo.getId());zo._setDataObject(Ao);var Bo=new xmp.util.Callback('VideoContentMetaFileLoader'+'_'+this.getLoaderId()+'_'+zo.getId(),this._handleAjaxResponse,this);var Co=xmp.net.AjaxRequestManager.getInstance();Bo.setMetadata('handle',zo);Co.request(zo.getId(),Bo,zo.getType(),zo.getId(),xmp.net.ContentTypes.JSON,null);return xmp.baseplayer.internals.FileRequestHandle.STATE_LOADING;}
catch(e){try{if(Ao!==null){Ao._setErrorMessage(xmp.extractErrorMessage(e));}}
catch(e2){this._logger.warn('Second chance error handling created file request',e2);}
throw e;}};xmp.baseplayer.internals.VideoContentMetaFileLoader.prototype._handleAjaxResponse=function(Do,Eo){var Fo=Do.getMetadata('handle',{});var Go=Fo.getDataObject();if(!Eo.isError()){Go._setRawData(Eo.getJsonObject());}
else{var Ho=new xmp.baseplayer.ApplicationError(Eo.getErrorObject(),'FailToGetVideoJson','VideoContent',[{label:'url',text:Eo.getFullUrl()}]);this._logger.warn(Ho.message,Ho);Fo._setErrorMessage(Eo.getErrorMessage());Go._setErrorMessage(Eo.getErrorMessage());}
Fo._setAsLoaded();};xmp.createNamespace("xmp.baseplayer.internals");xmp.baseplayer.internals.VideoPromoMetaFileLoader=function(Io,Jo){this._logger=new xmp.util.internals.CategoryLogger('VideoPromoMetaFileLoader');this._THIS_TYPE='videoPromoMeta';this._owner=Io;this._loaderId=Jo;this._playableNode=null;this._callback=null;};xmp.baseplayer.internals.VideoPromoMetaFileLoader.prototype.getLoaderId=function(){return this._loaderId;};xmp.baseplayer.internals.VideoPromoMetaFileLoader.prototype.setNode=function(Ko,Lo){this._playableNode=Ko;this._callback=Lo;};xmp.baseplayer.internals.VideoPromoMetaFileLoader.prototype.load=function(){var Mo=new xmp.util.Callback('VideoPromoMetaFileLoader'+'_'+this._loaderId,this._handleAjaxResponse,this);var No=xmp.net.AjaxRequestManager.getInstance();var Oo=this._playableNode.getPlayableData();var id=Oo.getMetaResourceId();No.request(id,Mo,this._THIS_TYPE,id,xmp.net.ContentTypes.JSON,null);};xmp.baseplayer.internals.VideoPromoMetaFileLoader.prototype._handleAjaxResponse=function(Po,Qo){var Ro=this._playableNode.getPlayableData();if(!Qo.isError()){var So=new xmp.baseplayer.ApplicationError(Qo.getErrorObject(),'FailToGetPromoJson','VideoPromo',[{label:'url',text:Qo.getFullUrl()}]);this._logger.warn(So.message,So);Ro._setRawData(Qo.getJsonObject());}
else{Ro._setErrorMessage(Qo.getErrorMessage());}
if(this._owner!==null){this._owner._release(this);this._owner=null;}
try{this._callback.call(this._playableNode);}
catch(e){this._logger.warn('Error calling callback',e);}};xmp.createNamespace("xmp.baseplayer.listeners");xmp.baseplayer.listeners.CompositeNodeListener=function(To){this._com_logger=new xmp.util.internals.CategoryLogger('CompositeNodeListener');this._constants=xmp.baseplayer.listeners.CompositeNodeListener;xmp.baseplayer.listeners.CompositeNodeListener.ctor.call(this,this._constants.COMPOSITE_NODE_LISTENER,To);this.children=[];};xmp.DERIVE_CLASS(xmp.baseplayer.listeners.AbstractNodeListener,xmp.baseplayer.listeners.CompositeNodeListener);xmp.baseplayer.listeners.CompositeNodeListener.COMPOSITE_NODE_LISTENER="Composite";xmp.baseplayer.listeners.CompositeNodeListener.INITIALIZE="Initialize";xmp.baseplayer.listeners.CompositeNodeListener.COMPLETE="Complete";xmp.baseplayer.listeners.CompositeNodeListener.RENDER="Render";xmp.baseplayer.listeners.CompositeNodeListener.DYNAMIC_RULES="DynamicRules";xmp.baseplayer.listeners.CompositeNodeListener.TIMELINE_CHANGE="TimelineChange";xmp.baseplayer.listeners.CompositeNodeListener.CAN_USER_CONTROL="CanUserControl";xmp.baseplayer.listeners.CompositeNodeListener.CAN_COMPLETE_NOW="CanCompleteNow";xmp.baseplayer.listeners.CompositeNodeListener.COMPLETE_ASNCH="CompleteAsynch";xmp.baseplayer.listeners.CompositeNodeListener.OVERRIDE_AD_RESOURCES="OverrideAdResources";xmp.baseplayer.listeners.CompositeNodeListener.VALIDATE="Validate";xmp.baseplayer.listeners.CompositeNodeListener.prototype.canUserControl=function(Uo){return this.dispatch(this._constants.CAN_USER_CONTROL,[Uo]);};xmp.baseplayer.listeners.CompositeNodeListener.prototype.handleDynamicRules=function(Vo){this.dispatch(this._constants.DYNAMIC_RULES,[Vo]);};xmp.baseplayer.listeners.CompositeNodeListener.prototype.handleRender=function(Wo){this.dispatch(this._constants.RENDER,[Wo]);};xmp.baseplayer.listeners.CompositeNodeListener.prototype.handleInitialize=function(Xo){this.dispatch(this._constants.INITIALIZE,[Xo]);};xmp.baseplayer.listeners.CompositeNodeListener.prototype.handleComplete=function(Yo){this.dispatch(this._constants.COMPLETE,[Yo]);};xmp.baseplayer.listeners.CompositeNodeListener.prototype.canCompleteNow=function(Zo){return this.dispatch(this._constants.CAN_COMPLETE_NOW,[Zo]);};xmp.baseplayer.listeners.CompositeNodeListener.prototype.handleCompleteAsynch=function($o,ap){this.dispatch(this._constants.COMPLETE_ASNCH,[$o,ap]);};xmp.baseplayer.listeners.CompositeNodeListener.prototype.handleOpen=function(bp){this.dispatch(xmp.OPEN,[bp]);};xmp.baseplayer.listeners.CompositeNodeListener.prototype.handleConnecting=function(cp){this.dispatch(xmp.CONNECTING,[cp]);};xmp.baseplayer.listeners.CompositeNodeListener.prototype.handleConnected=function(dp){this.dispatch(xmp.CONNECTED,[dp]);};xmp.baseplayer.listeners.CompositeNodeListener.prototype.handlePlay=function(ep){this.dispatch(xmp.PLAY,[ep]);};xmp.baseplayer.listeners.CompositeNodeListener.prototype.handleFirstFrameRendered=function(fp){this.dispatch(xmp.FIRST_FRAME_RENDERED,[fp]);};xmp.baseplayer.listeners.CompositeNodeListener.prototype.handlePause=function(gp){this.dispatch(xmp.PAUSE,[gp]);};xmp.baseplayer.listeners.CompositeNodeListener.prototype.handleStop=function(hp){this.dispatch(xmp.STOP,[hp]);};xmp.baseplayer.listeners.CompositeNodeListener.prototype.handleRewind=function(ip){this.dispatch(xmp.REWIND,[ip]);};xmp.baseplayer.listeners.CompositeNodeListener.prototype.handleFastForward=function(jp){this.dispatch(xmp.FAST_FORWARD,[jp]);};xmp.baseplayer.listeners.CompositeNodeListener.prototype.handleSeekable=function(kp){this.dispatch(xmp.SEEKABLE,[kp]);};xmp.baseplayer.listeners.CompositeNodeListener.prototype.handleEnded=function(lp){this.dispatch(xmp.ENDED,[lp]);};xmp.baseplayer.listeners.CompositeNodeListener.prototype.handleBuffering=function(mp,np){this.dispatch(xmp.BUFFERING,[mp,np]);};xmp.baseplayer.listeners.CompositeNodeListener.prototype.handleTimelineChange=function(op,pp,qp){this.dispatch(this._constants.TIMELINE_CHANGE,[op,pp,qp]);};xmp.baseplayer.listeners.CompositeNodeListener.prototype.handleError=function(rp,e){this.dispatch(xmp.ERRORS,[rp,e]);};xmp.baseplayer.listeners.CompositeNodeListener.prototype.handleOverrideAdResources=function(sp,tp){this.dispatch(this._constants.OVERRIDE_AD_RESOURCES,[sp,tp]);};xmp.baseplayer.listeners.CompositeNodeListener.prototype.handleValidate=function(up){this.dispatch(this._constants.VALIDATE,[up]);};xmp.baseplayer.listeners.CompositeNodeListener.prototype.dispatch=function(vp,wp){var xp=this.children.length;for(var i=0;i<xp;i++){var yp=this.children[i];var zp=yp.callbacks[vp];var Ap=null;try{Ap=zp.method.apply(yp.listener,wp);}
catch(e){this._com_logger.warn('Error dispatching: '+vp+' on '+yp.listener.getId()+' node listener.',e);try{var Bp=wp[0];yp.listener.handleError(Bp,e);}
catch(e2){try{this._com_logger.warn('Error calling handleError while dispatching: '+vp+' on '+yp.listener.getId()+' node listener.',e2);}
catch(e3){}}}
if(zp.return_type===xmp.BOOLEAN_TYPE&&false===Ap){return false;}}
return true;};xmp.baseplayer.listeners.CompositeNodeListener.prototype.addChild=function(Cp){var Dp={listener:Cp,callbacks:null};this.initChildCallbacks(Dp,Cp);this.children.push(Dp);};xmp.baseplayer.listeners.CompositeNodeListener.prototype.initChildCallbacks=function(Ep,Fp){var Gp=[{name:this._constants.CAN_USER_CONTROL,data:{method:Fp.canUserControl,return_type:xmp.BOOLEAN_TYPE}},{name:this._constants.DYNAMIC_RULES,data:{method:Fp.handleDynamicRules,return_type:xmp.UNDEFINED_TYPE}},{name:this._constants.INITIALIZE,data:{method:Fp.handleInitialize,return_type:xmp.UNDEFINED_TYPE}},{name:this._constants.COMPLETE,data:{method:Fp.handleComplete,return_type:xmp.UNDEFINED_TYPE}},{name:this._constants.RENDER,data:{method:Fp.handleRender,return_type:xmp.UNDEFINED_TYPE}},{name:xmp.OPEN,data:{method:Fp.handleOpen,return_type:xmp.UNDEFINED_TYPE}},{name:xmp.CONNECTING,data:{method:Fp.handleConnecting,return_type:xmp.UNDEFINED_TYPE}},{name:xmp.CONNECTED,data:{method:Fp.handleConnected,return_type:xmp.UNDEFINED_TYPE}},{name:xmp.FIRST_FRAME_RENDERED,data:{method:Fp.handleFirstFrameRendered,return_type:xmp.UNDEFINED_TYPE}},{name:xmp.PLAY,data:{method:Fp.handlePlay,return_type:xmp.UNDEFINED_TYPE}},{name:xmp.PAUSE,data:{method:Fp.handlePause,return_type:xmp.UNDEFINED_TYPE}},{name:xmp.STOP,data:{method:Fp.handleStop,return_type:xmp.UNDEFINED_TYPE}},{name:xmp.REWIND,data:{method:Fp.handleRewind,return_type:xmp.UNDEFINED_TYPE}},{name:xmp.FAST_FORWARD,data:{method:Fp.handleFastForward,return_type:xmp.UNDEFINED_TYPE}},{name:xmp.SEEKABLE,data:{method:Fp.handleSeekable,return_type:xmp.UNDEFINED_TYPE}},{name:xmp.ENDED,data:{method:Fp.handleEnded,return_type:xmp.UNDEFINED_TYPE}},{name:xmp.BUFFERING,data:{method:Fp.handleBuffering,return_type:xmp.UNDEFINED_TYPE}},{name:this._constants.TIMELINE_CHANGE,data:{method:Fp.handleTimelineChange,return_type:xmp.UNDEFINED_TYPE}},{name:xmp.ERRORS,data:{method:Fp.handleError,return_type:xmp.UNDEFINED_TYPE}},{name:this._constants.CAN_COMPLETE_NOW,data:{method:Fp.canCompleteNow,return_type:xmp.BOOLEAN_TYPE}},{name:this._constants.COMPLETE_ASNCH,data:{method:Fp.handleCompleteAsynch,return_type:xmp.UNDEFINED_TYPE}},{name:this._constants.OVERRIDE_AD_RESOURCES,data:{method:Fp.handleOverrideAdResources,return_type:xmp.UNDEFINED_TYPE}},{name:this._constants.VALIDATE,data:{method:Fp.handleValidate,return_type:xmp.UNDEFINED_TYPE}}];Ep.callbacks={};var Hp=Gp.length;for(var i=0;i<Hp;i++){Ep.callbacks[Gp[i].name]=Gp[i].data;}};xmp.createNamespace("xmp.baseplayer.listeners");xmp.baseplayer.listeners.DefaultAdNodeListener=function(Ip,Jp){xmp.baseplayer.listeners.DefaultAdNodeListener.ctor.call(this,Ip,Jp);this._logger=new xmp.util.internals.CategoryLogger('DefaultAdNodeListener');};xmp.DERIVE_CLASS(xmp.baseplayer.listeners.DefaultBaseNodeListener,xmp.baseplayer.listeners.DefaultAdNodeListener);xmp.baseplayer.listeners.DefaultAdNodeListener.prototype.canUserControl=function(Kp){var Lp=xmp.util.SettingsManager.getInstance().getContextNode().getNodeForPath('BasePlayer').getBoolean('user can control ad',false);return Lp;};xmp.baseplayer.listeners.DefaultAdNodeListener.prototype.handleComplete=function(Mp){var Np=Mp.getPlayableData();Mp.setURI(Np.getPlayableId());Mp.setMimeTypes(Np.getMimeTypeArray());Mp.setStreamingMode(xmp.AD_STREAMING_MODE);};xmp.baseplayer.listeners.DefaultAdNodeListener.prototype.handleRender=function(Op){var Pp=Op.getMetaResource('primary');if(Pp!==null){this._logger.info('Playing ad with tile ID: '+Pp.getCompanionAdId());}
xmp.baseplayer.listeners.DefaultAdNodeListener.base.handleRender.call(this,Op);};xmp.createNamespace("xmp.baseplayer.listeners");xmp.baseplayer.listeners.DefaultNextUpSlateNodeListener=function(Qp,Rp){xmp.baseplayer.listeners.DefaultNextUpSlateNodeListener.ctor.call(this,Qp,Rp);this._logger=new xmp.util.internals.CategoryLogger('DefaultNextUpSlateNodeListener');};xmp.DERIVE_CLASS(xmp.baseplayer.listeners.DefaultSlateNodeListener,xmp.baseplayer.listeners.DefaultNextUpSlateNodeListener);xmp.baseplayer.listeners.DefaultNextUpSlateNodeListener.prototype.handleComplete=function(Sp){xmp.baseplayer.listeners.DefaultNextUpSlateNodeListener.base.handleComplete.call(this,Sp);var Tp=this._findNextContentNode();if(Tp!==null){Sp.setMetadata("headline",Tp.getPlayableData().getDataObject().headline);}
else{this._logger.debug("Unusual state: The NextUpSlate failed to find a next content node.");}};xmp.createNamespace("xmp.baseplayer.listeners");xmp.baseplayer.listeners.DefaultPlayerListener=function(Up,Vp){xmp.baseplayer.listeners.DefaultPlayerListener.ctor.call(this,Up,Vp);this._logger=new xmp.util.internals.CategoryLogger('DefaultPlayerListener');};xmp.DERIVE_CLASS(xmp.baseplayer.listeners.DefaultBaseNodeListener,xmp.baseplayer.listeners.DefaultPlayerListener);xmp.baseplayer.listeners.DefaultPlayerListener.prototype.handleRender=function(Wp){};xmp.baseplayer.listeners.DefaultPlayerListener.prototype.handleError=function(Xp,e){};xmp.baseplayer.listeners.DefaultPlayerListener.prototype.handleOpen=function(Yp){this.setStatus(Yp,xmp.OPEN);};xmp.baseplayer.listeners.DefaultPlayerListener.prototype.handleConnecting=function(Zp){this.setStatus(Zp,xmp.CONNECTING);};xmp.baseplayer.listeners.DefaultPlayerListener.prototype.handleConnected=function($p){this.setStatus($p,xmp.CONNECTED);};xmp.baseplayer.listeners.DefaultPlayerListener.prototype.handlePlay=function(aq){this.setStatus(aq,xmp.PLAY);};xmp.baseplayer.listeners.DefaultPlayerListener.prototype.handlePause=function(bq){this.setStatus(bq,xmp.PAUSE);};xmp.baseplayer.listeners.DefaultPlayerListener.prototype.handleStop=function(cq){this.setStatus(cq,xmp.STOP);};xmp.baseplayer.listeners.DefaultPlayerListener.prototype.handleRewind=function(dq){this.setStatus(dq,xmp.REWIND);};xmp.baseplayer.listeners.DefaultPlayerListener.prototype.handleFastForward=function(eq){this.setStatus(eq,xmp.FAST_FORWARD);};xmp.baseplayer.listeners.DefaultPlayerListener.prototype.handleSeekable=function(fq){this.setStatus(fq,xmp.SEEKABLE);};xmp.baseplayer.listeners.DefaultPlayerListener.prototype.handleEnded=function(gq){this.setStatus(gq,xmp.ENDED);};xmp.baseplayer.listeners.DefaultPlayerListener.prototype.handleBuffering=function(hq,iq){this.setStatus(hq,xmp.BUFFERING,iq);};xmp.baseplayer.listeners.DefaultPlayerListener.prototype.setStatus=function(jq,kq,lq){this._logger.debug('Player Listener setStatus, override to do specific handling.');};xmp.createNamespace("xmp.baseplayer.listeners");xmp.baseplayer.listeners.DefaultPromoNodeListener=function(mq,nq){xmp.baseplayer.listeners.DefaultPromoNodeListener.ctor.call(this,mq,nq);};xmp.DERIVE_CLASS(xmp.baseplayer.listeners.DefaultBaseNodeListener,xmp.baseplayer.listeners.DefaultPromoNodeListener);xmp.baseplayer.listeners.DefaultPromoNodeListener.prototype.handleComplete=function(oq){var pq=oq.getPlayableData();oq.setMimeTypes(pq.getMimeTypeArray());var qq=pq.getDataObject().sizes;if(qq&&qq.length>0){oq.setSizes(pq.getDataObject().sizes);}
oq.setURI(pq.getDataObject().location);oq.setStreamingMode(pq.getDataObject().streamingMode);};xmp.createNamespace("xmp.baseplayer.listeners");xmp.baseplayer.listeners.DefaultStartSlateNodeListener=function(rq,sq){xmp.baseplayer.listeners.DefaultStartSlateNodeListener.ctor.call(this,rq,sq);this._logger=new xmp.util.internals.CategoryLogger('DefaultStartSlateNodeListener');};xmp.DERIVE_CLASS(xmp.baseplayer.listeners.DefaultSlateNodeListener,xmp.baseplayer.listeners.DefaultStartSlateNodeListener);xmp.baseplayer.listeners.DefaultStartSlateNodeListener.prototype.handleComplete=function(tq){xmp.baseplayer.listeners.DefaultStartSlateNodeListener.base.handleComplete.call(this,tq);var uq=this._findNextContentNode();if(uq!==null){var vq=uq.getPlayableData().getDataObject().images;var wq=vq.length;var xq=[];var yq={};for(var i=0;i<wq;i++){xq.push(vq[i].id);yq[vq[i].id]=vq[i].resource;}
tq.setMetadata("image",yq[xmp.PlayerPolicy.getSizeFromPlayer(xq)]);}
else{this._logger.debug("Unusual state: The StartSlate failed to find a next content node.");}};xmp.createNamespace("xmp.baseplayer.listeners");xmp.baseplayer.listeners.DefaultVideoNodeListener=function(zq,Aq){xmp.baseplayer.listeners.DefaultVideoNodeListener.ctor.call(this,zq,Aq,false);};xmp.DERIVE_CLASS(xmp.baseplayer.listeners.DefaultBaseNodeListener,xmp.baseplayer.listeners.DefaultVideoNodeListener);xmp.baseplayer.listeners.DefaultVideoNodeListener.prototype.handleInitialize=function(Bq){var Cq=Bq.getPlayableData();Bq.setMimeTypes(Cq.getMimeTypeArray());var Dq=Cq.getDataObject().sizes;if(Dq&&Dq.length>0){Bq.setSizes(Cq.getDataObject().sizes);}
Bq.setURI(Cq.getDataObject().location);Bq.setStreamingMode(Cq.getDataObject().streamingMode);};xmp.createNamespace("xmp.baseplayer.listeners.internal");xmp.baseplayer.listeners.internal.AdLoaderNodeListener=function(Eq){xmp.baseplayer.listeners.internal.AdLoaderNodeListener.ctor.call(this,'AdLoader',Eq);};xmp.DERIVE_CLASS(xmp.baseplayer.listeners.internal.AdResNodeListener,xmp.baseplayer.listeners.internal.AdLoaderNodeListener);xmp.baseplayer.listeners.internal.AdLoaderNodeListener.prototype._handleResBundleLoaded=function(Fq,Gq){if(Gq.isError()){Fq.getPlayableData()._setErrorMessage(Gq.getErrorMessage());}
else{var Hq=Fq.getAssociatedResourceBundleType();var Iq=Gq.getMetaResource(Hq);if(Iq.isError()){Fq.getPlayableData()._setErrorMessage(Iq.getErrorMessage());}
else{Fq.getPlayableData()._setRawData(Iq.getDataObject());}}};xmp.baseplayer.listeners.internal.NonAdLoaderNodeListener=function(Jq){xmp.baseplayer.listeners.internal.NonAdLoaderNodeListener.ctor.call(this,'NonAdLoader',Jq);};xmp.DERIVE_CLASS(xmp.baseplayer.listeners.internal.AdResNodeListener,xmp.baseplayer.listeners.internal.NonAdLoaderNodeListener);xmp.createNamespace("xmp.baseplayer.listeners.internal");xmp.baseplayer.listeners.internal.FirstFrameNodeListener=function(Kq){this._logger=new xmp.util.internals.CategoryLogger('FirstFrameNodeListener');this._FIRST_FRAME_TIMEOUT_MIN=10000;this._firstFrameTimer=null;this._FIRST_FRAME_TIMER_ID="FIRST_FRAME_TIMER";this._currentNode=null;xmp.baseplayer.listeners.internal.FirstFrameNodeListener.ctor.call(this,'FirstFrameCheck',Kq);};xmp.DERIVE_CLASS(xmp.baseplayer.listeners.AbstractNodeListener,xmp.baseplayer.listeners.internal.FirstFrameNodeListener);xmp.baseplayer.listeners.internal.FirstFrameNodeListener.prototype.handleConnecting=function(Lq){if(Lq.getMimeType()!==xmp.FLASH_MIME_TYPE){return;}
if(this._firstFrameTimer){this._firstFrameTimer.stop();}
var Mq=new xmp.util.Callback('basePlayerTimeout',this._handleFirstFrameTimeout,this);var Nq=xmp.util.SettingsManager.getInstance().getGlobalContextNode();var Oq=Nq.getInt('first frame timeout',this._FIRST_FRAME_TIMEOUT_MIN);this._firstFrameTimer=new xmp.util.Timer(this._FIRST_FRAME_TIMER_ID,Oq,1,Mq);this._currentNode=Lq;this._startTimer(this._firstFrameTimer);};xmp.baseplayer.listeners.internal.FirstFrameNodeListener.prototype.handleFirstFrameRendered=function(Pq){this._reset();};xmp.baseplayer.listeners.internal.FirstFrameNodeListener.prototype.handlePause=function(Qq){this._reset();};xmp.baseplayer.listeners.internal.FirstFrameNodeListener.prototype.handleStop=function(Rq){this._reset();};xmp.baseplayer.listeners.internal.FirstFrameNodeListener.prototype.handleRewind=function(Sq){this._reset();};xmp.baseplayer.listeners.internal.FirstFrameNodeListener.prototype.handleFastForward=function(Tq){this._reset();};xmp.baseplayer.listeners.internal.FirstFrameNodeListener.prototype.handleSeekable=function(Uq){this._reset();};xmp.baseplayer.listeners.internal.FirstFrameNodeListener.prototype.handleError=function(Vq,e){this._reset();};xmp.baseplayer.listeners.internal.FirstFrameNodeListener.prototype._reset=function(){this._currentNode=null;this._stopTimer(this._firstFrameTimer);this._firstFrameTimer=null;};xmp.baseplayer.listeners.internal.FirstFrameNodeListener.prototype._handleFirstFrameTimeout=function(){var Wq=xmp.CriticalException.createCriticalException(xmp.XmpErrorCodes.CRITICAL_FIRST_FRAME_TIMEOUT,'FirstFrameNodeListener',"Timeout received in playing "+this._currentNode.getBestId());this._logger.critical('First Frame Timeout',Wq);this.getPlayer().getMediaPlayer().close();this.getPlayer().onError(this._currentNode,Wq);this._reset();};xmp.baseplayer.listeners.internal.FirstFrameNodeListener.prototype._startTimer=function(Xq){if(Xq){Xq.start();}};xmp.baseplayer.listeners.internal.FirstFrameNodeListener.prototype._stopTimer=function(Yq){if(Yq){Yq.stop();}};xmp.createNamespace("xmp.baseplayer.listeners.internal");xmp.baseplayer.listeners.internal.MeteringNodeListener=function(Zq){this._constants=xmp.baseplayer.listeners.internal.MeteringNodeListener;xmp.baseplayer.listeners.internal.MeteringNodeListener.ctor.call(this,this._constants.METERING_NODE_LISTENER,Zq);};xmp.DERIVE_CLASS(xmp.baseplayer.listeners.internal.TriggerNodeListener,xmp.baseplayer.listeners.internal.MeteringNodeListener);xmp.baseplayer.listeners.internal.MeteringNodeListener.METERING_NODE_LISTENER="Metering";xmp.createNamespace("xmp.baseplayer.listeners.internal");xmp.baseplayer.listeners.internal.PromoLoaderNodeListener=function($q){xmp.baseplayer.listeners.internal.PromoLoaderNodeListener.ctor.call(this,'PromoLoader',$q);};xmp.DERIVE_CLASS(xmp.baseplayer.listeners.AbstractNodeListener,xmp.baseplayer.listeners.internal.PromoLoaderNodeListener);xmp.baseplayer.listeners.internal.PromoLoaderNodeListener.prototype.canCompleteNow=function(ar){if(ar.getPlayableData().isError()){return true;}
return ar.getPlayableData().isLoaded();};xmp.baseplayer.listeners.internal.PromoLoaderNodeListener.prototype.handleCompleteAsynch=function(br,cr){var dr=xmp.baseplayer.MetaFileLoaderFactory.getInstance().create('videoPromoMeta');var er=new xmp.util.Callback('gotPromoCallback',this._gotPromoCallback,this);er.setMetadata('RelayCallback',cr);dr.setNode(br,er);dr.load();};xmp.baseplayer.listeners.internal.PromoLoaderNodeListener.prototype._gotPromoCallback=function(fr,gr){var hr=fr.getMetadata('RelayCallback',{});hr.call(gr);};xmp.createNamespace("xmp.baseplayer.listeners.internal");xmp.baseplayer.listeners.internal.TrackingNodeListener=function(ir){this._constants=xmp.baseplayer.listeners.internal.TrackingNodeListener;xmp.baseplayer.listeners.internal.TrackingNodeListener.ctor.call(this,this._constants.TRACKING_NODE_LISTENER,ir);};xmp.DERIVE_CLASS(xmp.baseplayer.listeners.internal.TriggerNodeListener,xmp.baseplayer.listeners.internal.TrackingNodeListener);xmp.baseplayer.listeners.internal.TrackingNodeListener.TRACKING_NODE_LISTENER="Tracking";xmp.internal_settings_pref_api={type:"system",map:[],nodes:[{name:"PlayerContexts",map:[],nodes:[{name:"Generic",map:[],nodes:[{name:"BasePlayer",map:[{key:"user can control ad",value:"true"},{key:"look ahead and behind count",value:"7"},{key:"bandwidth threshold",value:"500"},{key:"videoAdMetaLoader",value:"videoAdMeta"},{key:"Ad metering image URL",value:"NO_DEFAULT_VALUE"},{key:"rule classes relative URL",value:"NO_DEFAULT_VALUE"},{key:"rule classes namespace",value:"NO_DEFAULT_VALUE"}],nodes:[{name:"ad patterns",map:[],nodes:[]},{name:"PlayerSizes",map:[],nodes:[]}]},{name:"invariantRules",map:[],nodes:[]},{name:"Additional segvars",map:[],nodes:[]},{name:"pattern parameters",map:[],nodes:[]},{name:"ad data types",map:[{key:"primary",value:"videoJson"},{key:"synch_unit",value:"url"}],nodes:[]},{name:"UrlStrategies",map:[],nodes:[{name:"Octoshape",map:[{key:"octo poll interval",value:"2000"},{key:"octo try limit",value:"8"},{key:"octo can use fn",value:"return ((xmp.getQueryArgOpt(\"xmpUseOctoshape\", \"true\") === \"true\") && ((xmp.isWindowsOS() && (xmp.isIEBrowser() || xmp.isFirefoxBrowser())) || (xmp.isMacOSX() && (xmp.isSafariBrowser() || xmp.isFirefoxBrowser()))));"}],nodes:[{name:"url mapping",map:[],nodes:[]}]}]}]},{name:"Global",map:[{key:"first frame timeout",value:"10000"}],nodes:[{name:"rootUrlMap",map:[],nodes:[{name:"videoContentMeta",map:[{key:"rootUrl",value:"NO_DEFAULT_VALUE"},{key:"transportType",value:"flash"}],nodes:[]},{name:"videoTracking",map:[{key:"rootUrl",value:"NO_DEFAULT_VALUE"},{key:"transportType",value:"flash"}],nodes:[]},{name:"videoPromoMeta",map:[{key:"rootUrl",value:"NO_DEFAULT_VALUE"},{key:"transportType",value:"flash"}],nodes:[]},{name:"adPolicy",map:[{key:"rootUrl",value:"NO_DEFAULT_VALUE"},{key:"transportType",value:"flash"}],nodes:[]},{name:"ruleClasses",map:[{key:"rootUrl",value:"NO_DEFAULT_VALUE"},{key:"transportType",value:"flash"}],nodes:[]},{name:"adMan",map:[{key:"rootUrl",value:"NO_DEFAULT_VALUE"},{key:"transportType",value:"flash"}],nodes:[]},{name:"dhtmlObject",map:[{key:"rootUrl",value:"NO_DEFAULT_VALUE"},{key:"transportType",value:"flash"}],nodes:[]},{name:"errorDhtmlObject",map:[{key:"rootUrl",value:"NO_DEFAULT_VALUE"},{key:"transportType",value:"xhr"}],nodes:[]},{name:"controlStreamResource",map:[{key:"rootUrl",value:"NO_DEFAULT_VALUE"},{key:"transportType",value:"flash"}],nodes:[]},{name:"internalUserCheckResource",map:[{key:"rootUrl",value:"NO_DEFAULT_VALUE"}],nodes:[]},{name:"video",map:[],nodes:[{name:"Flash",map:[],nodes:[{name:"ad",map:[{key:"rootUrl",value:"NO_DEFAULT_VALUE"}],nodes:[]},{name:"vod",map:[{key:"rootUrl",value:"NO_DEFAULT_VALUE"}],nodes:[]}]},{name:"WindowsMedia",map:[],nodes:[{name:"ad",map:[{key:"rootUrl",value:"NO_DEFAULT_VALUE"}],nodes:[]},{name:"vod",map:[{key:"rootUrl",value:"NO_DEFAULT_VALUE"}],nodes:[]},{name:"live",map:[{key:"rootUrl",value:"NO_DEFAULT_VALUE"}],nodes:[]},{name:"control",map:[{key:"rootUrl",value:"NO_DEFAULT_VALUE"}],nodes:[]}]},{name:"QuickTime",map:[],nodes:[{name:"vod",map:[{key:"rootUrl",value:"NO_DEFAULT_VALUE"}],nodes:[]}]}]},{name:"image",map:[{key:"rootUrl",value:"NO_DEFAULT_VALUE"},{key:"transportType",value:"flash"}],nodes:[]},{name:"adVideo",map:[{key:"rootUrl",value:"NO_DEFAULT_VALUE"},{key:"transportType",value:"flash"}],nodes:[]},{name:"swf",map:[{key:"rootUrl",value:"NO_DEFAULT_VALUE"},{key:"transportType",value:"flash"}],nodes:[]},{name:"adServer",map:[{key:"rootUrl",value:"NO_DEFAULT_VALUE"},{key:"transportType",value:"flash"}],nodes:[]},{name:"adCompositor",map:[{key:"rootUrl",value:"NO_DEFAULT_VALUE"},{key:"transportType",value:"flash"},{key:"requestVerb",value:"POST"}],nodes:[]}]},{name:"loaders",map:[],nodes:[{name:"videoContentMeta",map:[{key:"JSClass",value:"xmp.baseplayer.internals.VideoContentMetaFileLoader"}],nodes:[]},{name:"videoPromoMeta",map:[{key:"JSClass",value:"xmp.baseplayer.internals.VideoPromoMetaFileLoader"}],nodes:[]},{name:"videoAdMeta",map:[{key:"JSClass",value:"xmp.baseplayer.internals.VideoAdMetaFileLoader"}],nodes:[]},{name:"videoCompositeAdMeta",map:[{key:"JSClass",value:"xmp.baseplayer.internals.VideoCompositeAdMetaFileLoader2"}],nodes:[]},{name:"dhtmlObject",map:[{key:"JSClass",value:"xmp.baseplayer.internals.DhtmlObjectMetaFileLoader"}],nodes:[]},{name:"errorDhtmlObject",map:[{key:"JSClass",value:"xmp.baseplayer.internals.ErrorDhtmlObjectMetaFileLoader"}],nodes:[]}]},{name:"Media Player",map:[{key:"Bandwidth Sample Interval",value:"5000"},{key:"Fullscreen Enabled",value:"true"},{key:"Stretch To Fit",value:"true"}],nodes:[]},{name:"PlayingPolicy",map:[],nodes:[{name:"Streaming Modes",map:[{key:"001",value:"live"},{key:"002",value:"control"},{key:"003",value:"ad"},{key:"004",value:"vod"}],nodes:[]},{name:"PlugIns",map:[],nodes:[{name:"Flash",map:[{key:"display-name",value:"Flash PlugIn/ActiveX Player"},{key:"minimum-version",value:"8.0.0"},{key:"download-url",value:"http://www.adobe.com/go/getflashplayer"}],nodes:[]},{name:"WindowsMedia",map:[{key:"display-name",value:"Windows Media Player"},{key:"minimum-version",value:"9.0.0"},{key:"download-url",value:"http://www.microsoft.com/windows/windowsmedia/download"}],nodes:[]},{name:"TurnerMedia",map:[{key:"display-name",value:"Turner Media Plugin"},{key:"minimum-version",value:"1.0.0.9"},{key:"download-url",value:"http://www.cnn.com/download"}],nodes:[]},{name:"QuickTime",map:[{key:"display-name",value:"QuickTime Plugin"},{key:"minimum-version",value:"7.1.2"},{key:"download-url",value:"http://www.apple.com/quicktime/download"}],nodes:[]},{name:"Flip4Mac",map:[{key:"display-name",value:"Flip4Mac Plugin"},{key:"minimum-version",value:"2.1"},{key:"download-url",value:"http://www.flip4mac.com/downloads/wmv_components/Flip4Mac%20WMV%202.1.3.10.dmg"}],nodes:[]},{name:"Octoshape",map:[{key:"display-name",value:"Octoshape Plugin"},{key:"minimum-version",value:"please-get-latest-release-version"},{key:"download-url",value:"http://www.octoshape.com/plugin/get.asp"}],nodes:[]}]},{name:"Native Players",map:[],nodes:[{name:"xmp.FlashPlayer",map:[{key:"Buffer Time",value:"4000"},{key:"Streaming Video Adapter",value:"StreamingVideoMedia"}],nodes:[]},{name:"xmp.WindowsMediaPlayer",map:[],nodes:[]},{name:"xmp.WindowsMediaPlugInPlayer",map:[],nodes:[]},{name:"xmp.QuickTimePlayer",map:[{key:"State Change Polling Interval",value:"200"},{key:"Connection Timeout Interval",value:"30000"}],nodes:[]},{name:"xmp.ImagePlayer",map:[],nodes:[]}]},{name:"Native Player Groups",map:[],nodes:[{name:"WindowsIEPlayers",map:[],nodes:[{name:"001",map:[{key:"mime-type",value:"video/x-ms-wmv"}],nodes:[{name:"Players",map:[{key:"001",value:"xmp.WindowsMediaPlayer"}],nodes:[]}]},{name:"002",map:[{key:"mime-type",value:"video/x-flv"}],nodes:[{name:"Players",map:[{key:"001",value:"xmp.FlashPlayer"}],nodes:[]}]},{name:"003",map:[{key:"mime-type",value:"application/x-image"}],nodes:[{name:"Players",map:[{key:"001",value:"xmp.ImagePlayer"}],nodes:[]}]},{name:"004",map:[{key:"mime-type",value:"video/quicktime"}],nodes:[{name:"Players",map:[{key:"001",value:"xmp.QuickTimePlayer"}],nodes:[]}]}]},{name:"WindowsMozillaPlayers",map:[],nodes:[{name:"001",map:[{key:"mime-type",value:"video/x-ms-wmv"}],nodes:[{name:"Players",map:[{key:"001",value:"xmp.WindowsMediaPlugInPlayer"}],nodes:[]}]},{name:"002",map:[{key:"mime-type",value:"video/x-flv"}],nodes:[{name:"Players",map:[{key:"001",value:"xmp.FlashPlayer"}],nodes:[]}]},{name:"003",map:[{key:"mime-type",value:"application/x-image"}],nodes:[{name:"Players",map:[{key:"001",value:"xmp.ImagePlayer"}],nodes:[]}]},{name:"004",map:[{key:"mime-type",value:"video/quicktime"}],nodes:[{name:"Players",map:[{key:"001",value:"xmp.QuickTimePlayer"}],nodes:[]}]}]},{name:"MacPlayers",map:[],nodes:[{name:"001",map:[{key:"mime-type",value:"video/x-ms-wmv"}],nodes:[{name:"Players",map:[{key:"001",value:"xmp.QuickTimePlayer"}],nodes:[]}]},{name:"002",map:[{key:"mime-type",value:"video/x-flv"}],nodes:[{name:"Players",map:[{key:"001",value:"xmp.FlashPlayer"}],nodes:[]}]},{name:"003",map:[{key:"mime-type",value:"application/x-image"}],nodes:[{name:"Players",map:[{key:"001",value:"xmp.ImagePlayer"}],nodes:[]}]},{name:"004",map:[{key:"mime-type",value:"video/quicktime"}],nodes:[{name:"Players",map:[{key:"001",value:"xmp.QuickTimePlayer"}],nodes:[]}]}]},{name:"LinuxPlayers",map:[],nodes:[{name:"002",map:[{key:"mime-type",value:"video/x-flv"}],nodes:[{name:"Players",map:[{key:"001",value:"xmp.FlashPlayer"}],nodes:[]}]},{name:"003",map:[{key:"mime-type",value:"application/x-image"}],nodes:[{name:"Players",map:[{key:"001",value:"xmp.ImagePlayer"}],nodes:[]}]}]}]},{name:"Supported Platforms",map:[],nodes:[{name:"Windows",map:[{key:"Explorer",value:"WindowsIEPlayers"},{key:"Firefox",value:"WindowsMozillaPlayers"},{key:"Opera",value:"WindowsMozillaPlayers"},{key:"Netscape",value:"WindowsMozillaPlayers"},{key:"Safari",value:"WindowsMozillaPlayers"},{key:"SeaMonkey",value:"WindowsMozillaPlayers"}],nodes:[{name:"PlugIns Overrides",map:[],nodes:[{name:"QuickTime",map:[{key:"minimum-version",value:"7.1.5"}],nodes:[]}]}]},{name:"Mac",map:[{key:"Safari",value:"MacPlayers"},{key:"Firefox",value:"MacPlayers"},{key:"Netscape",value:"MacPlayers"},{key:"Camino",value:"MacPlayers"},{key:"SeaMonkey",value:"MacPlayers"},{key:"Opera",value:"MacPlayers"}],nodes:[{name:"PlugIns Overrides",map:[],nodes:[{name:"Octoshape",map:[{key:"download-url",value:"http://www.octoshape.com/plugin/mac.asp"}],nodes:[]}]}]},{name:"Linux",map:[{key:"Firefox",value:"LinuxPlayers"},{key:"Opera",value:"LinuxPlayers"},{key:"Netscape",value:"LinuxPlayers"},{key:"SeaMonkey",value:"LinuxPlayers"},{key:"Konqueror",value:"LinuxPlayers"}],nodes:[{name:"PlugIns Overrides",map:[],nodes:[{name:"Octoshape",map:[{key:"download-url",value:"http://www.octoshape.com/plugin/linux.asp"}],nodes:[]}]}]}]},{name:"MediaTypes",map:[],nodes:[{name:"Flash",map:[{key:"mime-type",value:"video/x-flv"}],nodes:[]},{name:"WindowsMedia",map:[{key:"mime-type",value:"video/x-ms-wmv"}],nodes:[]},{name:"QuickTime",map:[{key:"mime-type",value:"video/quicktime"}],nodes:[]},{name:"Image",map:[{key:"mime-type",value:"application/x-image"}],nodes:[]}]},{name:"Playback Priority Groups",map:[],nodes:[{name:"DefaultVODPlayback",map:[{key:"001",value:"WindowsMedia"},{key:"002",value:"Flash"},{key:"003",value:"QuickTime"}],nodes:[]},{name:"DefaultAdPlayback",map:[{key:"001",value:"Flash"},{key:"002",value:"WindowsMedia"},{key:"003",value:"QuickTime"}],nodes:[]},{name:"DefaultLivePlayback",map:[{key:"001",value:"WindowsMedia"},{key:"002",value:"Flash"}],nodes:[]},{name:"DefaultControlPlayback",map:[{key:"001",value:"WindowsMedia"}],nodes:[]}]},{name:"Playback Platforms",map:[],nodes:[{name:"Windows",map:[],nodes:[{name:"Explorer",map:[{key:"ad",value:"DefaultAdPlayback"},{key:"vod",value:"DefaultVODPlayback"},{key:"live",value:"DefaultLivePlayback"},{key:"control",value:"DefaultControlPlayback"}],nodes:[]},{name:"Firefox",map:[{key:"ad",value:"DefaultAdPlayback"},{key:"vod",value:"DefaultVODPlayback"},{key:"live",value:"DefaultLivePlayback"},{key:"control",value:"DefaultControlPlayback"}],nodes:[]},{name:"Opera",map:[{key:"ad",value:"DefaultAdPlayback"},{key:"vod",value:"DefaultVODPlayback"},{key:"live",value:"DefaultLivePlayback"},{key:"control",value:"DefaultControlPlayback"}],nodes:[]},{name:"Netscape",map:[{key:"ad",value:"DefaultAdPlayback"},{key:"vod",value:"DefaultVODPlayback"},{key:"live",value:"DefaultLivePlayback"},{key:"control",value:"DefaultControlPlayback"}],nodes:[]},{name:"Safari",map:[{key:"ad",value:"DefaultAdPlayback"},{key:"vod",value:"DefaultVODPlayback"},{key:"live",value:"DefaultLivePlayback"},{key:"control",value:"DefaultControlPlayback"}],nodes:[]},{name:"SeaMonkey",map:[{key:"ad",value:"DefaultAdPlayback"},{key:"vod",value:"DefaultVODPlayback"},{key:"live",value:"DefaultLivePlayback"},{key:"control",value:"DefaultControlPlayback"}],nodes:[]}]},{name:"Mac",map:[],nodes:[{name:"Safari",map:[{key:"ad",value:"DefaultAdPlayback"},{key:"vod",value:"DefaultVODPlayback"},{key:"live",value:"DefaultLivePlayback"},{key:"control",value:"DefaultControlPlayback"}],nodes:[]},{name:"Opera",map:[{key:"ad",value:"DefaultAdPlayback"},{key:"vod",value:"DefaultVODPlayback"},{key:"live",value:"DefaultLivePlayback"},{key:"control",value:"DefaultControlPlayback"}],nodes:[]},{name:"Firefox",map:[{key:"ad",value:"DefaultAdPlayback"},{key:"vod",value:"DefaultVODPlayback"},{key:"live",value:"DefaultLivePlayback"},{key:"control",value:"DefaultControlPlayback"}],nodes:[]},{name:"Netscape",map:[{key:"ad",value:"DefaultAdPlayback"},{key:"vod",value:"DefaultVODPlayback"},{key:"live",value:"DefaultLivePlayback"},{key:"control",value:"DefaultControlPlayback"}],nodes:[]},{name:"Camino",map:[{key:"ad",value:"DefaultAdPlayback"},{key:"vod",value:"DefaultVODPlayback"},{key:"live",value:"DefaultLivePlayback"},{key:"control",value:"DefaultControlPlayback"}],nodes:[]},{name:"SeaMonkey",map:[{key:"ad",value:"DefaultAdPlayback"},{key:"vod",value:"DefaultVODPlayback"},{key:"live",value:"DefaultLivePlayback"},{key:"control",value:"DefaultControlPlayback"}],nodes:[]}]},{name:"Linux",map:[],nodes:[{name:"Opera",map:[{key:"ad",value:"DefaultAdPlayback"},{key:"vod",value:"DefaultVODPlayback"},{key:"live",value:"DefaultLivePlayback"},{key:"control",value:"DefaultControlPlayback"}],nodes:[]},{name:"Firefox",map:[{key:"ad",value:"DefaultAdPlayback"},{key:"vod",value:"DefaultVODPlayback"},{key:"live",value:"DefaultLivePlayback"},{key:"control",value:"DefaultControlPlayback"}],nodes:[]},{name:"Netscape",map:[{key:"ad",value:"DefaultAdPlayback"},{key:"vod",value:"DefaultVODPlayback"},{key:"live",value:"DefaultLivePlayback"},{key:"control",value:"DefaultControlPlayback"}],nodes:[]},{name:"SeaMonkey",map:[{key:"ad",value:"DefaultAdPlayback"},{key:"vod",value:"DefaultVODPlayback"},{key:"live",value:"DefaultLivePlayback"},{key:"control",value:"DefaultControlPlayback"}],nodes:[]},{name:"Konqueror",map:[{key:"ad",value:"DefaultAdPlayback"},{key:"vod",value:"DefaultVODPlayback"},{key:"live",value:"DefaultLivePlayback"},{key:"control",value:"DefaultControlPlayback"}],nodes:[]}]}]}]}]}]}]};