var div = document.createElement("div"); var x = document.getElementById("video_insert_21807"); div.className = "thumb_video ONNJSPLAYER"; div.setAttribute('data-url', "https://player.libertatea.ro/ringiervideo/player8.php?vcategory=fresh_by_unica&width=100%25&stream=/uploads/tx_lsuvideo/andreea-balan-cut-9.mp4&wsource=1&autostart=1&mute=0&title=Andreea%20B%C4%83lan%20le%20d%C4%83%20replica%20celor%20care%20critic%C4%83%20diferen%C8%9Ba%20de%20v%C3%A2rst%C4%83%20dintre%20ea%20%C8%99i%20Victor%20Cornea%3A%20%E2%80%9EAvem%20empatie%20pentru%20nefericirea%20lor%E2%80%9D%20%2F%20Exclusiv&image=https://videocms.ringier.ro/uploads/2024-07/lg-andreea-balan-cut-9-frame-at-0m1s.jpg&mediaid=-1"); x.parentNode.insertBefore(div, x); let enable_debug = true; 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', '3938'); 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); //vid.removeAttribute('data-url'); } } } request.open('Get', player_url); request.send(); } }); var count = 0; var consentCheck = setInterval(function() { count += 1; if (count === 60) { clearInterval(consentCheck); } if (typeof window.__tcfapi !== 'undefined') { clearInterval(consentCheck); consoleDebug('=RRO=== CMP config: tcfapi is ready'); getConsent(); } count++; }, 10); } function getConsent() { var has_consent = false; if (typeof window.OnetrustActiveGroups !== 'undefined') { consoleDebug('has consent: ' + window.OnetrustActiveGroups); 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) { load_onnetwork_embed(); } } else { consoleDebug('window.OnetrustActiveGroups is undefined'); } } function load_onnetwork_embed() { var isLoaded = document.querySelectorAll('.onnetwork-embed-script'); if (isLoaded.length > 0) { return; } var s = document.createElement('script'); s.className = 'onnetwork-embed-script'; s.type = 'text/javascript'; s.async = true; s.setAttribute('src', 'https://video.onnetwork.tv/embed.php?ext=rinrom&onnwebsite=3938'); document.body.appendChild(s); } function consoleDebug() { if (enable_debug) { if (!console || !console.debug) { return; } const var_args = Array.prototype.slice.call(arguments, 0); var_args.unshift('[VideoCMS]'); console.debug.apply(console, var_args); } }