/**
 * flowplayer.securedrm plugins
 * 
 * - preauth - EZDRM Preauth plugin
 */
(function($) {

	$f.addPlugin("preauth", function(options) {

		// self points to current Player instance
		var self = this;

		var opts = {
			username: 'adobe',
			password: 'adobe',
			key:'key',
			timeout: 1,
			preAuthServer:'http://fmrms.ezdrm.com/flashaccess/preauthorize'
		};

		$.extend(opts, options);
		
		/*$(document).ready(function () {
			var authServerURL = opts.preAuthServer + '?p1=' + opts.key + '&p2=' + opts.timeout + '&p3=' + opts.username + '&p4=' + opts.password;
			$.get(authServerURL);	
		});*/
		
		self.onBeforeBegin(function(clip) {
            var authServerURL = opts.preAuthServer + '?p1=' + opts.key + '&p2=' + opts.timeout + '&p3=' + opts.username + '&p4=' + opts.password;
			$.get(authServerURL);
		});


		return self;

	});

})(jQuery);

