// JavaScript Document

var flashvars = {
	config: "<config><id>vplayer</id><watermark>images/watermark_gs.png</watermark><watermarkalign>BOTTOM_RIGHT</watermarkalign><watermarkpadding>16</watermarkpadding></config>"
	};

var params = {
	menu: "false",
	align: "tl",
	scale: "noScale",
	allowFullscreen: "true",
	allowScriptAccess: "always",
	bgcolor: "#000000",
	wmode: "opaque"
	};
		
var attributes = {
	id:"vplayer",
	name:"vplayer"
};
		
swfobject.embedSWF("vplayer.swf", "vplayer_alt", "603", "400", "10.0.0", "expressInstall.swf", flashvars, params, attributes);
	
// create a playlist array of media
var playlistIndex = 0;
var playlist = new Array();
playlist.push({file:"http://www.gamestreamer.net/corp_video/GSI_corp_vid_1280x720.mp4"});
//playlist.push({file:"error"});
//playlist.push({file:"videos/lbp_med.flv"});
//playlist.push({file:"videos/me_med.flv"});
		
// called by the player once initialized
function vp_ready(id){
	// call your method to load media passing the player id and playlist index
	load_media(id, playlistIndex);
			
	// lets the player know the call was successful
	return true;
}
		
// called by the player when the current media has completed
function vp_media_complete(id){
	// increment the playlist index, start over if at the end
	playlistIndex++;
	if (playlistIndex > playlist.length-1) playlistIndex = 0;
			
	// load the next item in the playlist
	load_media(id, playlistIndex);
}
		
// your method for loading a playlist item
function load_media(id, index){
	// update the playlist index incase the method was called directly
	playlistIndex = index;
			
	// load the media
	var player = document.getElementById(id);
	player.load(playlist[index]);
}
		
