﻿
var flashVideoPlayer;

function InitEpisodePlayer() {
	// record that JavaScript is ready to go.
	jsReady = true;
	initialize();
	var wsURI=getValue('ctl00_BroadcastWsURI');
	flashVideoPlayer.LoadWebService(wsURI);	


}
function isReady() {
   	return jsReady;
}

function setSWFIsReady() {
	// record that the SWF has registered it's functions (i.e. that JavaScript
	// can safely call the ActionScript functions)
	swfReady = true;


	
	//document.all.item("ctl00_NextOnFliggee_nextseries").innerHTML="Ready to go"
}

/* When the HTML page loads (via the onLoad event of the <body> tag) we have it call the initialize() function. */
function initialize() {
	/* Check if the browser is IE. If so, flashVideoPlayer is window.videoPlayer. Otherwise, it's window.document.videoPlayer. The videoPlayer is the id assigned to <object> and <embed> tags. */
	
	flashVideoPlayer=MM_findObj('FliggeeBoxEpisodePlayer');

}

function newMessage(value) {
	// append the message text to the end of the transcript
   if (value=='Playing')
    {
       
    }
    else if (value=='StoppedPlaying')
    {
            if(!watchNowButtonClicked)
            {
                switchEpisodeAfterPlayBack(getObj('ctl00_Content_EpisodeValue').value);
            }   
     
      
    }
  
}

function playEpisodeVideo(filename,broadcastId)
{

    filename=filename.substring(0,filename.length-4);
    //flashVideoPlayer.playVideo(previewClipRTMP,filename);
    flashVideoPlayer.playVideo(getValue('ctl00_OnDemandRTMP'),filename,broadcastId,0,getValue('ctl00_UserId'));
    
    
    
}



function stopEpisodeVideo()
{

    flashVideoPlayer.stopVideo();
}





