getElementById('jwplayerContainerOuter') if (!$jwplayerContainerOuter) { return } const rect = $jwplayerContainerOuter.getBoundingClientRect() // if no change to stickiness if (jwpState.isSticky === (rect.top < -50) ? `${$jwplayerContainerOuter.offsetHeight}px` : 'auto' // set video container stickiness setJwplayerStickiness(rect.
top < -50) if (jwpState.isSticky) { pushToDataLayer({ event: 'player_jwcall_attempt', }) const pre1 = 'https://as-sec.casalemedia.com/playlist?ix_id=[index_epr] if (!$jwplayerContainerOuter) { return } width = width || $jwplayerContainerOuter.offsetWidth // assume 16:9 aspect ratio const height = width * (9 / 16) jwpState.
jwpHandler.resize(width, height) } function closeJwplayer () { return (jwpState.isSticky) ? 'resized' : 'fullsize' } function setJwPlayerPosition () { if (!jwpState.allowSticky) { return } const $jwplayerContainerOuter = document.getElementById('jwplayerContainerOuter') if (!$jwplayerContainerOuter) { return } const rect = $jwplayerContainerOuter.
getBoundingClientRect() // if no change to stickiness if (jwpState.isSticky === (rect.top < -50)) { return } window.dataLayer = window.dataLayer || [] jwpState.jwpHandler = window.jwplayer('jw-player') pushToDataLayer({ event: 'player_jwcall_attempt', }) const pre1 = 'https://as-sec.casalemedia.com/playlist?ix_id=[index_epr] (9 / 16) jwpState.
jwpHandler.resize(width, height) } function closeJwplayer () { // move video back to inside article content setJwplayerStickiness(false) jwpState.allowSticky = false jwpState.jwpHandler.setMute(true) // resize player to match content width resizeJwPlayer() // if ad has finished playing, then pause video if closed when sticky } function setJwPlayerPosition () { if (!jwpState.
allowSticky) { return } $jwplayerContainerOuter.style.height = (rect.top < -50)) { return } window.dataLayer = window.dataLayer || [] jwpState.jwpHandler = window.jwplayer('jw-player') pushToDataLayer({ event: 'player_jwcall_attempt', }) const pre1 = 'https://as-sec.casalemedia.com/playlist?ix_id=[index_epr] if (!$jwplayerContainerOuter) { return } if (isSticky) { $jwplayerContainer.
classList.add('jwplayer__container--sticky') } else { // resize player to be fixed player width resizeJwPlayer(300) } else { $jwplayerContainer.classList.remove('jwplayer__container--sticky') } } function setJwplayerStickiness (isSticky) { jwpState.isSticky = isSticky const $jwplayerContainer = document.
getElementById('jwplayerContainer') if (!$jwplayerContainer) { return } if (isSticky) { $jwplayerContainer.classList.add('jwplayer__container--sticky') } else { $jwplayerContainer.classList.remove('jwplayer__container--sticky') } } function showJwplayer () { return } width = width || $jwplayerContainerOuter.
offsetWidth // assume 16:9 aspect ratio const height = width * (9 / 16) jwpState.jwpHandler.resize(width, height) } function closeJwplayer () { return (jwpState.isSticky) ? 'resized' : 'fullsize' } function showJwplayer () { return } const rect = $jwplayerContainerOuter.getBoundingClientRect() // if no change to stickiness if (jwpState.
isSticky === (rect.top < -50) ? `${$jwplayerContainerOuter.offsetHeight}px` : 'auto' // set video container stickiness setJwplayerStickiness(rect.top < -50) if (jwpState.isSticky) { pushToDataLayer({ event: 'player_resize', }) // resize player to be fixed player width resizeJwPlayer(300) } else { $jwplayerContainer.
classList.remove('jwplayer__container--sticky') } } function setJwplayerStickiness (isSticky) { jwpState.isSticky = isSticky const $jwplayerContainer = document.getElementById('jwplayerContainer') if (!$jwplayerContainer) { return (!isMobile()) } function pushToDataLayer ({ event, message, tag, size }) { window.
dataLayer.push({ 'event': event || '', 'message': message || '', 'message': message || '', }) } function getJwplayerSize () { return (jwpState.isSticky) ? 'resized' : 'fullsize' } function setJwplayerStickiness (isSticky) { jwpState.isSticky = isSticky const $jwplayerContainer = document.getElementById('jwplayerContainer') if (!$jwplayerContainer) { return } if (isSticky) { $jwplayerContainer.
classList.add('jwplayer__container--sticky') } else { // resize player to match content width resizeJwPlayer() } } function resizeJwPlayer (width) { const $jwplayerContainerOuter = document.getElementById('jwplayerContainerOuter') if (!$jwplayerContainerOuter) { return } width = width || $jwplayerContainerOuter.
offsetWidth // assume 16:9 aspect ratio const height = width * (9 / 16) jwpState.jwpHandler.resize(width, height) } function closeJwplayer () { return (jwpState.isSticky) ? 'resized' : 'fullsize' } function setJwplayerStickiness (isSticky) { jwpState.isSticky = isSticky const $jwplayerContainer = document.
getElementById('jwplayerContainer') if (!$jwplayerContainer) { return } if (isSticky) { $jwplayerContainer.classList.add('jwplayer__container--sticky') } else { // resize player to be fixed player width resizeJwPlayer(300) } else { // resize player to be fixed player width resizeJwPlayer(300) } else { // resize player to be fixed player width resizeJwPlayer(300) } else { // resize player to match content width resizeJwPlayer() } } document.
addEventListener('DOMContentLoaded', (e) => { const player = document.getElementById('jwplayer-section'); const cat = window.dataLayer[0].category.toLowerCase().replace(/[^a-zA-Z0-9]/g, ""); const scat = window.dataLayer[0].subcategory.toLowerCase().replace(/[^a-zA-Z0-9]/g, ""); const art = window.
dataLayer[0].article_id; if (!showJwplayer()) { player.style.display = 'none' return } window.dataLayer = window.dataLayer || [] jwpState.jwpHandler = window.jwplayer('jw-player') pushToDataLayer({ event: 'player_jwcall_attempt', }) const pre1 = 'https://as-sec.casalemedia.com/playlist?ix_id=[index_epr] setJwplayerStickiness(false) jwpState.
allowSticky = false jwpState.jwpHandler.setMute(true) // resize player to match content width resizeJwPlayer() // if ad has finished playing, then pause video if closed when sticky } function showJwplayer () { return } width = width || $jwplayerContainerOuter.offsetWidth // assume 16:9 aspect ratio const height = width * (9 / 16) jwpState.
jwpHandler.resize(width, height) } function closeJwplayer () { // move video back to inside article content setJwplayerStickiness(false) jwpState.allowSticky = false jwpState.jwpHandler.setMute(true) // resize player to match content width resizeJwPlayer() // if ad has finished playing, then pause video if (jwpState.
adCompleted || !jwpState.adRequest) { jwpState.jwpHandler.pause() } else { // queue up pause event for when ad has completed jwpState.needToPause = true } } document.addEventListener('DOMContentLoaded', (e) => { const player = document.getElementById('jwplayer-section'); const cat = window.dataLayer[0].
category.toLowerCase().replace(/[^a-zA-Z0-9]/g, ""); const scat = window.dataLayer[0].subcategory.toLowerCase().replace(/[^a-zA-Z0-9]/g, ""); const art = window.dataLayer[0].article_id; if (!showJwplayer()) { player.style.display = 'none' return } $jwplayerContainerOuter.style.height = (rect.top < -50) ? `${$jwplayerContainerOuter.
offsetHeight}px` : 'auto' // set video container stickiness setJwplayerStickiness(rect.top < -50) if
TERVIRAL