var userConfig = {
	// Set this to the location of your video (main programme) stream
	mediaServer: 'rtmp://taurais35fvs.cdnetworks.net/taurais35fvs/flashstream/vod/',

	// Set this to the mime type of your ads
	adMimeType: 'flv',

	// Set this to the location of the OpenX Ad Server
	openXServer: 'http://www.chezjules.tv/openx/www/delivery/fc.php',

	// Set this to the OpenX zone serving the video ads
	openXZone: '9'

};

var flowplayerConfig = {
	skins: {
		jules:  {
			url: '/dist/flowplayer.controls-3.1.5.swf',
			opacity: 0.7,
			backgroundColor: 'transparent',
			backgroundGradient: 'none',
			bufferColor: '#363636',
			buttonColor: '#530005',
			timeColor: "#cccccc",
			timeBgColor: '#530005',
			progressColor: '#ff0000',
			autoHide: 'always',
			hideDelay: '3500'
		}
	},
	play: {
		url: '/dist/play.png',
		width: 87,
		height: 87
	},
	ads: {
		playOnce: false,
		server: {
			type: 'OpenX',
			vastURL: userConfig.openXServer,
			allowAdRepetition: true
		},
		schedule: [
		{
			zone: userConfig.openXZone,
			position: 'pre-roll',
			applyToParts: [0]
		}
		]
	},
	rtmp: {
		url: '/dist/flowplayer.rtmp-3.1.3.swf',
		netConnectionUrl: userConfig.mediaServer,
		proxyType: 'best'
	},
	bwcheck: {
		url: '/dist/flowplayer.bwcheck-3.1.3.swf',

		// use a customized urlPattern for file names
		urlPattern: '{0}_{1}',

		// Influxis uses Flash Media Servers
		serverType: 'fms',

		// Use this connection for bandwidth detection
		netConnectionUrl: userConfig.mediaServer,

		// we use dynamic switching
		dynamic: false,
		rememberBitrate : true,

		defaultBitrate: 700,
		// available bitrates for file names
		// bitrates: [300, 700, 1500],
		bitrates: { 300: 700, 700: 7500, 1500: 14500 },

		onBwDone: function(url, chosenBitrate, bitrate) {
			$("#bit-" + chosenBitrate).addClass("on");
			flowplayerConfig.bwcheck.currentBitrate = chosenBitrate;
		},
		onStreamSwitch: function(chosenBitrate, newUrl, oldUrl) {
			if (flowplayerConfig.bwcheck.currentBitrate) {
				$("#bit-" + flowplayerConfig.bwcheck.currentBitrate).removeClass("on");
			}
			$("#bit-" + chosenBitrate).addClass("on");
			flowplayerConfig.bwcheck.currentBitrate = chosenBitrate;
		},
		onFailed: function() {
			$f().getPlugin('bwcheck').setBitrate(700);
		}
	}
};


