// initialize jwplayer var playerInstance = jwplayer('player'); // player dom elements var playerContainerEl = document.querySelector('.player-container'); // returns video player position from top of document function getElementOffsetTop(el) { var boundingClientRect = el.getBoundingClientRect(); var bodyEl = document.body; var docEl = document.documentElement; var scrollTop = window.pageYOffset || docEl.scrollTop || bodyEl.scrollTop; var clientTop = docEl.clientTop || bodyEl.clientTop || 0; return Math.round(boundingClientRect.top + scrollTop - clientTop); } // returns the current y scroll position function getScrollTop() { var docEl = document.documentElement; return (window.pageYOffset || docEl.scrollTop) - (docEl.clientTop || 0); } // configure jwplayer instance playerInstance.setup({ autostart: true, playlist: 'https://cdn.jwplayer.com/v2/playlists/mYdavspX', primary: 'html5', setFullscreen: true, width: '100%' }); // when jwplayer instance is ready playerInstance.on('ready', function() { var config = playerInstance.getConfig(); var utils = playerInstance.utils; // get height of player element var playerHeight = config.containerHeight; // flag determining whether close has been clicked var closed = true; // CHANGED // flag determing whether player is playing var playing = false; // ADDED // eventhandler for when close button is being pressed document.getElementsByClassName('icon-close')[0].addEventListener('click', () => { closed = true; onScrollViewHandler(); }); playerInstance.on('play', function() { closed = false; playing = true; // ADDED }).on('pause', function () { playing = false; // ADDED }).on('adPlay', function() { closed = false; // ADDED playing = true; // ADDED }).on('adPause', function() { playing = false; // ADDED }); // get player element position from top of document var playerOffsetTop = getElementOffsetTop(playerContainerEl); // set player container to match height of actual video element playerContainerEl.style.height = playerHeight + 'px'; // below we handle window scroll event without killing performance function onScrollViewHandler() { var minimized = getScrollTop() >= playerOffsetTop; if (closed && minimized) { minimized = false; jwplayer().pause(); playing = false; // ADDED } else if (!minimized && !playing) { closed = true; // ADDED } utils.toggleClass(playerContainerEl, 'player-minimize', minimized); // update the player's size so the controls are adjusted playerInstance.resize(); } // namespace for whether or not we are waiting for setTimeout() to finish var isScrollTimeout = false; // window onscroll event handler window.onscroll = function() { // skip if we're waiting on a scroll update timeout to finish if (isScrollTimeout) return; // flag that a new timeout will begin isScrollTimeout = true; // otherwise, call scroll event view handler onScrollViewHandler(); // set new timeout setTimeout(function() { // reset timeout flag to false (no longer waiting) isScrollTimeout = false; }, 80); }; });

Totino’s has announced a partnership with Activision to celebrate the upcoming Call of Duty: Modern Warfare.

This deal will see specially marked packages of Totinos Pizza Rolls with Call of Duty: Modern Warfare logo. There will be bonus in game content provided with those who purchase the marked package. The in-game items in Modern Warfare were designed hand in hand with 100 Thieves’ CEO Matthew “Nadeshot” Hagg. Totinos is a sponsor of 100 Thieves.

Totino’s proudly teams up with the celebrated Call of Duty franchise, in advance of the highly anticipated Call of Duty: Modern Warfare launch.  As part of the collaboration, consumers can unlock Call of Duty items inside Modern Warfare with the purchase of participating products, including Totino’s Pizza Rolls, Mini Snack Bites and Multi-Pack Party Pizza, by entering unique codes found on the packaging.

The pizza rolls will also include Double XP codes when bought exclusively at Walmart.

To celebrate this collaboration, Totino’s worked with Matthew “Nadeshot” Haag, Founder & CEO of 100 Thieves, to co-design the in-game content. Matt gained success through playing Call of Duty over the years and is one of the most decorated esports athletes in video game history. Consumers can now redeem a calling card with the purchase of one participating Totino’s product, a watch with the purchase of two products, and a charm with the purchase of three. In addition, consumers who purchase product exclusively at Walmart will receive a 2XP boost in the game. All codes can be redeemed at www.callofduty.com/totinos.

As a long-standing partner in the esports community, it was a no-brainer to team up with Activision ahead of the highly anticipated Call of Duty: Modern Warfare release,” shares Justin Conzemius, director of marketing for Totino’s. “We had a blast working with Nadeshot to design unique in-game content that reflects his personal style, and allows us as a brand to really level up the gaming experience for players and fans.”

Nadeshot adds, “I’m so excited to finally reveal that I’ve partnered with Totino’s to co-design exclusive in-game content for the new Call of Duty: Modern Warfare. Call of Duty has a special place in my heart, so I was thrilled for this opportunity. Totino’s has been an incredible partner to 100 Thieves over the past year and I am excited to share this in-game content with my fans.”

We are thrilled to be teamed up with Totino’s for the upcoming launch of Call of Duty: Modern Warfare,” says Ander Nickell, Head of Global Partnerships, Activision. “We are excited to take our collaboration to the next level with in-game rewards that can be redeemed with codes on Totino’s products, that we know will resonate with Call of Duty gamers.”

Participating Totino’s products with Call of Duty: Modern Warfare codes will hit shelves mid-October at select retail locations.

SOURCE: PRNewsWire

comments below