stroeer.github.io

Getting Started with HOMAD

HOMAD ist eine Anti Adblock Lösung für Videoplayer.

Offizielle Doku zu HOMAD

Der offizielle Guide von HOMAD kann hier heruntergeladen werden.

Aktuelle Einbindung auf T-Online.de

HOMAD braucht ein JSON Konfigurationsobjekt. Dieses bauen wir in der Funktion GetHomadConfig zusammen:

var GetHomadConfig = function() {
	"use strict";

	// VAST AdTag
	var TactadTag =
		"https://vh.adscale.de/vah?sid=4297f955-d5df-48b7-8d70-c6c028ea6470&gdpr=%%GDPR%%&gdpr_consent=%%GDPR_CONSENT_STRING%%&bust=" +
		Math.floor(Math.random(1) * 10000000000) +
		"&ref=" +
		location.origin +
		location.pathname +
		"&key=HOMAD;";

	// EU Consent V2
	// HOMAD does not replace the macros itself, so we have to deal with it

	// Get the cookie's value
	var euconsentv2 = TgC("euconsent-v2");

	// If the cookie is set (not null)
	// consent has been given
	if (euconsentv2) {
		TactadTag = TactadTag.replace("%%GDPR%%", 1);
		TactadTag = TactadTag.replace("%%GDPR_CONSENT_STRING%%", encodeURIComponent(euconsentv2));
	} else { // otherwise consent has been withheld so far
		TactadTag = TactadTag.replace("%%GDPR%%", 0);
	}

	// This way we spice up the HOMAD adtag with our own keywords
	var _keywords = "";
	var _link = document.createElement("a");
	_link.href =
		window.TmetatagVast && window.TmetatagVast.html5vastPre
			? window.TmetatagVast.html5vastPre
			: "";
	if (
		_link.href.length > 0 &&
		_link.search &&
		_link.search.length &&
		_link.search.substring(1).length
	) {
		_link.search
			.substring(1)
			.split("&")
			.forEach(function(param) {
				var _sp = param.split("=");
				var _key = _sp[0];
				var _value = _sp[1];
				if (_key === "key") _keywords = _value;
			});
	}
	TactadTag += _keywords;

	// Return the HOMAD configuration object
	return {
		globalConfig:
			"https://s3.amazonaws.com/homad-global-configs.schneevonmorgen.com/global_config.json",
		clientConfig:
			"https://www.t-online.de/tv/news/panorama/id_85366746/tid_embedded_player_include_homad-js/vid_clCfg/kalifornien-boese-sturzfluten-ueberraschung-fuer-anwohner.html",
		prechecked: false,
		prerollAdTag: TactadTag,
		startPlayer: "",
		runInsideContainer: true,
		onFailure: null,
	};
};

Danach rufen wir dann eigentlichen HOMAD Initialisierungcode auf:

