/*
	Copyright (c) 2004-2011, The Dojo Foundation All Rights Reserved.
	Available via Academic Free License >= 2.1 OR the modified BSD license.
	see: http://dojotoolkit.org/license for details
*/


window[esri._dojoScopeName||"dojo"]._xdResourceLoaded(function(_1,_2,_3){return {depends:[["provide","dojox.av.widget.Status"],["require","dijit._Widget"],["require","dijit._Templated"]],defineResource:function(_4,_5,_6){if(!_4._hasResource["dojox.av.widget.Status"]){_4._hasResource["dojox.av.widget.Status"]=true;_4.provide("dojox.av.widget.Status");_4.require("dijit._Widget");_4.require("dijit._Templated");_4.declare("dojox.av.widget.Status",[_5._Widget,_5._Templated],{templateString:_4.cache("dojox.av.widget","resources/Status.html","<table class=\"Status\">\r\n    <tr>\r\n        <td class=\"Time\"><span dojoAttachPoint=\"timeNode\">0.00</span></td>\r\n        <td class=\"Status\"><div dojoAttachPoint=\"titleNode\">Loading...</div></td>\r\n        <td class=\"Duration\"><span dojoAttachPoint=\"durNode\">0.00</span></td>\r\n    </tr>\r\n</table>\r\n"),setMedia:function(_7){this.media=_7;_4.connect(this.media,"onMetaData",this,function(_8){this.duration=_8.duration;this.durNode.innerHTML=this.toSeconds(this.duration);});_4.connect(this.media,"onPosition",this,function(_9){this.timeNode.innerHTML=this.toSeconds(_9);});var _a=["onMetaData","onPosition","onStart","onBuffer","onPlay","onPaused","onStop","onEnd","onError","onLoad"];_4.forEach(_a,function(c){_4.connect(this.media,c,this,c);},this);},onMetaData:function(_b){this.duration=_b.duration;this.durNode.innerHTML=this.toSeconds(this.duration);if(this.media.title){this.title=this.media.title;}else{var a=this.media.mediaUrl.split("/");var b=a[a.length-1].split(".")[0];this.title=b;}},onBuffer:function(_c){this.isBuffering=_c;console.warn("status onBuffer",this.isBuffering);if(this.isBuffering){this.setStatus("buffering...");}else{this.setStatus("Playing");}},onPosition:function(_d){},onStart:function(){this.setStatus("Starting");},onPlay:function(){this.setStatus("Playing");},onPaused:function(){this.setStatus("Paused");},onStop:function(){this.setStatus("Stopped");},onEnd:function(){this.setStatus("Stopped");},onError:function(_e){console.log("status error:",_e);var _f=_e.info.code;if(_f=="NetStream.Play.StreamNotFound"){_f="Stream Not Found";}this.setStatus("ERROR: "+_f,true);},onLoad:function(){this.setStatus("Loading...");},setStatus:function(str,_10){if(_10){_4.addClass(this.titleNode,"statusError");}else{_4.removeClass(this.titleNode,"statusError");if(this.isBuffering){str="buffering...";}}this.titleNode.innerHTML="<span class=\"statusTitle\">"+this.title+"</span> <span class=\"statusInfo\">"+str+"</span>";},toSeconds:function(_11){var ts=_11.toString();if(ts.indexOf(".")<0){ts+=".00";}else{if(ts.length-ts.indexOf(".")==2){ts+="0";}else{if(ts.length-ts.indexOf(".")>2){ts=ts.substring(0,ts.indexOf(".")+3);}}}return ts;}});}}};});