/*
@import MooTools.Class;
@import MooTools.Swiff;
*/
var Video = new Class({

    Extends: Swiff,
    
	options: {
		player: 'VideoPlayer.swf',
		width: '100%',
		height: '100%',
		autoPlay: true,
		showController: true,
		autoHideController: true,
		maxScale: 2,
		enableHardwareReSize: true,
		hardwareReSize: 0,
			
		params: {
			bgcolor: '#000000',
			wMode: 'window',
			scale: 'noscale',
			allowFullScreen: 'true'
		}
		/*
		callBacks: {
			
			onFileNotFound: $empty,
			onMetaData: $empty,
			onComplete: $empty,
			onFullScreen: $empty,
			onExitFullScreen: $empty,
			
			onLoad: $empty,
			onPlay: $empty,
			onPause: $empty,
			onTogglePause: $empty,
			onStop: $empty,
			onSeek: $empty,
			onMute: $empty,
			onUnmute: $empty,
			onVolume: $empty
		}
		*/
	},

	video: $empty,
	
	initialize: function(video, options)
	{
		this.setOptions(options);
		options = this.options;
		$extend(options.vars, {
			video: video,
			autoPlay: options.autoPlay,
			showController: options.showController,
			autoHideController: options.autoHideController,
			maxScale: options.maxScale,
			enableHardwareReSize: options.enableHardwareReSize,
			hardwareReSize: options.hardwareReSize
		});
		
		this.video = video;
		return this.parent(options.player, options);
	},
	
	bufferTime: function(){
	    return this.remote('bufferTime');
	},
	
	time: function(){
	    return this.remote('time');
	},
	
	duration: function(){
	    return this.remote('duration');
	},
	
	metaData: function(){
	    return this.remote('metaData');
	},
	
	play: function(){
		this.remote('play');
	},
	
	pause: function(){
	    this.remote('pause');
	},
	
	togglePause: function(){
		this.remote('togglePause');
	},
	
	stop: function(){
		this.remote('stop');
	},
	
	load: function(video){
	    this.remote('load', video);
	},
	
	seek: function(time){
		this.remote('seek', time);
	},
	
	volume: function(volume){
		return this.remote('volume', volume);
	},
	
	autoPlay: function(auto){
		return this.remote('autoPlay', auto);
	},
	
	showController: function(show){
		return this.remote('showController', show);
	},
	
	autoHideController: function(hide){
		return this.remote('autoHideController', hide);
	},
	
	maxScale: function(scale){
		return this.remote('maxScale', scale);
	},
	
	enableHardwareReSize: function(enable){
		return this.remote('enableHardwareReSize', enable);
	},
	
	hardwareReSize: function(size){
		return this.remote('hardwareReSize', size);
	}
});