
//hook up the control and the video window

///*************************************************************************************************************
///
///  PlayerControl hooks
///
///*************************************************************************************************************


//transport Controls
ctvPlayerControl.add_play(Function.createDelegate(ctvVideoWindow, ctvVideoWindow.play));
ctvPlayerControl.add_pause(Function.createDelegate(ctvVideoWindow, ctvVideoWindow.pause));
ctvPlayerControl.add_stop(Function.createDelegate(ctvVideoWindow, ctvVideoWindow.stop));
ctvPlayerControl.add_prev(Function.createDelegate(ctvContentStack, ctvContentStack.prev));
ctvPlayerControl.add_next(Function.createDelegate(ctvContentStack, ctvContentStack.next));


//volume
ctvPlayerControl.add_mute(Function.createDelegate(ctvVideoWindow, ctvVideoWindow.mute));
ctvPlayerControl.add_setVolume(Function.createDelegate(ctvVideoWindow, ctvVideoWindow.setVolume));


//Position Controls
ctvPlayerControl.add_gotoPosition(Function.createDelegate(ctvVideoWindow, ctvVideoWindow.gotoPosition));
ctvPlayerControl.add_getPosition(Function.createDelegate(ctvVideoWindow, ctvVideoWindow.getPosition));
ctvPlayerControl.add_getMediaLength(Function.createDelegate(ctvVideoWindow, ctvVideoWindow.getMediaLength));


//Property Controls
ctvPlayerControl.add_show(Function.createDelegate(ctvVideoWindow, ctvVideoWindow.show));
ctvPlayerControl.add_fullScreen(Function.createDelegate(ctvVideoWindow, ctvVideoWindow.fullScreen));



///*************************************************************************************************************
///
///  VideoWindow Hooks
///
///*************************************************************************************************************

ctvVideoWindow.add_mediaLength(Function.createDelegate(ctvPlayerControl, ctvPlayerControl.showMediaLength));
ctvVideoWindow.add_playstateChange(Function.createDelegate(ctvPlayerControl, ctvPlayerControl.onPlaystateChange));
ctvVideoWindow.add_positionChange(Function.createDelegate(ctvPlayerControl, ctvPlayerControl.moveSlider));

 function play(sender,url,mediaType)
 {
 	ctvVideoWindow.PlayVideo(url,mediaType)
 }
 
 function showPosition(sender, pos)
 {
    //debug("Player Position: " + pos);
 }


///*************************************************************************************************************
///
///  ContentStack Hooks
///
///*************************************************************************************************************