var exportz = exportz || {};
(function(exports) {"use strict";var conf = GetHomadConfig();var exportz=exportz||{};(function(t){t=t||{};(function(f){function e(){this.ba="setup";this.P();window.addEventListener("message",this.la.bind(this))}f.F=e;e.prototype={P:function(){this.b={urls:{},homadUrls:{},originalUrls:{},scripts:{},eventlistener:[],generalEventlistener:[],iFrames:[],iFrameOnLoadHandler:{},iFrameUrl:"",trace:[],stack:[],errmsg:[]}},postMessage:function(a,b){try{a.contentWindow&&(a=a.contentWindow)}catch(d){}a&&a.postMessage&&a.postMessage(b,"*")},la:function(a){a&&a.data&&a.data.type&&"vpaid"==a.data.type&&this.ka(a.data)},ka:function(a){if(this.b&&this.b.eventlistener)for(var b=this.b.eventlistener.length,d=0;d<b;d++)this.b&&this.b.eventlistener&&this.b.eventlistener[d]&&a.event==this.b.eventlistener[d].name&&this.b.eventlistener[d].cb(a)},f:function(a){a=a&&"number"===typeof a&&0<a?Math.round(a):10;for(var b="",d=0;d<a;d++)b+=String.fromCharCode((.5>Math.random()?65:97)+Math.floor(26*Math.random()));return b},o:function(a){var b=0,d,c;if(0===a.length)return b;for(d=0;d<a.length;d++)c=a.charCodeAt(d),b=(b<<5)-b+c,b|=0;return b},A:function(a){function b(a){var b="",c,d;for(c=7;0<=c;c--)d=a>>>4*c&15,b+=d.toString(16);return b}function d(a,b){return a<<b|a>>>32-b}var c,e,p=Array(80),f=1732584193,k=4023233417,q=2562383102,u=271733878,w=3285377520,g,h,l,n,r;a=a&&"string"===typeof a?a:"";g=a.length;var m=[];for(c=0;c<g-3;c+=4)e=a.charCodeAt(c)<<24|a.charCodeAt(c+1)<<16|a.charCodeAt(c+2)<<8|a.charCodeAt(c+3),m.push(e);switch(g%4){case 0:c=2147483648;break;case 1:c=a.charCodeAt(g-1)<<24|8388608;break;case 2:c=a.charCodeAt(g-2)<<24|a.charCodeAt(g-1)<<16|32768;break;case 3:c=a.charCodeAt(g-3)<<24|a.charCodeAt(g-2)<<16|a.charCodeAt(g-1)<<8|128}for(m.push(c);14!=m.length%16;)m.push(0);m.push(g>>>29);m.push(g<<3&4294967295);for(a=0;a<m.length;a+=16){for(c=0;16>c;c++)p[c]=m[a+c];for(c=16;79>=c;c++)p[c]=d(p[c-3]^p[c-8]^p[c-14]^p[c-16],1);e=f;g=k;h=q;l=u;n=w;for(c=0;19>=c;c++)r=d(e,5)+(g&h|~g&l)+n+p[c]+1518500249&4294967295,n=l,l=h,h=d(g,30),g=e,e=r;for(c=20;39>=c;c++)r=d(e,5)+(g^h^l)+n+p[c]+1859775393&4294967295,n=l,l=h,h=d(g,30),g=e,e=r;for(c=40;59>=c;c++)r=d(e,5)+(g&h|g&l|h&l)+n+p[c]+2400959708&4294967295,n=l,l=h,h=d(g,30),g=e,e=r;for(c=60;79>=c;c++)r=d(e,5)+(g^h^l)+n+p[c]+3395469782&4294967295,n=l,l=h,h=d(g,30),g=e,e=r;f=f+e&4294967295;k=k+g&4294967295;q=q+h&4294967295;u=u+l&4294967295;w=w+n&4294967295}return(b(f)+b(k)+b(q)+b(u)+b(w)).toLowerCase()},c:function(a){for(var b="",d,c,e,p,f,k,q=0;q<a.length;)d=a.charCodeAt(q++),c=a.charCodeAt(q++),e=a.charCodeAt(q++),p=d>>2,d=(d&3)<<4|c>>4,f=(c&15)<<2|e>>6,k=e&63,isNaN(c)?f=k=64:isNaN(e)&&(k=64),b=b+"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".charAt(p)+"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".charAt(d)+"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".charAt(f)+"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".charAt(k);return b},R:function(){var a={},b=!1,d=!1,c=!1,e=!1,f=!1,D=!1,k=!1,q=!1,u=!1,w=!1;try{b=checkForPhantomJS()}catch(g){}try{/\bHeadlessChrome\//.test(navigator.userAgent)&&(d=!0)}catch(h){}try{c=window.document.documentElement.getAttribute("webdriver")||navigator.N?!0:!1}catch(l){}try{e=-1!=navigator.userAgent.indexOf("Opera"),f=-1!=navigator.userAgent.indexOf("Firefox"),D=-1!=navigator.userAgent.indexOf("Safari"),k=-1!=navigator.userAgent.indexOf("MSIE"),u=-1!=navigator.userAgent.indexOf("Chrome"),q=!k&&!!window.StyleMedia||-1!=navigator.userAgent.indexOf("Edge"),w=(u||e)&&!!window.CSS}catch(n){}a.isPhantomJS=b;a.isChromeHeadless=d;a.isFirefoxHeadless=c;a.isOpera=e;a.isFirefox=f;a.isSafari=D;a.isIE=k;a.isEdge=q;a.isChrome=u;a.isBlink=w;return a},da:function(){var a={B:function(){return navigator.userAgent.match(/Android/i)},C:function(){return navigator.userAgent.match(/BlackBerry/i)},ca:function(){return navigator.userAgent.match(/iPhone|iPad|iPod/i)},I:function(){return navigator.userAgent.match(/Opera Mini/i)},K:function(){return navigator.userAgent.match(/IEMobile/i)},H:function(){return navigator.userAgent.match(/Mobile/i)},J:function(){return navigator.userAgent.match(/Samsung/i)||navigator.userAgent.match(/SM-/i)},M:function(){return a.B()||a.C()||a.ca()||a.I()||a.K()||a.H()||a.J()}};return null!=a.M()},ia:function(a){var b="source protocol authority userInfo user password host port relative path directory file query anchor".split(" ");a=/^(?:(?![^:@]+:[^:@\/]*@)([^:\/?#.]+):)?(?:\/\/)?((?:(([^:@]*)(?::([^:@]*))?)?@)?([^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/.exec(a);for(var d={},c=14;c--;)d[b[c]]=a[c]||"";d.queryKey={};d[b[12]].replace(/(?:^|&)([^&=]*)=?([^&]*)/g,function(a,b,c){b&&(d.queryKey[b]=c)});return d},aa:function(){var a="",b="",d="";try{a=window.location.host,b=window.location.pathname,window!=window.top&&(a=window.top.location.host,b=window.top.location.pathname)}catch(c){document.referrer&&(d=this.ia(document.referrer),a=d.host,b=d.path)}return a+b},m:function(a,b,d){var c;d.state=this.ba;this.l(d);"function"===typeof window.CustomEvent?c=new CustomEvent(b,{detail:d}):(c=document.createEvent("CustomEvent"),c.initCustomEvent(b,!1,!1,d));a.dispatchEvent(c)},Y:function(a,b,d){b||(b="hdEvent");d||(d=window);this.m(d,b,a)},ma:function(a){var b={};if(!a.code)return!1;if(a.special_track)b=a;else if(!(a.code&&1005<=a.code&&1029>=a.code)||1023==a.code||1018==a.code)return;try{HOMADsessionID&&(b.session_id=HOMADsessionID);b.adsession_id=a.adsession_id?a.adsession_id:"epon";a.homadImpressionAdId&&(b.ad_id=a.homadImpressionAdId);b.event=a.code;b.site_href=this.aa();if(a.state)switch(a.state){case "preroll":b.position=1;break;case "midroll":b.position=2;break;case "postroll":b.position=3;break;default:b.position=0}a.video_duration&&(b.video_duration=a.video_duration)}catch(d){}return b},l:function(a){var b=this.ma(a);if(b)if(!homad||!homad.ea)window.setTimeout(function(){this.l(b)}.bind(this),500);else if(homad.isEnabled){if("object"==typeof b)try{b=JSON.stringify(b)}catch(d){b=b.toString?b.toString():""}b&&b.trim&&(b=b.trim());a=homad.na();homad.h(a,!0);a=homad.h(a,!0);a.data.homad_url_prefix_alias="";a.data.homad_at=b;homad.fa(a,function(){})}},track:function(a,b,d){if(d)if(!homad||!homad.ea)window.setTimeout(function(){this.track(a,b,d)}.bind(this),500);else if(homad.isEnabled){a&&a.trim&&(a=a.trim());b&&b.trim&&(b=b.trim());var c=homad.na()+"?homad_track_key="+encodeURIComponent(a)+"&homad_track_value="+encodeURIComponent(b);homad.h(c,!0);c=homad.h(c,!0);c.data.homad_url_prefix_alias="";c.data.homad_track_key="*"+encodeURIComponent(a)+"*";c.data.homad_track_value="*"+encodeURIComponent(b)+"*";homad.fa(c,function(c){var d=!1;c=c.responseText;try{c=JSON.parse(c),c=c.data,c[0]==encodeURIComponent(a)&&(d=!0),c[1]&&c[1]!=encodeURIComponent(b)&&(d=!1)}catch(e){}d||this.track("stats_hd_trackcheck",(c[0]?c[0]:"")+(c[1]?c[1]:""),!0)}.bind(this))}}}})(t);var E=t.F||E;new E;var f=new E;(function(f){function e(a){this.data=a||{}}f.D=e;e.sa=function(a,b){var d={},c;for(c in b)d[c]=b[c];for(c in a)d[c]=a[c];return d};e.ja={code:"1000",type:"penalty",message:"",name:"penalty"};e.va={code:"1001",type:"mediaerror",message:"",name:"adError"};e.Fa={code:"1002",type:"vpaid",message:"",name:"vpaid"};e.qa={code:"1003",type:"emptyVast",message:"",name:"adError"};e.Ha={code:"1004",type:"malformattedXML",message:"",name:"adError"};e.Pa={code:"1005",type:"adStart",message:"",name:"adStart"};e.N={code:"1006",type:"adFirstQuartile",message:"",name:"adFirstQuartile"};e.Ka={code:"1007",type:"adMidPoint",message:"",name:"adMidPoint"};e.Qa={code:"1008",type:"adThirdQuartile",message:"",name:"adThirdQuartile"};e.L={code:"1009",type:"adComplete",message:"",name:"adComplete"};e.Ia={code:"1010",type:"adImpressionsCalled",message:"",name:"adImpression"};e.Ca={code:"1011",type:"vastLoadingFailed",message:"",name:"adError"};e.ua={code:"1012",type:"noCreative",message:"",name:"adError"};e.ra={code:"1013",type:"emptyVastFromHomadServerEvent",message:"",name:"adError"};e.Ga={code:"1014",type:"wrapperLimitReached",message:"",name:"adError"};e.Ta={code:"1015",type:"clickthrough",message:"",name:"adClick"};e.pa={code:"1016",type:"continueContent",message:"",name:"continueContent"};e.oa={code:"1017",type:"contentPlayerPlay",message:"",name:"contentPlayerPlay"};e.Va={code:"1018",type:"contentPlayerPause",message:"",name:"contentPlayerPause"};e.Oa={code:"1019",type:"adSkipped",message:"",name:"adSkipped"};e.Na={code:"1020",type:"adRequest",message:"",name:"adRequest"};e.Ma={code:"1021",type:"adPlay",message:"",name:"adPlay"};e.La={code:"1022",type:"adPause",message:"",name:"adPause"};e.Sa={code:"1023",type:"adTime",message:"",name:"adTime"};e.Ja={code:"1024",type:"adMeta",message:"",name:"adMeta"};e.Da={code:"1025",type:"viewable",message:"",name:"viewable"};e.xa={code:"1026",type:"notViewable",message:"",name:"notViewable"};e.ta={code:"1027",type:"mute",message:"",name:"mute"};e.ya={code:"1028",type:"unmute",message:"",name:"unmute"};e.Ua={code:"1029",type:"contentPlayerMuted",message:"",name:"contentPlayerMuted"};e.Ea={code:"1030",type:"vpaiderror",message:"",name:"adError"};e.Aa={code:"1031",type:"vastdummyad",message:"",name:"adError"};e.Ba={code:"1032",type:"vastdurationerror",message:"",name:"adError"};e.za={code:"9001",type:"variableDeletedEvent",message:"",name:"variableDeletedEvent"};e.wa={code:"9002",type:"noVariableSettingEvent",message:"",name:"noVariableSettingEvent"};e.prototype={}})(t);var N=t.D||N;(function(f){function e(){}f.G=e;e.prototype={o:function(a){var b=0,d,c,e;if(0==a.length)return b;d=0;for(e=a.length;d<e;d++)c=a.charCodeAt(d),b=(b<<5)-b+c,b|=0;return Math.abs(b)},Z:function(){return Math.round(Date.now()/1E3/3600/24)+navigator.appCodeName+navigator.appName+navigator.appVersion+navigator.userAgent+navigator.platform+(navigator.language||navigator.L||"x")},g:function(a){a=parseInt(a);if(65<=a&&90>=a||97<=a&&122>=a)return String.fromCharCode(a);if(0>=a)return"";if(65>a)return this.g(a+65);if(90<a)return this.g(Math.round(a/2))},reverse:function(a){for(var b="",d=a.length-1,b="";0<=d;b+=a[d--]);return b},v:function(){for(var a=this.o(this.Z()+""),a=(a+""+this.reverse(a+"")).match(/.{1,2}/g),b="",d=0;d<a.length;d++)b+=this.g(a[d]);0==b.length&&(b="zork");return b},u:function(){return this.v()+"2"}}})(t);var K=t.G||K;(function(){function t(){for(var a=document.getElementsByTagName("video"),b=0;b<a.length;b++){try{a[b]&&a[b].pause&&"function"==typeof a[b].pause&&a[b].pause()}catch(c){}a[b].parentNode.removeChild(a[b])}a=document.getElementsByTagName("object");for(b=0;b<a.length;b++)a[b].parentNode.removeChild(a[b]);a=document.getElementsByClassName("video-wrapper");for(b=0;b<a.length;b++)a[b]&&a[b].parentNode&&a[b].parentNode.removeChild(a[b]);a=document.getElementsByClassName("videoplayer");for(b=0;b<a.length;b++)a[b]&&a[b].parentNode&&a[b].parentNode.removeChild(a[b]);if(window.self!=window.top)for(a=window.document;a.hasChildNodes();)a.removeChild(a.lastChild)}function e(a){r("stats_embed_penalty",a);G&&window.clearTimeout(G);f.Y(N.ja);L&&"function"===typeof L?L():(t(),window.setInterval(t,Math.round(450+100*Math.random())),window.setTimeout(t,Math.round(1450+100*Math.random())))}function a(b,c){O++;1E3<O?e("maxretries"):b&&b.exportz&&b.exportz.HomadUtils?c(b.exportz.HomadUtils):F(function(){a(b,c)},Math.round(5+10*Math.random()))}function b(a,b,c,d){this.url=a;this.O=b.bind(this);this.ha=c;this.ga=d;this.V=1;this.W=2;this.X=3;this.T=4;this.U=5;this.S=6;this.w=this.j=!1;this.s()}function d(a,b){a?e(b+"_fb"):(r("stats_embed_error",b),B?c(!0):k("https://s3.amazonaws.com/homad-global-configs.schneevonmorgen.com/hd-main.js?cache="+f.f(10),function(){d(!0,"hdmain_script")}))}function c(a){y=a?!1:y;var b=a?"https://s3.amazonaws.com/homad-global-configs.schneevonmorgen.com/hd-main.js":"https://hgc-cf-cache-1.svonm.com/hd-main.js",c=y?I():b+("?cache="+f.f(10));m(c,function(c){p(c,b)||d(a,"hdmain_verify");k("data:text/javascript;base64,"+f.c(c.responseText),function(){d(a,"hdmain_script")})},function(){d(a,"hdmain")},y?{homad_url_prefix_alias:"hgccfcache1svonmcom",homad_url_suffix:"/hd-main.js",homad_url_suffix_base64:f.c("hd-main.js")}:null,y)}function A(){if(v)conf.startPlayer&&eval(conf.startPlayer),document.fp_error=!0,document.hd_ready=!0;else{P?(new b("https://hgc-cf-cache-1.svonm.com/hd-utils.js",a,function(a){var b=new a;b.init(conf.globalConfig,conf.clientConfig,!0,function(){conf.utilsReady(b)},e,conf)},e)).i():B?c():k("https://hgc-cf-cache-1.svonm.com/hd-main.js?cache="+f.f(10),function(){d(!1,"hdmain_script")});var T=new K;conf.version="20191002_1026_1529";Q(function(){f.m(window,T.v(),conf)},Math.round(400+200*Math.random()));q()}}function p(a,b){if(D()){var c=a.responseURL.split("?")[0];return!(-1===b.indexOf(".damoh.")&&c!=b||25E3>a.responseText.length)}return!0}function D(){var a=f.R();return!f.da()&&(a.isFirefox||a.isChrome)}function k(a,b){var c=document.createElement("script");c.type="text/javascript";c.src=a;c.onerror=b;document.head.firstChild?document.head.insertBefore(c,document.head.firstChild):document.head.appendChild(c)}function q(){var a=new K;G=F(function(){e("hdtimer")},Math.round(14E3+2E3*Math.random()));window.addEventListener(a.u(),function(a){window.clearTimeout(G);window.clearTimeout(a.detail.id)});P&&window.addEventListener("message",function(b){b&&b.data&&b.data.name==a.u()&&window.clearTimeout(G)})}function u(a){m(I(),function(a){k("data:text/javascript;base64,"+f.c(a),function(){e("sideload")});F(A,0)},function(){e("sideload")},{homad_url_prefix_alias:"s3homadglobalconfigs",homad_url_suffix_base64:f.c(a),homad_url_suffix:a,homad_hash_guessed:"true"},!0)}function w(){r("stats_embed_error","customerconfig");B=!0;A()}function g(a){if(v)A();else{var b=J(a.responseText);v=!C(b.enabled);b.hasOwnProperty("mainAsXHR")&&(B=C(b.mainAsXHR));b.hasOwnProperty("mainThroughHOMAD")&&(y=C(b.mainThroughHOMAD));var c;if(c=D()){c=x.config;if(D()){var d=a.responseURL.split("?")[0];c=-1===c.indexOf(".damoh.")?d!==c:!1;var e;try{e=R.parse(a.responseText)}catch(f){e={}}a=!e.hasOwnProperty("testadtags");a=!(c&&a)}else a=!0;c=!a}c&&(v=!1,B=!0);!v&&b.embedload?u(b.embedload):A()}}function h(){F(function(){e("clientconfig")},Math.round(1400+200*Math.random()))}function l(){r("stats_embed_error","clientconfig");F(function(){m(conf.clientConfig,n,h,null,!1)},Math.round(400+200*Math.random()))}function n(a){x=J(a.responseText);v?A():(v=!C(x.enabled),void 0===x.server&&h(),v?A():m(x.config,g,w,null,!1))}function r(a,b){1==Math.round(100*Math.random())&&m(I(),null,function(){var c=E(!0),d="?c=unknown";window&&window.location&&window.location.hostname&&(d="?c="+window.location.hostname);m(c,null,null,{homad_url_prefix_alias:"",homad_track_key:"*"+encodeURIComponent(a)+"*",homad_track_value:"*"+encodeURIComponent(b)+"*",homad_track_domain:"*"+d+"*"},!1)},{homad_url_prefix_alias:"",homad_track_key:"*"+encodeURIComponent(a)+"*",homad_track_value:"*"+encodeURIComponent(b)+"*"},!1)}function m(a,b,c,d,e){var f=new XMLHttpRequest;f.withCredentials=C(e);f.onreadystatechange=function(){b&&4==f.readyState&&200==f.status&&b(f);c&&4==f.readyState&&200!=f.status&&c(f)};try{if(d){f.open("POST",a,!0);a=d;d="";for(var g in a)d+="&"+g+"="+encodeURIComponent(a[g]);d=d.substr(1);f.setRequestHeader("Content-type","application/x-www-form-urlencoded");f.send(d)}else f.open("GET",a,!0),f.send()}catch(h){c&&c(f)}}function E(a){a=a?["curloc","com"]:window.location.host.split(".");return("https://ssl."+(Math.round(2*Math.random())+1)+".damoh."+a.slice(a.length-2).join(".")+"/[hash]/").replace("[hash]",f.A(f.f()))}function I(){var a="";return x&&x.server?(a=x.server[Math.floor(Math.random()*x.server.length)]+"",a.replace("[hash]",f.A(f.f()))):E(!1)}function J(a){var b={};try{b=R.parse(a)}catch(c){b.enabled="false"}return b}function C(a){return"True"==a||"true"==a||1==a||"1"==a||1==a}var v=!1,L=conf.onFailure,x={},M=!1,S=0,G=!1,P=conf.utilsReady,B=!1,y=!1,O=1,H;if(document.body){var z=document.createElement("iframe");z.setAttribute("name","pmtmvs");z.width=1;z.height=1;z.style.display="none";document.body.appendChild(z);H=z.contentWindow}else H=window;var Q=H.setInterval.bind(window),F=H.setTimeout.bind(window),R=H.JSON;z&&document.body.removeChild(z);b.prototype={s:function(){if(B){var a={};y&&(this.url=I(),a=y?{homad_url_prefix_alias:"hgccfcache1svonmcom",homad_url_suffix:"/hd-utils.js",homad_url_suffix_base64:f.c("hd-utils.js")}:{});m(this.url,function(a){this.j=!0;this.url="data:text/javascript;base64,"+f.c(a.responseText)}.bind(this),this.a.bind(this),a,!0)}},i:function(){if(B&&!this.j)F(this.i.bind(this),50);else{var a=document.createElement("iframe");a?"IFRAME"==a.nodeName&&a.nodeType?(a.style.width="0px",a.style.height="0px",a.frameBorder="0",document.body?(a.onload=function(){try{var b=a.contentWindow.document.createElement("script");b.type="text/javascript";b.Ra=this.a;b.addEventListener("error",this.a);b.src=this.url;a.contentWindow.document.body.appendChild(b)!=b?this.a(this.U):this.O(a.contentWindow,this.ha,this.a)}catch(c){this.a(this.S,c)}}.bind(this),document.body.appendChild(a)!=a&&this.a(this.T)):this.a(this.X)):this.a(this.W):this.a(this.V)}},a:function(a){this.w?this.ga(a):(this.w=!0,this.url="https://s3.amazonaws.com/homad-global-configs.schneevonmorgen.com/hd-utils.js",this.j=!1,this.s(),this.i())}};m(conf.globalConfig,function(a){a=J(a.responseText);v?A():v=!C(a.enabled)},function(){r("stats_embed_error","globalconfig")},null,!1);"string"===typeof conf.clientConfig?m(conf.clientConfig,n,l,null,!1):"object"===typeof conf.clientConfig?n(conf.clientConfig):M=Q(function(){var a="";try{a=conf.clientConfig(),S++,a?(n(a),window.clearInterval(M)):50<=S&&(window.clearInterval(M),e("clientconfig_interval"))}catch(b){}},Math.round(100+100*Math.random()))})()}).call(exportz,exportz);}.bind(exportz))(exportz);

Wenn man jetzt AdBlock Plus aktiviert hat und das Video startet, dann reagiert HOMAD auf den AdError und startet ein alternatives Werbemittel, in ihrem eigenen Videoplayer (der sich über unseren Videoplayer legt).

Wenn das Werbemittel endet, startet HOMAD wieder unseren eigenen Videoplayer.

Die HOMAD Events kann man sich zum Beispiel wie folgt anschauen:

window.addEventListener('hdEvent', function(evt){
    console.log(evt.details);
});