/**
* Kaltura HTML5 Library v1.8.4
* http://html5video.org/kaltura-player/docs/
*
* This is free software released under the GPL2 see README more info
* http://html5video.org/kaltura-player/docs/readme
*
* Copyright 2024 Kaltura Inc.
*/
window['MWEMBED_VERSION'] = '1.8.4';
window['SCRIPT_LOADER_URL'] = 'http://cdnapi.kaltura.com/html5/html5lib/v1.8.4/load.php';
(function(){"use strict";if(window.kWidget){return;}var kWidget={startTime:{},loadTime:{},readyWidgets:{},readyCallbacks:[],destroyedWidgets:{},perWidgetCallback:{},readyCallbackPerWidget:{},listenerList:{},userAgentPlayerRules:{},alreadyAddedThumbRules:false,iframeAutoEmbedCache:{},setup:function(){var _this=this;mw.setConfig('version',MWEMBED_VERSION);this.checkEnvironment();this.overrideFlashEmbedMethods();this.proxyJsCallbackready();this.domReady(function(){_this.domIsReady=true;_this.proxyJsCallbackready();});this.domReady(function(){_this.rewriteObjectTags();});},checkEnvironment:function(){if(document.URL.indexOf('forceMobileHTML5')!==-1&&!mw.getConfig('disableForceMobileHTML5')){mw.setConfig('forceMobileHTML5',true);}var ua=navigator.userAgent;var ieMatch=ua.match(/MSIE\s([0-9]+)/);if(ieMatch&&parseInt(ieMatch[1])<9){mw.setConfig('Kaltura.ForceFlashOnDesktop',true);}if(ua.indexOf('BlackBerry')!=-1){mw.setConfig('EmbedPlayer.DisableVideoTagSupport',true);mw.setConfig(
'EmbedPlayer.NotPlayableDownloadLink',true);}if(ua.indexOf('Android')!=-1){mw.setConfig('Kaltura.UseAppleAdaptive',false);}if(/(iPhone|iPod|iPad)/i.test(ua)){if(/OS [2-4]_\d(_\d)? like Mac OS X/i.test(ua)||(/CPU like Mac OS X/i.test(ua))){mw.setConfig('Kaltura.UseAppleAdaptive',false);}}if(!mw.getConfig('EmbedPlayer.IsIframeServer')){mw.setConfig('EmbedPlayer.IframeParentUrl',document.URL);mw.setConfig('EmbedPlayer.IframeParentTitle',document.title);mw.setConfig('EmbedPlayer.IframeParentReferrer',document.referrer);if((/iphone|ipod|ipad.*os 5/gi).test(navigator.appVersion)){window.onpageshow=function(evt){if(evt.persisted){document.body.style.display="none";location.reload();}};}}},proxiedJsCallback:null,waitForLibraryChecks:true,jsReadyCalledForIds:[],proxyJsCallbackready:function(){var _this=this;var jsCallbackProxy=function(widgetId){if(_this.waitForLibraryChecks){_this.jsReadyCalledForIds.push(widgetId);return;}_this.jsCallbackReady(widgetId);};if(!this.proxiedJsCallback){this.
proxiedJsCallback=window['jsCallbackReady']||true;window['jsCallbackReady']=jsCallbackProxy}if(window['jsCallbackReady'].toString()!=jsCallbackProxy.toString()){this.proxiedJsCallback=window['jsCallbackReady'];window['jsCallbackReady']=jsCallbackProxy}},jsCallbackReady:function(widgetId){var _this=this;if(this.destroyedWidgets[widgetId]){return;}var player=document.getElementById(widgetId);if(!player){this.log("Error:: jsCallbackReady called on invalid player Id:"+widgetId);return;}this.extendJsListener(player);var kdpVersion=player.evaluate('{playerStatusProxy.kdpVersion}');if(mw.versionIsAtLeast('v3.7.0',kdpVersion)){player.kBind("kdpReady",function(){_this.loadTime[widgetId]=((new Date().getTime()-_this.startTime[widgetId])/1000.0).toFixed(2);player.setKDPAttribute("playerStatusProxy","loadTime",_this.loadTime[widgetId]);});}if(typeof this.proxiedJsCallback=='function'){this.proxiedJsCallback(widgetId);}for(var i=0;i'+''+'';var playBtn=document.getElementById(targetId+'_playBtn');this.addEvent(playBtn,
'click',function(){if(settings.readyCallback){var orgEmbedCallback=settings.readyCallback;}settings.readyCallback=function(playerId){var kdp=document.getElementById(playerId);kdp.kBind('mediaReady',function(){kdp.sendNotification('doPlay');});if(typeof orgEmbedCallback=='function'){orgEmbedCallback(playerId);}}
settings.captureClickEventForiOS=true;kWidget.embed(settings);});if(settings.thumbReadyCallback){settings.thumbReadyCallback(targetId);}},destroy:function(target){if(typeof target=='string'){target=document.getElementById(target);}if(!target){this.log("Error destory called without valid target");return;}var targetId=target.id;var targetCss=target.style.cssText;var targetClass=target.className;var destoryId=target.getAttribute('id');for(var id in this.readyWidgets){if(id==destoryId){delete(this.readyWidgets[id]);}}this.destroyedWidgets[destoryId]=true;var newNode=document.createElement("div");newNode.style.cssText=targetCss;newNode.id=targetId;newNode.className=targetClass;target.parentNode.replaceChild(newNode,target);},embedFromObjects:function(rewriteObjects){for(var i=0;i';output+='';output+='';if(settings['params']){for(var key in settings['params']){if(defaultParamSet[key]){defaultParamSet[key]=settings['params'][key];}else{output+='';}}}for(var key in defaultParamSet){if(defaultParamSet[key]){output+='';}}output+="";var outputElemnt=function(){elm.parentNode.replaceChild(spanTarget,elm);spanTarget.innerHTML=output;}
if(window.console&&(window.console.firebug||window.console.exception)){console.log('Warning firebug + firefox and dynamic flash kdp embed causes lockups in firefox'+', ( delaying embed )');this.domReady(function(){setTimeout(function(){outputElemnt();},2000);});}else{if(navigator.userAgent.indexOf("MSIE")!=-1){setTimeout(function(){outputElemnt();},0);}else{outputElemnt();}}},outputHTML5Iframe:function(targetId,settings){var _this=this;var widgetElm=document.getElementById(targetId);var iframeId=widgetElm.id+'_ifp';var iframeCssText='border:0px; max-width: 100%; max-height: 100%; '+widgetElm.style.cssText;var iframe=document.createElement("iframe");iframe.id=iframeId;iframe.scrolling="no";iframe.name=iframeId;iframe.className='mwEmbedKalturaIframe';iframe.allowfullscreen='yes';iframe.style.cssText=iframeCssText;if(settings.width=='%'||settings.height=='%'||widgetElm.style.width.indexOf('%')!=-1||widgetElm.style.height.indexOf('%')!=-1){var rectObject=widgetElm.getBoundingClientRect();
iframe.style.width=rectObject.width+'px';iframe.style.height=rectObject.height+'px';}else{if(settings.width){iframe.width=settings.width;}if(settings.height){iframe.height=settings.height;}}var iframeProxy=document.createElement("div");iframeProxy.id=widgetElm.id;iframeProxy.name=widgetElm.name;var moreClass=widgetElm.className?' '+widgetElm.className:'';iframeProxy.className='kWidgetIframeContainer'+moreClass;iframeProxy.style.cssText=widgetElm.style.cssText+';overflow: hidden';iframeProxy.appendChild(iframe);widgetElm.parentNode.replaceChild(iframeProxy,widgetElm);var updateIframeSize=function(){setTimeout(function(){if(typeof iframeProxy.getBoundingClientRect=='function'){var rectObject=iframeProxy.getBoundingClientRect();}else{var rectObject={width:iframeProxy.offsetWidth,height:iframeProxy.offsetHeight};}iframe.style.width=rectObject.width+'px';iframe.style.height=rectObject.height+'px';},0);}
iframeProxy.parentNode.onresize=updateIframeSize;this.addEvent(window,'resize',updateIframeSize);this.addEvent(window,'orientationchange',updateIframeSize,true);if(settings.captureClickEventForiOS&&(this.isIOS()||this.isAndroid())){this.captureClickWrapedIframeUpdate(targetId,settings,iframe);return;}var cbName=this.getIframeCbName(targetId);window[cbName]=function(iframeData){var newDoc=iframe.contentWindow.document;newDoc.open();newDoc.write(iframeData.content);newDoc.close();window[cbName]=null;updateIframeSize();};if(this.iframeAutoEmbedCache[targetId]){window[cbName](this.iframeAutoEmbedCache[targetId]);}else{_this.appendScriptUrl(this.getIframeUrl()+'?'+this.getIframeRequest(widgetElm,settings)+'&callback='+cbName);}},getIframeCbName:function(iframeId){var _this=this;var inx=0;var baseCbName='mwi_'+iframeId.replace(/[^0-9a-zA-Z]/g,'');var cbName=baseCbName+inx;while(window[cbName]){_this.log("Warning: iframe callback already defined: "+cbName);inx++;cbName=baseCbName+inx;}return cbName
;},captureClickWrapedIframeUpdate:function(targetId,settings,iframeElm){var _this=this;var widgetElm=document.getElementById(targetId);var newDoc=iframeElm.contentDocument;newDoc.open();var vidSrc=location.protocol+'//www.kaltura.com/p/243342/sp/24334200/playManifest/entryId/1_vp5cng42/flavorId/1_6wf0o9n7/format/url/protocol/http/a.mp4';newDoc.write(''+''+''+''+''+''+''+'');newDoc.close();var cbName=this.getIframeCbName(targetId);window[cbName]=function(iframeParts){var head=iframeElm.contentDocument.
getElementsByTagName("head")[0]||iframeElm.documentElement;head.innerHTML=iframeParts.rawHead;iframeElm.contentDocument.getElementById("scriptsHolder").innerHTML=iframeParts.rawScripts;var nodeName=function(elem,name){return elem.nodeName&&elem.nodeName.toUpperCase()===name.toUpperCase();}
var evalScript=function(elem){var data=(elem.text||elem.textContent||elem.innerHTML||"");var head=iframeElm.contentDocument.getElementsByTagName("head")[0]||iframeElm.documentElement;var script=iframeElm.contentDocument.createElement("script");script.type="text/javascript";script.appendChild(document.createTextNode(data));head.insertBefore(script,head.firstChild);if(elem.parentNode){elem.parentNode.removeChild(elem);}}
var scripts=[];var headElm=head.childNodes;var ret=iframeElm.contentDocument.getElementById("scriptsHolder").childNodes;for(var i=0;ret[i];i++){if(scripts&&nodeName(ret[i],"script")&&(!ret[i].type||ret[i].type.toLowerCase()==="text/javascript")){scripts.push(ret[i].parentNode?ret[i].parentNode.removeChild(ret[i]):ret[i]);}}for(var script in scripts){evalScript(scripts[script]);}}
_this.appendScriptUrl(this.getIframeUrl()+'?'+this.getIframeRequest(widgetElm,settings)+'&callback='+cbName+'&parts=1');},getIframeRequest:function(elm,settings){var iframeRequest=this.embedSettingsToUrl(settings);iframeRequest+='&playerId='+elm.id
if(mw.getConfig('debug')){iframeRequest+='&debug=true';}if(mw.getConfig('Kaltura.KWidgetPsPath')){iframeRequest+='&pskwidgetpath='+mw.getConfig('Kaltura.KWidgetPsPath');}if(mw.getConfig('Kaltura.AllowIframeRemoteService')&&(mw.getConfig("Kaltura.ServiceUrl").indexOf('kaltura.com')===-1&&mw.getConfig("Kaltura.ServiceUrl").indexOf('kaltura.org')===-1)){iframeRequest+=kWidget.serviceConfigToUrl();}if(mw.getConfig('Kaltura.NoApiCache')){iframeRequest+='&nocache=true';}if(this.isUiConfIdHTML5(settings.uiconf_id)){iframeRequest+='&forceMobileHTML5=true';}iframeRequest+='&urid='+MWEMBED_VERSION;return iframeRequest;},getIframeUrl:function(){var path=this.getPath();if(mw.getConfig('Kaltura.ForceIframeEmbed')===true){path=path.replace('localhost','127.0.0.1');}return path+'mwEmbedFrame.php';},getPath:function(){return SCRIPT_LOADER_URL.replace('load.php','');},outputIframeWithoutApi:function(targetId,settings){var targetEl=document.getElementById(targetId);var iframeSrc=this.getIframeUrl()+'?'+
this.getIframeRequest(targetEl,settings)+'&iframeembed=true';var targetNode=document.getElementById(targetId);var parentNode=targetNode.parentNode;var iframe=document.createElement('iframe');iframe.src=iframeSrc;iframe.id=targetId;iframe.width=(settings.width)?settings.width.replace(/px/,''):'100%';iframe.height=(settings.height)?settings.height.replace(/px/,''):'100%';iframe.className=targetNode.className?' '+targetNode.className:'';iframe.style.cssText=targetNode.style.cssText;iframe.style.border='0px';iframe.style.overflow='hidden';parentNode.replaceChild(iframe,targetNode);},addReadyCallback:function(readyCallback){for(var widgetId in this.readyWidgets){if(document.getElementById(widgetId)){readyCallback(widgetId);}}this.readyCallbacks.push(readyCallback);this.proxyJsCallbackready();},rewriteObjectTags:function(){var playerList=this.getKalutaObjectList();var _this=this;if(this.isMissingUiConfJs(playerList)){this.loadUiConfJs(playerList,function(){_this.rewriteObjectTags();})
return;}var serviceUrl=mw.getConfig('Kaltura.ServiceUrl');if(!mw.getConfig('Kaltura.AllowIframeRemoteService')){if(!serviceUrl||serviceUrl.indexOf('kaltura.com')===-1){mw.setConfig('Kaltura.IframeRewrite',false);mw.setConfig('Kaltura.UseManifestUrls',false);}}if(this.isHTML5FallForward()&&playerList.length){this.embedFromObjects(playerList);return;}if(!this.supportsFlash()&&!this.supportsHTML5()&&!mw.getConfig('Kaltura.ForceFlashOnDesktop')){this.embedFromObjects(playerList);return;}this.playerModeChecksDone();},uiConfScriptLoadList:{},inLoaderUiConfJsDone:false,inLoaderUiConfJsCallbackSet:[],inLoaderUiConfJsCallback:function(){this.inLoaderUiConfJsDone=true;while(this.inLoaderUiConfJsCallbackSet.length){this.inLoaderUiConfJsCallbackSet.shift()();}},isMissingUiConfJs:function(playerList){if(this.inLoaderUiConfJsDone==false){return true;}if(playerList.length==0||!mw.getConfig('Kaltura.EnableEmbedUiConfJs')||mw.getConfig('EmbedPlayer.IsIframeServer')){return false;}for(var i=0;i<
playerList.length;i++){var settings=playerList[i].kEmbedSettings;if(!this.uiConfScriptLoadList[settings.uiconf_id]){return true;}}return false;},uiConfScriptLoadListCallbacks:{},loadUiConfJs:function(playerList,doneCallback){var _this=this;var callback=function(){if(_this.inLoaderUiConfJsDone){doneCallback()}else{_this.inLoaderUiConfJsCallbackSet.push(doneCallback);}return;}
var baseUiConfJsUrl=this.getPath()+'services.php?service=uiconfJs';if(mw.getConfig('Kaltura.KWidgetPsPath')){baseUiConfJsUrl+='&pskwidgetpath='+mw.getConfig('Kaltura.KWidgetPsPath');}if(!this.isMissingUiConfJs(playerList)){callback();return;}var foundPlayerMissingUiConfJs=false;for(var i=0;i';doEmbedSettingsWrite(kEmbedSettings,attributes.id,attributes.width,attributes.height);}else{return originalFlashembed(targetId,attributes,flashvars);}});};var flashembedStaticMethods=['asString','getHTML','getVersion','isSupported'];for(var i=0;iparseInt(minVersionParts[i])){return true;}if(parseInt(clientVersionParts[i])2000)?'xhrPost':'xhrGet'):((this.type=="GET")?'xhrGet':'xhrPost');this[requestMethod](url,param,callback);},xhrGet:function(url,param,callback){var xmlhttp=new XMLHttpRequest();xmlhttp.onreadystatechange=function(){if(xmlhttp.readyState==4&&xmlhttp.status==200){callback(JSON.parse(xmlhttp.responseText));}}
xmlhttp.open("GET",url+'&'+$.param(param),true);xmlhttp.send();},xhrPost:function(url,param,callback){var xmlhttp=new XMLHttpRequest();xmlhttp.onreadystatechange=function(){if(xmlhttp.readyState==4&&xmlhttp.status==200){callback(JSON.parse(xmlhttp.responseText));}}
xmlhttp.open("POST",url,true);xmlhttp.setRequestHeader("Content-type","application/x-www-form-urlencoded");xmlhttp.send($.param(param));},handleKsServiceRequest:function(requestObject){var param={};if(requestObject['ks']){this.ks=requestObject['ks'];}if(!requestObject.length&&!this.getKs()){requestObject=[requestObject];}if(requestObject.length){param['service']='multirequest';param['action']='null';var mulitRequestIndex=1;if(!this.getKs()){param[mulitRequestIndex+':service']='session';param[mulitRequestIndex+':action']='startWidgetSession';param[mulitRequestIndex+':widgetId']=this.wid;mulitRequestIndex=2;}for(var i=0;i