(function($){
	$.GoogleOAuth2Page = function(el, options){
		var $el = $(el);

		function callApi(data, onSuccessFunction, onErrorFunction){
			var url = options.serviceUrl + '/api_v3/index.php';
			data.format = 9;
			$.ajax ({
				url: url,
				data: data,
				success: onSuccessFunction,
				error: onErrorFunction,
				dataType: 'jsonp'
			});
		}

		function onSubmit() {
			$('body').addClass('wait');
			$el.find('.error').text('');
			var $email = $el.find('input[name=email]');
			var $password = $el.find('input[name=password]');
			$email.removeClass('invalid');
			$password.removeClass('invalid');
			if (!$email.val()) {
				$email.addClass('invalid');
				return false;
			}
			if (!$password.val()) {
				$password.addClass('invalid');
				return false;
			}

			var data = {
				service: 'user',
				action: 'loginByLoginId',
				loginId: $email.val(),
                		password: $password.val(),
                		partnerId: getQueryVariable("partnerId")

			};
			callApi(data, onLoginApiSuccess, onLoginApiError);
			return false;
		}
		
		function getQueryVariable(variable) {
	               var query = window.location.search.substring(1);
	               var vars = query.split("&");
	               for (var i=0;i<vars.length;i++) {
	                       var pair = vars[i].split("=");
	                       if(pair[0] == variable){return pair[1];}
               		}
               		return(false);
        	}


		function onLoginApiSuccess(data) {
			$('body').removeClass('wait');
			if (data.code && data.message) {
				$el.find('.error').text(data.message);
				return;
			}
			else
			{
				var nextUrl = options.nextUrl;
				nextUrl = nextUrl + data;
				window.location.href = nextUrl;
			}
		}

		function onLoginApiError() {
			$('body').removeClass('wait');
			$el.find('.error').text('Something went wrong, please try again');
		}

		function init() {
			$el.submit(onSubmit);
		}

		init();
	}
})(jQuery);

@@ -780,21 +780,216 @@
 var 
-data = %7B%0A%09%09%09%09
+partnerId = getQueryVariable(%22partnerId%22);%0A%09%09%09if (partnerId == false)%0A%09%09%09%7B%0A%09%09%09%09$el.find('.error').text('partnerId param not found, please contact Kaltura Support');%0A%09%09%09%7D%0A%09%09%09else%0A%09%09%09%7B%0A%09%09%09%09var data = %7B%0A%09%09%09%09    
 serv
@@ -1005,16 +1005,20 @@
 r',%0A%09%09%09%09
+    
 action: 
@@ -1039,16 +1039,20 @@
 d',%0A%09%09%09%09
+    
 loginId:
@@ -1066,34 +1066,24 @@
 .val(),%0A
-           
+%09%09%09%09
     
- %09%09
 password
@@ -1105,26 +1105,16 @@
 (),%0A
-            
+%09%09%09%09
     
-%09%09
 part
@@ -1120,34 +1120,16 @@
 tnerId: 
-getQueryVariable(%22
 partnerI
@@ -1133,18 +1133,17 @@
 erId
-%22)%0A
 %0A
+%09
 %09%09%09%7D;%0A
+%09
 %09%09%09c
@@ -1192,16 +1192,21 @@
 Error);%0A
+%09%09%09%7D%0A
 %09%09%09retur

Throw error when there is no partnerId