redacao@auroracultural.com
(function () { 'use strict';if (window.__auroraVideoPopupBooted) { return; } window.__auroraVideoPopupBooted = true;/* ========================================= CONFIGURAÇÕES ========================================= */var VIDEO_AD_UNIT = '/23345120929/videoowall/videoowall'; var IMA_SDK_URL = 'https://imasdk.googleapis.com/js/sdkloader/ima3.js'; var PLAYER_ID = 'aurora-video-popup';var POPUP_DELAY = 4000; // tempo mínimo de espera antes de revelar (ms) — altere para 3000, etc. var MAX_WAIT_MS = 15000; // se o anúncio não ficar pronto até aqui, desiste silenciosamente (ms) var MAX_WIDTH = 336; // tamanho máximo do popup, em px (quadrado) var MARGIN = 20; // distância das bordas da tela, em pxvar isDebugMode = /(?:^|[?&])aurora_debug=1(?:&|$)/.test(window.location.search); if (isDebugMode) { POPUP_DELAY = 200; }/* ========================================= ESTADO ========================================= */var hasRequested = false; var isDone = false; // true assim que o ciclo de vida terminou, por qualquer motivo var isReady = false; // true quando o AdsManager está pronto para exibir (autoplay ou manual) var delayElapsed = false; var isRevealed = false;var adsLoader = null; var adsManager = null; var adDisplayContainer = null;var videoElement = null; var adContainer = null; var wrapper = null; var muteButton = null;var revealTimer = null; var maxWaitTimer = null;var prefersReducedMotion = !!( window.matchMedia && window.matchMedia('(prefers-reduced-motion: reduce)').matches );/* ========================================= LOG DE DIAGNÓSTICO ========================================= */function logVideo(message, color) { if (!window.console || !console.log) return; console.log( '%c Aurora Video Popup %c ' + message + ' ', 'background:#263238;color:#fff;font-weight:bold;padding:4px 8px;', 'background:' + (color || '#607d8b') + ';color:#fff;padding:4px 8px;' ); }/* ========================================= CRIAR POPUP (fica invisível até o anúncio estar pronto) ========================================= */function buildPopupDom() { if (document.getElementById(PLAYER_ID)) { return null; }wrapper = document.createElement('section'); wrapper.id = PLAYER_ID; wrapper.setAttribute('role', 'complementary'); wrapper.setAttribute('aria-label', 'Publicidade em vídeo'); wrapper.setAttribute('aria-hidden', 'true'); wrapper.style.cssText = [ 'position:fixed', 'right:' + MARGIN + 'px', 'bottom:' + MARGIN + 'px', 'width:clamp(200px, calc(100vw - ' + (MARGIN * 2) + 'px), ' + MAX_WIDTH + 'px)', 'aspect-ratio:1/1', 'background:#111', 'z-index:2147483000', 'overflow:hidden', 'border-radius:8px', 'box-shadow:0 8px 30px rgba(0,0,0,.5)', 'box-sizing:border-box', 'isolation:isolate', 'visibility:hidden', 'opacity:0', 'pointer-events:none', 'transform:translateY(16px)', (prefersReducedMotion ? 'transition:none' : 'transition:opacity .35s ease, transform .35s ease') ].join(';');videoElement = document.createElement('video'); videoElement.id = PLAYER_ID + '-video'; videoElement.setAttribute('playsinline', ''); videoElement.setAttribute('webkit-playsinline', ''); videoElement.muted = true; videoElement.controls = false; videoElement.style.cssText = [ 'display:block', 'width:100%', 'height:100%', 'object-fit:cover', 'background:#111' ].join(';');adContainer = document.createElement('div'); adContainer.id = PLAYER_ID + '-ad-container'; adContainer.style.cssText = [ 'position:absolute', 'inset:0', 'width:100%', 'height:100%', 'z-index:2' ].join(';');var label = document.createElement('span'); label.textContent = 'Publicidade'; label.style.cssText = [ 'position:absolute', 'top:7px', 'left:8px', 'z-index:4', 'color:#fff', 'font:10px/1.2 Arial,sans-serif', 'background:rgba(0,0,0,.65)', 'padding:4px 6px', 'border-radius:3px' ].join(';');var closeButton = document.createElement('button'); closeButton.type = 'button'; closeButton.textContent = '×'; closeButton.setAttribute('aria-label', 'Fechar publicidade'); closeButton.style.cssText = [ 'position:absolute', 'top:6px', 'right:6px', 'z-index:5', 'width:28px', 'height:28px', 'border:0', 'border-radius:50%', 'background:rgba(0,0,0,.75)', 'color:#fff', 'font:22px/25px Arial,sans-serif', 'cursor:pointer' ].join(';'); closeButton.onclick = function () { finish('fechado_pelo_usuario'); };muteButton = document.createElement('button'); muteButton.type = 'button'; muteButton.textContent = 'Som desligado'; muteButton.setAttribute('aria-label', 'Ativar ou desativar o som'); muteButton.style.cssText = [ 'position:absolute', 'bottom:8px', 'right:8px', 'z-index:5', 'border:0', 'border-radius:4px', 'background:rgba(0,0,0,.75)', 'color:#fff', 'font:11px Arial,sans-serif', 'padding:7px 9px', 'cursor:pointer' ].join(';'); muteButton.onclick = toggleMute;wrapper.appendChild(videoElement); wrapper.appendChild(adContainer); wrapper.appendChild(label); wrapper.appendChild(closeButton); wrapper.appendChild(muteButton);document.body.appendChild(wrapper);return wrapper; }/* ========================================= ÁUDIO — controlado pelo AdsManager, não pelo