Blame view

public/js/dist/roller.7ba08b121aa6403303fe.js 4.98 KB
e77200db5   nologostudio.ru   Initial commit
1
  (window.webpackJsonp=window.webpackJsonp||[]).push([["d2b2"],{"2jWy":function(e,t){!function(){var e=[],t=[];(window.PlayerJsReady={}).listen=function(n,o){for(var i in t)if(n.contentWindow===t[i].source)return o(t[i].message);e.push({target:n,callback:o})},window.addEventListener("message",function(n){var o,i=PlayerJsCommon.getPlayerJsMessage(n);i&&"ready"===i.event&&i.value&&i.value.src&&(console.log("Ready"),o={source:n.source,message:i},t.push(o),function(t){for(var n in e)e[n].target.contentWindow===t.source&&e[n].callback(t.message)}({source:n.source,message:i}))})}()},"5LFy":function(e,t){!function(){var e=window.PlayerJs=function(e){this.el=document.querySelectorAll(e)[0],this.origin=this.el.src};e.prototype.play=function(){this._send("play")},e.prototype.pause=function(){this._send("pause")},e.prototype.onReady=function(e){PlayerJsReady.listen(this.el,e)},e.prototype._send=function(e,t){this.onReady(function(){this.el.contentWindow.postMessage(JSON.stringify({context:"player.js",version:"0.0.11",method:e,value:t}),this.origin)}.bind(this))},e.prototype._on=function(e,t){var n=function(n){if(n.source===this.el.contentWindow){var o=PlayerJsCommon.getPlayerJsMessage(n);o&&o.event===e&&t(o,n)}}.bind(this);return window.addEventListener("message",n),n},e.prototype._off=function(e){window.removeEventListener("message",e)},e.prototype.onFirstPlay=function(e){this._send("addEventListener","play");var t=this._on("play",function(){this._off(t),e()}.bind(this))}}()},"9YEn":function(e,t){(window.PlayerJsCommon=function(){}).getPlayerJsMessage=function(e){var t;try{t=JSON.parse(e.data)}catch(e){return}if("player.js"===t.context)return t}},"Kz+5":function(e,t){function n(e,t){this.player=new PlayerJs(e),this.roll=roller(this.player,t),this.roll&&this.player.onReady(function(e){/Android|iPhone|IEMobile|iPod|Opera Mini|webOS|BlackBerry/i.test(navigator.userAgent)?this.addClickOverlay():this.player.onFirstPlay(function(){console.log("FIRST PLAY"),this.player.pause(),this.roll.playAds()}.bind(this))}.bind(this))}n.prototype.addClickOverlay=function(){var e=$('<div style="position: absolute; width: 100%; height: 100%; top: 0; left: 0; cursor: pointer; z-index: 9999;"></div>').insertAfter(this.player.el)[0];e.addEventListener("click",function(){console.log("FIRST CLICK"),this.player.play(),this.player.pause(),e.parentNode.removeChild(e),this.roll.playAds()}.bind(this))},n.prototype.destroy=function(){this.roll.destroy()}},p0nh:function(e,t,n){"use strict";n.r(t);n("5LFy"),n("9YEn"),n("2jWy"),n("vWW2"),n("Kz+5")},vWW2:function(e,t){!function(){var e,t,n,o,i,r,s,a;function d(){if(!e)return u();n.initialize(),v();try{e.init(parseInt(getComputedStyle(i.el).width,10),parseInt(getComputedStyle(i.el).height,10),google.ima.ViewMode.NORMAL),e.start()}catch(e){c(e)}}function l(t){console.log("LOADED MANAGER");var n=new google.ima.AdsRenderingSettings;n.loadVideoTimeout=1e4,(e=t.getAdsManager({duration:120,currentTime:0},n)).addEventListener(google.ima.AdErrorEvent.Type.AD_ERROR,c),e.addEventListener(google.ima.AdEvent.Type.CONTENT_PAUSE_REQUESTED,y),e.addEventListener(google.ima.AdEvent.Type.CONTENT_RESUME_REQUESTED,u),e.addEventListener(google.ima.AdEvent.Type.ALL_ADS_COMPLETED,g),e.addEventListener(google.ima.AdEvent.Type.LOADED,g),e.addEventListener(google.ima.AdEvent.Type.STARTED,g),e.addEventListener(google.ima.AdEvent.Type.COMPLETE,g)}function g(t){console.log(t);var n=t.getAd();switch(t.type){case google.ima.AdEvent.Type.LOADED:n.isLinear()||(i.play(),h());break;case google.ima.AdEvent.Type.STARTED:a.remove(),n.isLinear()&&(o=setInterval(function(){e.getRemainingTime()},300));break;case google.ima.AdEvent.Type.COMPLETE:n.isLinear()&&clearInterval(o)}}function p(e){console.log(e.getError())}function c(t){console.log(t.getError&&t.getError()||t),u(),e&&e.destroy()}function y(){v(),i.pause()}function u(){h(),i.play()}function v(){console.log("SHOW"),s.style.display="block"}function h(){console.log("HIDE"),s.style.display="none"}function E(){n&&n.destroy(),t&&t.destroy(),e&&(e.destroy(),e=void 0),s.parentNode&&s.parentNode.removeChild(s)}window.roller=function(e,o){if(i=e,r=o,"undefined"!=typeof google)return function(){s=$('<div id="adContainer" style="background: #000; display:none; width: 100%; height: 100%; top: 0; left: 0; position: absolute;"></div>').insertAfter(i.el)[0],a=$('<div style="position: absolute; bottom: 10px; left: 15px; z-index: 99999;">Loading Advertisement ...</div>').appendTo(s),n=new google.ima.AdDisplayContainer(s),(t=new google.ima.AdsLoader(n)).getSettings().setVpaidMode(google.ima.ImaSdkSettings.VpaidMode.ENABLED),t.addEventListener(google.ima.AdsManagerLoadedEvent.Type.ADS_MANAGER_LOADED,l,!1),t.addEventListener(google.ima.AdErrorEvent.Type.AD_ERROR,p,!1);var e=new google.ima.AdsRequest;e.adTagUrl=r,e.linearAdSlotWidth=parseInt(getComputedStyle(i.el).width,10),e.linearAdSlotHeight=parseInt(getComputedStyle(i.el).height,10),e.nonLinearAdSlotWidth=getComputedStyle(i.el).width,e.nonLinearAdSlotHeight=getComputedStyle(i.el).height/3,t.requestAds(e)}(),{playAds:d,destroy:E}}}()}},[["p0nh","d41d"]]]);