var CoviEmbedHtml =
'
' +
'
' +
' ' +
'
' +
'
' +
' ' +
' ' +
'
' +
'
' +
'
' +
'
' +
'';
var CoviNativeItemsMapping = {};
var CoviNativeElements = {
covi_player: {
className: 'covi_player',
},
covi_playback: {
className: 'covi_playback',
},
covi_playback_muteunmute: {
className: 'covi_playback_muteunmute',
eventFunc: 'onMuteUnmute',
},
'covi_playback_mute-img': {
className: 'covi_playback_mute-img',
src: 'mute_30x29.png',
},
'covi_playback_unmute-img': {
className: 'covi_playback_unmute-img',
src: 'unmute_28x28.png',
},
covi_playback_bi: {
className: 'covi_playback_bi',
eventFunc: 'onCoviBi',
},
'covi_playback_bi-img': {
className: 'covi_playback_bi-img',
src: 'covi_bi.svg',
},
covi_playback_replay: {
className: 'covi_playback_replay',
eventFunc: 'onReplay',
},
'covi_playback_replay-img': {
className: 'covi_playback_replay-img',
src: 'replay_72x72.png',
},
};
var CoviIndex = 0;
var CoviPlayers = new Array();
function createCoviMain() {
var coviElem = document.getElementsByClassName('covi')[CoviIndex];
if (!coviElem) {
return;
}
coviElem.setAttribute('covi-index', CoviIndex);
var coviOpts = {
containerClassName: 'covi,' + CoviIndex,
style: 'kwnews_article_m',
type: 'prod',
pcode: 'kwnews_article_m',
category: 'news_kwnews',
videoPlayType: 'autoplay',
gender: '',
age: '',
idx: CoviIndex,
rootElem: coviElem,
// certVendor: 'ias',
};
var coviEventHandler = function (event) {
switch (event) {
case 'PLAYER_VIDEO_PLAY':
break;
case 'PLAYER_VIDEO_PAUSE':
break;
case 'PLAYER_VIDEO_ENDED':
break;
case 'PLAYER_NO_ADS':
console.log('[covi] no ads');
coviElem.style.display = 'block';
coviElem.style.textAlign = 'center';
coviElem.style.width = '100%';
coviElem.style.height = '100%';
coviElem.style.backgroundColor = '#fff';
var elem = document.createElement('script');
elem.src = 'https://compass.adop.cc/assets/js/adop/adopJ.js?v=14';
coviElem.appendChild(elem);
elem = document.createElement('ins');
elem.className = 'adsbyadop';
elem.setAttribute('_adop_zon', 'e1582678-cae4-4590-9b71-cc9065b1ab1b');
elem.setAttribute('_adop_type', 're');
elem.setAttribute('_page_url', '');
elem.style.display = 'inline-block';
elem.style.width = '336px';
elem.style.height = '280px';
coviElem.appendChild(elem);
break;
}
};
var coviplayer = new CoviPlayer(coviOpts, coviEventHandler);
coviplayer.run();
CoviPlayers[CoviIndex] = coviplayer;
++CoviIndex;
}
function coviClickLandingButton(coviIndex) {
var coviplayer = CoviPlayers[coviIndex];
if (coviplayer) {
var landingUrl;
coviplayer.onClickLandingButton(function (url) {
landingUrl = url;
}, true);
var timer = window.setInterval(function () {
if (landingUrl !== 'undefined') {
window.clearInterval(timer);
var coviPopup = window.open(landingUrl, '_blank');
}
}, 200);
}
}
function createCovi() {
window.setTimeout(function () {
createCoviMain();
}, 500);
}
function checkCoviTag() {
var elem = document.querySelector('.covi');
if (elem) {
createCovi();
}
}
function coviAdClose() {
var coviElem = document.getElementsByClassName('covi')[0];
if (!coviElem) {
return;
}
var parent = coviElem.parentElement;
parent.removeChild(coviElem);
}
checkCoviTag();