var getPoss = function() {
if (window.country_code) return !(country_code === 'IN' || country_code === 'PK')
return true;
}
var skipTo = hommy.qs.autoplay || seekIsActive;
if (skipTo) {
window.videoadvertising2 = {}
}
var playerContainer = document.querySelector('.left > div');
hommy('preroll', {
//idzone: 3989190,
adbEn: true,
spotId: 20776,
skipYTVpaid: hommy.qs.promo === '31134' || hommy.isPCO || (hommy.isBravo && getPoss()),
/* zoneType: !hommy.isAdblock() && hommy.qs.promo === '31134' ? 'exoclick' : undefined, */
afterLoad: function() {
//typeof window.x_8sW === 'function' && x_8sW();
},
playerNode: '.left > div',
player: {
width: playerContainer.offsetWidth,
height: playerContainer.offsetHeight
},
afterLoad: function(data, loader) {
loader.setPlayerEvents('jw', pl3748);
},
skip: 10,
forceSkip: skipTo
});
%% video.title %%
%% $utils.parseDate(video.post_date) %%
%% video.title %% %% $utils.parseDate(video.post_date) %%
%% $utils.reduceNum(video.statistics.likes) %%
%% $utils.reduceNum(video.statistics.dislikes) %%
%% $utils.reduceNum(video.statistics.viewed) %%
%% $t('page.video.download') %%
%% $t('page.video.share') %%
%% $t('page.video.add_to') %%
%% $t('page.video.report') %%
%% video.description %%
%% show_description ? $t('page.video.hide') : $t('page.video.show_more') %%
%%$t('page.video.suggested.most-popular-title')%%
%%$t('page.video.suggested.top-country-title', { country: $t('countries.' + browserLang )})%%
// tmp polyfill for Element.closest
if (!Element.prototype.matches) {
Element.prototype.matches =
Element.prototype.msMatchesSelector ||
Element.prototype.webkitMatchesSelector;
}
if (!Element.prototype.closest) {
Element.prototype.closest = function(s) {
var el = this;
do {
if (Element.prototype.matches.call(el, s)) return el;
el = el.parentElement || el.parentNode;
} while (el !== null && el.nodeType === 1);
return null;
};
}
var noTricks = hommy.ua.browser.name === 'IE' ||
hommy.ua.browser.name === 'Firefox' ||
hommy.ua.browser.name === 'Safari';
var skipPop = false/* (hommy.ua.is === 'mobile' && hommy.isPCO) */;
var isIOS = (/iPad|iPhone|iPod/.test(navigator.platform) || (navigator.platform === 'MacIntel' && navigator.maxTouchPoints > 1)) && !window.MSStream;
if (isIOS) hommy.ua.isMobile = true;
if (!skipPop && !isMz && !admPop) {
var bindSel = ['.jwplayer', '[aria-label="Play"]', '.jw-icon', '.jw-reset', '.jw-video', '.item-video'];
var ignSel = [
'.nopop',
'#und_ban',
'#ntv_a',
'#ntv_b',
'#ntv_c',
'#iv_1',
'.__nat_item'
];
if (hommy.ua.isChrome || hommy.isPCO || seekIsActive) {
ignSel = ignSel.concat([
'.jwplayer',
'.jw-svg-icon',
'.jw-icon',
'.jw-icon-inline',
'.oImef',
'.jw-slider-container',
'.int_hsSJlay',
'.jw-skip',
'.jw-controls',
'.jw-controlbar'
]);
}
hommy.videoAutoplayed = false;
var autoplayAfterPop = hommy.localStore.get('atppop') === '1';
if (autoplayAfterPop) {
hommy.videoAutoplayed = true;
hommy.localStore.add('atppop', 0);
var waitPlayer = setInterval(function () {
if (window.pl3748) {
setTimeout(function () { // If it works don't touch
pl3748.setVolume(0);
pl3748.play(true);
}, 1500);
clearInterval(waitPlayer)
}
}, 500);
}
// prevent pop after donny play
var playerStarted = false;
var waitPlayer2 = setInterval(function () {
if (window.pl3748) {
pl3748.on('all', function catchPlay(ev) {
if ((ev === 'adLoaded' || ev === 'play') && !playerStarted) {
playerStarted = true
pl3748.off('all', catchPlay)
}
})
clearInterval(waitPlayer2)
}
}, 500);
if (hommy.isCWL && !hommy.isPCO && !seekIsActive) {
bindSel = ['.jwplayer', '[aria-label="Play"]', '.jw-icon', '.jw-reset', '.jw-video', '.int_hsSJlay', '.item-video'];
ignSel = [];
}
/* if ((hommy.qs.promo === '31134' || hommy.isPCO) && hommy.ua.is === 'mobile') {
bindSel = ['.item-video'];
ignSel = [];
} */
hommy('popunder', {
//zoneType: hommy.qs.promo === '31134' ? 'exoclick' : undefined,
excludeTDS: hommy.qs.promo === '31134',
interstitial: !(hommy.qs.promo === '31134' || hommy.isBravo || hommy.isPCO || hommy.isComWeb || hommy.isMTC),
proceedSSPResponse: function(resp) {
if (!resp) return true;
if (!resp.interstitial && !hommy.qs.postest) return true;
hommy.postitial.run({
frameSrc: resp.url,
countClicks: 1,
scrolling: true,
bindTo: bindSel,
ignoreTo: ignSel,
cookieExpires: 240,
shouldFire: function() {
if (hommy.qs.promo === '31134' || hommy.isBravo || hommy.isPCO || hommy.isComWeb || hommy.isMTC) return false;
return true;
}
});
return false;
},
config: {
bindTo: bindSel,
ignoreTo: ignSel,
mode: {
newTab: true /* adver.isBravo || adver.ua.isMobile || ((adver.ua.isChrome || adver.isChrome) && adver.isPCO) || (location.search.indexOf('promo=10268') !== -1 && !noTricks) */,
under: true
},
limit: { maxHits: (hommy.qs.promo === '31134' || hommy.isBravo || hommy.isPCO || hommy.isMTC) ? 1 : 999999, perTime: 1440 }
},
popOpts: { storeName: 'ca_pop', nextHitTime: 3 },
shouldFire: function (element, opts) {
if (playerStarted && !element.closest('.item-video')) {
return false;
}
if (
(hommy.isBravo || hommy.qs.promo === '31134')
&& (hommy.qs.imrel === '1' || !!document.referrer && document.referrer.indexOf(location.origin) !== 0)
&& element
&& (element.className.indexOf('jw-video') > -1 || element.className.indexOf('jw-icon') > -1 || element.className.indexOf('jw-icon-display') > -1)
) {
hommy.localStore.add('atppop', 1);
}
return true;
},
fuckGhostery: !!document.getElementById('ghostery-tracker-tally'),
safeCreatives: hommy.qs.promo === '31134',
resetAll: (hommy.isCWL && document.referrer && !(document.referrer.indexOf(location.origin) === 0)) ||
document.referrer.indexOf('promo=') !== -1 && location.href.indexOf('fr=') !== -1
});
}
if (isMz && !admPop) {
var mzIgnore = hommy.ua.is === 'desktop' && !isIOS ? [
'.jw-controlbar',
'.poper',
'a[target=_blank]',
'form',
'input',
'.footer-row'
] : [
'.jwplayer',
'.jw-svg-icon',
'.jw-icon',
'.jw-icon-inline',
'.oImef',
'.jw-slider-container',
'.int_hsSJlay',
'.jw-skip',
'.jw-controls',
'.jw-controlbar',
'#int_hsSJ',
'.header__container',
'form',
'input',
'a[target=_blank]',
'.poper',
'#blm-block_wrapper',
'.banner',
'.filter',
'.underplayer__controllers',
'.pagination',
'.mobile-dropdown__link',
'.subscribe',
'.toggle-button'
];
hommy('popunder', {
popOpts: {
bindTo: ['*'],
ignoreTo: mzIgnore,
mode: {
newTab: hommy.ua.is !== 'desktop' || isIOS,
under: true
},
perpage: 999999,
nextHitTime: 0.001
},
beforeOpen: function() {
hommy.localStore.delete('TCPOP');
}
});
if (hommy.ua.is !== 'desktop' || isIOS) {
hommy('popunder', {
popOpts: {
storeName: 'mz-player-mobile',
bindTo: [
'.jwplayer',
'.jw-svg-icon',
'.jw-icon',
'.jw-icon-inline',
'.jw-reset',
'.oImef',
'.jw-slider-container',
'.int_hsSJlay',
'.jw-skip',
'.jw-controls',
'.jw-controlbar',
'#int_hsSJ'
],
ignoreTo: [],
mode: {
newTab: true,
under: true
},
nextHitTime: 10
}
});
}
}