// JavaScript Document
/**
* Main video player config
*/
$f("live", {src: "./flowplayer/flowplayer-3.1.5.swf"}, { 
 
    clip: { 
		// netConnectionUrl defines where the streams are found 
        provider: 'medium',
		scaling:'scale',
		live:true,
		autoPlay: true,
		autoBuffering: true,
		url: 'flv:medTotb'
    },
	//log: { level: 'error' },
	screen: {
		width:708,
		height:400
	},
 
    // streaming plugins are configured under the plugins node 
    plugins: { 
		
        // here is our rtpm plugin configuration 
		low: { 
            url: "./flowplayer/flowplayer.rtmp-3.1.3.swf",
			netConnectionUrl: 'rtmp://liveplay.simplecdn.net/hcchlive/'
 		 },
		medium: { 
            url: "./flowplayer/flowplayer.rtmp-3.1.3.swf",
			netConnectionUrl: 'rtmp://liveplay.simplecdn.net/hcchlive/'
 		 },
		audio: { 
            url: "./flowplayer/flowplayer.rtmp-3.1.3.swf",
			netConnectionUrl: 'rtmp://liveplay.simplecdn.net/hcchlive/'
 		 },
        prerecord: { 
            url: "./flowplayer/flowplayer.rtmp-3.1.3.swf",
			netConnectionUrl: 'rtmp://173.160.128.186/Totb-recorded'
 		 },
		 // "check live" button in top right corner
		liveAlert: {
			url: "./flowplayer/flowplayer.content-3.1.0.swf",
			display:'none',
			top:0,
			right:0,
			width:50,
			height:20,
			borderRadius:0,
			border:0,
			backgroundImage: 'url(./img/red.jpg)',
			onClick: function(){
				controlPlayer.clip('mediumHCCH','medium');
			}
		}
	},
		// load pre-record on stream error
		onError: function(errorCode,errorMessage) {
			if(errorCode == '200' || errorCode == '202') {
				controlPlayer.clip('TomPalWelcome','prerecord');
			}
		}
   }).load();
function videoChange(newUrl,live) {
	adaptedUrl = "flv:"+newUrl;
	changeSelection('prerecord','live');
	controlPlayer.clip(adaptedUrl,'prerecord');
}
