var div = document.createElement("div");
var x = document.getElementById("video_insert_18044");
div.className = "thumb_video ONNJSPLAYER";
div.setAttribute('data-url', "https://player.libertatea.ro/ringiervideo/player8.php?vcategory=altele&width=100%25&stream=/uploads/tx_lsuvideo/ster.mp4&wsource=5&autostart=1&mute=0&title=Culi%C8%9B%C4%83%20Sterp%20s-a%20prezentat%20%C3%AEn%20instan%C8%9B%C4%83%20cu%20z%C3%A2mbetul%20pe%20buze%20%C8%99i%20i-a%20jignit%20pe%20jurnali%C8%99ti%2C%20dup%C4%83%20ce%20a%20provocat%20un%20accident%20rutier%3A%20%E2%80%9ENevast%C4%83-ta%20mai%20%C3%AEntreab%C4%83%20de%20mine%3F%E2%80%9D&image=https://videocms.ringier.ro/uploads/2022-11/lg-1aviva-42.png&mediaid=-1");
x.parentNode.insertBefore(div, x);
var el = document.querySelectorAll('.ONNJSPLAYER');
if (el !== null) {
el.forEach(function(vid) {
vid.setAttribute('data-size', '16:9');
vid.setAttribute('data-autoplay', '2');
vid.setAttribute('data-website', '3946');
vid.setAttribute('data-volume', '1');
vid.setAttribute('data-volumem', '1');
vid.setAttribute('data-mcdelay', '3');
vid.setAttribute('data-fiframe', '1');
vid.setAttribute('data-miniature', '0');
var vid_url = vid.getAttribute('data-url');
if (vid_url !== null) {
var player_url = vid_url + '&format=json';
var request = new XMLHttpRequest();
request.onreadystatechange = function() {
if(request.readyState === 4) {
if(request.status === 200) {
var result = JSON.parse(request.responseText);
vid.setAttribute('data-hlsfile', result.exhls);
vid.setAttribute('data-poster', result.exth);
vid.setAttribute('data-duration', Math.floor(result.exdur));
var mtitle = decodeURI(result.mtitle);
mtitle = mtitle.replace(/\+/g, ' ');
mtitle = mtitle.replace(/%2C/g, ', ');
vid.setAttribute('data-title', mtitle);
load_onnetwork_embed();
/* vid.removeAttribute('data-url'); */
}
}
}
request.open('Get', player_url);
request.send();
}
});
}
function getConsent() {
var has_consent = false;
if (typeof window.OnetrustActiveGroups !== 'undefined') {
var consentBrat = window.OnetrustActiveGroups;
var consent_2 = consentBrat.indexOf('C0002') !== -1;
var consent_7 = consentBrat.indexOf('C0007') !== -1;
var consent_8 = consentBrat.indexOf('C0008') !== -1;
var consent_9 = consentBrat.indexOf('C0009') !== -1;
var consent_11 = consentBrat.indexOf('C0011') !== -1;
if(consent_2 && consent_7 && consent_8 && consent_9 && consent_11) {
has_consent = true;
}
} else {
console.debug('window.OnetrustActiveGroups is undefined');
}
console.debug('has consent: ' + has_consent);
return has_consent;
}
function load_onnetwork_embed() {
var isLoaded = document.querySelectorAll('#onn-script-3946');
if (isLoaded.length > 0) {
return;
}
var s = document.createElement('script');
s.className = 'onnetwork-embed-script';
s.id = 'onn-script-3946';
s.type = 'text/javascript';
s.async = true;
s.setAttribute('src', 'https://video.onnetwork.tv/embed.php?ext=rinrom&onnwebsite=3946');
document.body.appendChild(s);
}