//>>built
define("dojox/av/widget/PlayButton",["dojo","dijit","dijit/_Widget","dijit/_TemplatedMixin"],function(_1,_2,_3,_4){
return _1.declare("dojox.av.widget.PlayButton",[_3,_4],{templateString:_1.cache("dojox.av.widget","resources/PlayButton.html"),postCreate:function(){
this.showPlay();
},setMedia:function(_5){
this.media=_5;
_1.connect(this.media,"onEnd",this,"showPlay");
_1.connect(this.media,"onStart",this,"showPause");
},onClick:function(){
if(this._mode=="play"){
this.onPlay();
}else{
this.onPause();
}
},onPlay:function(){
if(this.media){
this.media.play();
}
this.showPause();
},onPause:function(){
if(this.media){
this.media.pause();
}
this.showPlay();
},showPlay:function(){
this._mode="play";
_1.removeClass(this.domNode,"Pause");
_1.addClass(this.domNode,"Play");
},showPause:function(){
this._mode="pause";
_1.addClass(this.domNode,"Pause");
_1.removeClass(this.domNode,"Play");
}});
});
