/* + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

videofb - a jQuery based video playback component by Florian Brandel - http://www.bureaufb.de

version: 0.0.1 - Aug 10th 2010

 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +*/



/* Options: + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + */

var basePath = "http://www.facesar.com"; // path to your project's root folder

var controls = 'hidden'; // 'none','hidden','visible'

var theme = ''; // Name of theme to use - name of theme folder in 'themes', like this: 'videofb-default' (used in case theme is '')

var width = 640; // number
var height = 350; // number
var heightPortrait = 350; // number
var heightFlash = height+20;

var altDownload = false; // offer download link if browser is unable to play

/* + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + */



function fbPlayVideo() {

}

function setFlashSize (w,h) {

	//$("#flashVideo").css( { height: h+"px", width: w+"px" } );

	$("#flashVideo").attr("width",w);
	$("#flashVideo").attr("height",h);

}

function fbEmbedVideo(src,nr) {



	/*if (orientation == "portrait") {
	
		var heightFinal = heightPortrait;
	
	}else{
	
		var heightFinal = heightLandscape;
	
	}*/
	
	//$("body").append(orientation);


	var pts1 = src.split(".");
	var pts2 = pts1.pop();
	if(pts1.length > 2) {
		var filename = pts1.join(".");
	}else{
		var filename = pts2;
	}
	
	//speak("filename: "+filename);
	
	//speak(base);
	
	 embedStrg = '<video height="420" width="640" controls="controls" preload="true" autobuffer autoplay class="videofb" id="videofb-'+nr+'">'+
     '<source src="'+filename+'.mp4" type="video/mp4" />'+
     '<source src="'+filename+'.webm" type="video/webm" />'+
     '<source src="'+filename+'.ogv" type="video/ogg" />'+
     '<object width="450" type="application/x-shockwave-flash" data="'+base+'/scripts/video-js/flowplayer.commercial-3.2.7.swf">'+
     '<param name="movie" value="'+base+'/scripts/video-js/flowplayer.commercial-3.2.7.swf" />'+
     '<param name="flashvars" value="config={\'key\':\'#$8a7fcc2a302af5bc472\',\'playlist\':[{\'url\': \''+filename+'.mp4\',\'loop\':true,\'autoStart\':true,\'autoBuffering\':true,\'onFinish\':\'function(){return false;}\',\'accelerated\':true,\'scaling\':\'fit\'}],\'play\':{\'opacity\':0},\'canvas\':{\'backgroundGradient\':\'none\'},\'plugins\':{\'controls\': null}}" />'+	
     '</object>'+
   	 '</video>';
     
     //speak(embedStrg);
	
	$(embedStrg).appendTo("#video-wrapper-"+nr);
	
	//setTimeout('createMedia('+nr+')',1000);
	
	/*var autoHeight = jQuery("#videofb-"+nr).height();
	
	if (autoHeight < height) {
	
		jQuery("#videofb-"+nr).css( { height: autoHeight+"px" } );
	
	}else{
	
		jQuery("#videofb-"+nr).css( { height: height+"px" } );
	
	}*/

	$("#loading").css("display","none");

}

function createMedia(nr) {

//	var vidPlayer = new MediaElementPlayer("#videofb-"+nr, { defaultVideoWidth: 640, loop: true, features: ['playpause','progress','current','duration','tracks','volume','fullscreen'], } );

}

function fbDetectBrowser() {



}

var browser = "";

$(document).ready(function(){


});
