(function($) {
    var options = {
	    key:null,
	    playerFile:null		
	}
			
	$.fn.mediaPlayer = function(opts) {
		this.each(function() {
			
			if(opts) {
                $.extend(options, opts);
            }
       
			if(flowplayer && options.playerFile != null)
			{
			    $(this).empty();
                flowplayer(this, options.playerFile, {
                    key:options.key,
                    plugins: {
                       controls: {
                        // setup a background image 
                        autoHide: 'always',
                        
                        sliderColor: '#000000',
                          bufferColor: '#000000',
                          bufferGradient: 'none',
                          buttonOverColor: '#919191',
                          timeColor: '#000000',
                          progressGradient: 'medium',
                          durationColor: '#525252',
                          backgroundColor: '#212121',
                          sliderGradient: 'none',
                          buttonColor: '#a6a6a6',
                          backgroundGradient: 'low',
                          borderRadius: '0',
                          progressColor: '#ffffff',
                          opacity:0.7,
                          
                          play:true,      
                            volume:true, 
                            mute:true,  
                            time:true,  
                            stop:false, 
                            playlist:false,  
                            fullscreen:false,
                            scrubber: true
                       }
                    },
                    clip:{autoPlay:false},
                    onLoad: function() { 
         			    var player = this.play();
				        setTimeout(function(){player.pause()}, 1000);
    			    }
                });
            }
		});
		return this;
	};
})(jQuery);
