function playVideo(filename, autoplay, splash_image) {
	var flowconfig = {
//			key: "#@c6c75af805b4cbb0f27",
			key: "#@6d0629236e7fdd4e957", //tv2fyn product key

			clip : {
				autoPlay: true,
				scaling: "fit",
				urlResolvers: 'bwcheck'
			},
			playlist : [
				splash_image ? splash_image : "/themes/tv2fyn_2009/images/no_video_preview_big.jpg",
				{
					url: filename,
					autoPlay : autoplay,
					onStart: function() {
						if ($('player_bottom') != null) {
							$('player_bottom').setStyle('display', 'block');
						}
					}
				}
			],
			canvas:  {
				background: '#000000',
				backgroundGradient: 'none'
			},
			plugins: {
				controls : {
					background: '#000000 url(/modules/tv2region/video/controls.png)',
					backgroundGradient: 'none',
					buttonColor : '#555555',
					buttonOverColor : '#AAAAAA',
					tooltipColor : '#555555',
					progressColor : '#555555',
					volumeSliderColor : '#555555',
					bufferColor : '#AAAAAA',
					sliderGradient : [0.0, 0.0],
					bottom : 10,
					left : 10,
					width : 410,
					height : 30,
					opacity : 0.60,
					autoHide : 'always',
					hideDelay : 2000,
					time: false,
					hidden: true
				},
				bwcheck: {
					url: '/modules/tv2region/video/flowplayer.bwcheck-3.1.2.swf',
					netConnectionUrl: '/modules/tv2region/video/controls.png',
					bitrates: {_basic: 100, '': 400},
					defaultBitrate: 100,
					urlExtension: 'm4v',
					urlPattern: '{0}{1}.{2}'
				}
			}
		}

	flowplayer("video", "/modules/tv2region/video/flowplayer.commercial-3.1.3.swf", flowconfig);
	/*	var flowconfig = {
			clip : {
				url : "20090825-2220_basic.m4v",
//				url : "metacafe",
				start : time,
				duration : dur + time,
				provider : "red5",
				autoBuffering : true,
				onStart : function() {
					console.log("Clip start");
				},
				onBufferStop : function() {
					console.log("Bufferstop");
				},
				onBufferEmpty : function() {
					console.log("BufferEmpty");
				},
				onBegin : function() {
					console.log("Begin\n Start " + time + "\n Duration " + (time + dur));
				}
			},
			plugins: {
				red5: {
					url : "/modules/tv2region/video/flowplayer.rtmp-3.1.2.swf",
//					netConnectionUrl: "rtmp://cyzy7r959.rtmphost.com/flowplayer"
					//netConnectionUrl: "rtmp://digizuite09.ext.digieyez.dk/live/tv2fyn"
					netConnectionUrl : "rtmpt://80.63.11.100/oflaDemo"
				},
				controls : {
					background: '#000000 url(/modules/tv2region/video/controls.png)',
					backgroundGradient: 'none',
					buttonColor : '#555555',
					buttonOverColor : '#AAAAAA',
					tooltipColor : '#555555',
					progressColor : '#555555',
					volumeSliderColor : '#555555',
					bufferColor : '#AAAAAA',
					sliderGradient : [0.0, 0.0],
					top : 194,
					left : 20,
					width : 390,
					height : 50,
					opacity : 0.75,
					autoHide : 'always',
					hideDelay : 3000
				//	time: false
				}
			},
			log: {
				level: 'warn',
				filter: 'org.flowplayer.rtmp.*'
			}
		}*/
}

function playLiveVideo() {
	var flowconfig = {
		key: "#@6d0629236e7fdd4e957", //tv2fyn product key

		clip : {
			url: "tv2fyn",
			provider: "digieyez",
			scaling: "fit",
			live: true
		},
		plugins: {
			digieyez : {
				url : "/modules/tv2region/video/flowplayer.rtmp-3.1.2.swf",
				netConnectionUrl: "rtmp://digizuite09.ext.digieyez.dk/live"
			},
			controls : {
				background: '#000000 url(/modules/tv2region/video/controls.png)',
				backgroundGradient: 'none',
				buttonColor : '#555555',
				buttonOverColor : '#AAAAAA',
				tooltipColor : '#555555',
				progressColor : '#555555',
				volumeSliderColor : '#555555',
				bufferColor : '#AAAAAA',
				sliderGradient : [0.0, 0.0],
				bottom : 10,
				left : 10,
				width : 410,
				height : 30,
				opacity : 0.60,
				autoHide : 'always',
				hideDelay : 2000,
				time: false,
				hidden: true
			}
		}
	}
	flowplayer("video", "/modules/tv2region/video/flowplayer.commercial-3.1.3.swf", flowconfig);
}
