//>>built
define("dojox/av/_Media",["dojo"],function(c){c.experimental("dojox.av.FLVideo");return c.declare("dojox.av._Media",null,{mediaUrl:"",initialVolume:1,autoPlay:!1,bufferTime:2E3,minBufferTime:300,updateTime:100,id:"",isDebug:!1,percentDownloaded:0,_flashObject:null,flashMedia:null,allowScriptAccess:"always",allowNetworking:"all",wmode:"transparent",allowFullScreen:!0,_initStatus:function(){this.status="ready";this._positionHandle=c.connect(this,"onPosition",this,"_figureStatus")},getTime:function(){return this.flashMedia.getTime()},
onLoad:function(a){},onDownloaded:function(a){},onClick:function(a){},onSwfSized:function(a){},onMetaData:function(a,b){console.warn("onMeta",a);this.duration=a.duration},onPosition:function(a){},onStart:function(a){},onPlay:function(a){},onPause:function(a){},onEnd:function(a){},onStop:function(){},onBuffer:function(a){this.isBuffering=a},onError:function(a,b){console.warn("ERROR-"+a.type.toUpperCase()+":",a.info.code," - URL:",b)},onStatus:function(a){},onPlayerStatus:function(a){},onResize:function(){},
_figureStatus:function(){var a=this.getTime();if("stopping"==this.status)this.status="stopped",this.onStop(this._eventFactory());else if("ending"==this.status&&a==this._prevPos)this.status="ended",this.onEnd(this._eventFactory());else if(this.duration&&a>this.duration-.5)this.status="ending";else if(0===a){if("ready"!=this.status&&(this.status="stopped","stopped"!=this._prevStatus))this.onStop(this._eventFactory())}else if("ready"==this.status)this.status="started",this.onStart(this._eventFactory()),
this.onPlay(this._eventFactory());else if(this.isBuffering)this.status="buffering";else if("started"==this.status||"playing"==this.status&&a!=this._prevPos)this.status="playing";else if(this.isStopped||"playing"!=this.status||a!=this._prevPos)"paused"!=this.status&&"stopped"!=this.status||a==this._prevPos||(this.status="started",this.onPlay(this._eventFactory()));else if(this.status="paused",console.warn("pause",a,this._prevPos),this.status!=this._prevStatus)this.onPause(this._eventFactory());this._prevPos=
a;this._prevStatus=this.status;this.onStatus(this.status)},_eventFactory:function(){return{status:this.status}},_sub:function(a,b){c.subscribe(this.id+"/"+a,this,b)},_normalizeVolume:function(a){if(1<a)for(;1<a;)a*=.1;return a},_normalizeUrl:function(a){console.log("  url:",a);if(a&&(0>a.toLowerCase().indexOf("http")||0==a.indexOf("/"))){var b=window.location.href.split("/");b.pop();b=b.join("/")+"/";console.log("  loc:",b);a=b+a}return a},destroy:function(){this.flashMedia?(c.forEach(this._subs,
function(a){c.unsubscribe(a)}),c.forEach(this._cons,function(a){c.disconnect(a)}),this._flashObject.destroy()):this._cons.push(c.connect(this,"onLoad",this,"destroy"))}})});