//>>built
define("dojox/av/widget/Status",["dojo","dijit","dijit/_Widget","dijit/_TemplatedMixin"],function(b,e,c,d){return b.declare("dojox.av.widget.Status",[c,d],{templateString:b.cache("dojox.av.widget","resources/Status.html"),setMedia:function(a){this.media=a;b.connect(this.media,"onMetaData",this,function(a){this.duration=a.duration;this.durNode.innerHTML=this.toSeconds(this.duration)});b.connect(this.media,"onPosition",this,function(a){this.timeNode.innerHTML=this.toSeconds(a)});b.forEach("onMetaData,onPosition,onStart,onBuffer,onPlay,onPaused,onStop,onEnd,onError,onLoad".split(","),
function(a){b.connect(this.media,a,this,a)},this)},onMetaData:function(a){this.duration=a.duration;this.durNode.innerHTML=this.toSeconds(this.duration);this.media.title?this.title=this.media.title:(a=this.media.mediaUrl.split("/"),this.title=a[a.length-1].split(".")[0])},onBuffer:function(a){(this.isBuffering=a)?this.setStatus("buffering..."):this.setStatus("Playing")},onPosition:function(){},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(a){a=a.info.code;"NetStream.Play.StreamNotFound"==a&&(a="Stream Not Found");this.setStatus("ERROR: "+a,!0)},onLoad:function(){this.setStatus("Loading...")},setStatus:function(a,c){c?b.addClass(this.titleNode,"statusError"):(b.removeClass(this.titleNode,"statusError"),this.isBuffering&&(a="buffering..."));this.titleNode.innerHTML='<span class="statusTitle">'+this.title+'</span> <span class="statusInfo">'+
a+"</span>"},toSeconds:function(a){a=a.toString();0>a.indexOf(".")?a+=".00":2==a.length-a.indexOf(".")?a+="0":2<a.length-a.indexOf(".")&&(a=a.substring(0,a.indexOf(".")+3));return a}})});