Type.registerNamespace('CustomControls');
CustomControls.MediaPlayerButton = function (element)
{
CustomControls.MediaPlayerButton.initializeBase(this, [element]);
this._playImageUrl = null;
this._pauseImageUrl = null;
}
CustomControls.MediaPlayerButton.prototype =
{
initialize : function ()
{
CustomControls.MediaPlayerButton.callBaseMethod(this, 'initialize');
this._onclickHandler = Function.createDelegate(this, this._onClick);
$addHandlers
(
this.get_element(),{'click' : this._onClick}, this
);
this.get_element().src=this._playImageUrl;
},
dispose: function()
{
$clearHandlers(this.get_element());
CustomControls.MediaPlayerButton.callBaseMethod(this, 'dispose');
},
_onClick : function(e)
{
if(this.get_element() && (this.get_element().src.indexOf(this._playImageUrl)==-1))
{
this.get_element().src=this._playImageUrl;
}
else
{
this.get_element().src=this._pauseImageUrl;
}
},
get_playImageUrl : function()
{
return this._playImageUrl;
},
set_playImageUrl : function(value)
{
if(this._playImageUrl !== value)
{
this._playImageUrl = value;
this.raisePropertyChanged('playImageUrl');
}
},
get_pauseImageUrl : function()
{
return this._pauseImageUrl;
},
set_pauseImageUrl : function(value)
{
if(this._pauseImageUrl !== value)
{
this._pauseImageUrl = value;
this.raisePropertyChanged('pauseImageUrl');
}
}
}
CustomControls.MediaPlayerButton.registerClass('CustomControls.MediaPlayerButton',Sys.UI.Control);
if(typeof(Sys) !== 'undefined')
{
Sys.Application.notifyScriptLoaded();
}