

ctv.ca.PlayerControlSwf = function (swfObj) {
    this.swfObj = swfObj;
    //vars	
	this.isMuted = false;
    this.showPlayer = true;
    this.currentPosition = 0;
    this.mediaLength = 100;
    this.isTracker = false;
    this.mouseDown = false;
    this.clockLength = "00:00";
    this.isPaused = false;
    this.playState = undefined;
    this.sliderVolPos = 0;
    
	//create the event Listeners
	/*
	ctv.ca.PlayerControl.createEvent("play");
    ctv.ca.PlayerControl.createEvent("pause");
    ctv.ca.PlayerControl.createEvent("stop");
    ctv.ca.PlayerControl.createEvent("next");
    ctv.ca.PlayerControl.createEvent("prev");
    ctv.ca.PlayerControl.createEvent("setVolume");
    ctv.ca.PlayerControl.createEvent("mute");
    ctv.ca.PlayerControl.createEvent("getPosition");
    ctv.ca.PlayerControl.createEvent("gotoPosition");
    ctv.ca.PlayerControl.createEvent("getMediaLength");    
    ctv.ca.PlayerControl.createEvent("fullScreen");
    ctv.ca.PlayerControl.createEvent("show");
    */
   
}

ctv.ca.PlayerControlSwf.prototype = {

    onPlaying : function()
    {
        this.swfObj.onPlaying();
    },
    
    onStop : function()
    {
        this.swfObj.onStop();
    },
    
    onPause : function()
    {
        if (typeof(this.swfObj.onPause) != "undefined" )
            this.swfObj.onPause();
    },
    
    onSetMediaLength:function(length)
    {
        this.swfObj.onSetMediaLength(length);
    },
	
	onSetLive:function(v)
    {
        this.swfObj.onSetLive(v);
    },
    
    onSetPos:function(pos)
    {
        this.swfObj.onSetPos(pos);    
    },
    
    onBuffering:function()
    {
        try
        {
            this.swfObj.onBuffering();
        }
        catch (e)
        {}
    },
    
    onAdPlaying:function(value)
    {
        if (typeof(this.swfObj.onAdPlaying) != "undefined" )
            this.swfObj.onAdPlaying(value);    
    },
    
    onVideoStopped: function() {
        if (typeof(this.swfObj.onStop) != "undefined" )
            this.swfObj.onStop();
    },
	
	onSetCurrentTitle: function(title) {
		if (typeof(this.swfObj.onSetCurrentTitle) != "undefined" )
            this.swfObj.onSetCurrentTitle(title);
	}

}

ctv.ca.PlayerControlSwf.registerClass('ctv.ca.PlayerControlSwf', Sys.Component);



    	

 
