// FlowPlayer Google Analytics for the players

/*
Example of Google analytics implementation for Flowplayer handlers
$f("embedded-video-", "/sites/all/modules/flowplayer/flowplayer/flowplayer-3.1.1.swf", {

	clip: {
		// track start event for this clip
		onStart: function(clip) {
			_tracker._trackEvent("Videos", "Play", clip.url);
		},

		// track pause event for this clip. time (in seconds) is also tracked
		onPause: function(clip) {
			_tracker._trackEvent("Videos", "Pause", clip.url, parseInt(this.getTime()));
		},

		// track stop event for this clip. time is also tracked
		onStop: function(clip) {
			_tracker._trackEvent("Videos", "Stop", clip.url, parseInt(this.getTime()));
		},

		// track finish event for this clip
		onFinish: function(clip) {
			_tracker._trackEvent("Videos", "Finish", clip.url);
		}
	},

	// show stop button so we can see stop events too
	plugins: {
		controls: {
			stop: true
		}
	}

});*/

/*Instead of using above code, you'll have to add the event handling on the fly; the following should do the job
Resources: 
Flowplayer Google Analytics - http://flowplayer.org/demos/events/google-analytics.html
Flowplayer Configurations - http://flowplayer.org/documentation/configuration/index.html
Flowplayer Javascript API - http://flowplayer.org/documentation/api/index.html 
*/

/*$f("*").each(function(){ //loops through every player on page

	$f().onStart(function(clip){
		// track start event for this clip
		alert("tracking started");
		_tracker._trackEvent("Videos", "Play", clip.url);
		
	}).onPause(function(clip){
		// track pause event for this clip. time (in seconds) is also tracked
		_tracker._trackEvent("Videos", "Pause", clip.url, parseInt(this.getTime()));	
	
	}).onStop(function(clip){
		// track stop event for this clip. time is also tracked
		_tracker._trackEvent("Videos", "Stop", clip.url, parseInt(this.getTime()));
	
	}).onFinish(function(clip){
		// track finish event for this clip
		_tracker._trackEvent("Videos", "Finish", clip.url);
	
	});
});

*/

