// 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); }; });

Burger King® has announced a partnership with Activision for the launch of Call of Duty: Modern Warfare.

The partnership was first teased during a tweet from Burger King on October 23, but the company has issued a press release detailing the collaboration in partnership with Grubhub.

Today only, in Los Angeles location only, one Burger King restaurant has been transformed into “Burger Town.” There will be the King of Burgers and King of Call of Duty (Scump and FaZe Apex) playing Call of Duty: Modern Warfare at the store all day on October 24. If you beat the team, you can win 15 years of free WHOOPERS from Burger King.

Today only, one Burger King restaurant in Los Angeles will transform into a real-life version of the Call of Duty Burger Town restaurant. Within the restaurant, guests will find a gaming hub set up by Activision for visitors to play the new Call of Duty: Modern Warfare game. The King of Burgers and the Kings of Call of Duty defend their throne of Burger Town and welcome guests that are up for a challenge. Challengers are invited to play Modern Warfare against the King and professional Call of Duty playersScump and FaZe Apex for a chance to win free WHOPPER® sandwiches for 15 years*. For more information, visit Facebook.com/BurgerKing. The restaurant is located at 2955 North Bellflower Boulevard in Long Beach, CA. The event will take place from 3-7pm local time.

In addition, they’ve announced a collaboration with Grubhub for limited bonus in game content. In 16 cities only, you will see “Burger Town presented by Burger King” on the app if your local store in one of 16 cities is participating. With this, you will get a Call of Duty themed order, alongside bonus in game content. Country wide, if you order on Grubhub a Call of Duty themed meal, you will just get Call of Duty packaging – not the in-game content.

For those not in the Los Angeles area, Grubhub is promoting select Burger King restaurants on its app today in 16 cities only* as “Burger Town presented by Burger King” restaurants. The rebranded “Burger Town” menu will include Call of Duty themed BK® Meals with the opportunity to get a code to unlock bonus in game content. The Burger Town menu will be available exclusively via Grubhub delivery. Guests nationwide can also order a Call of Duty themed BK Meal from their local BK restaurant on Grubhub.

To get your Call of Duty: Modern Warfare bonus codes, simply place Grubhub delivery orders from Burger King or “Burger Town” locations and use code ‘BKCALLOFDUTY’ at checkout. For the first qualifying delivery purchase, guests will receive a code to unlock a bonus in-game “Burger Town Emblem.” On the second delivery purchase, guests will receive a code to unlock a “Burger Town Calling Card.” On the third delivery purchase, guests will receive a code to unlock the “Burger Town Bubby Weapon Charm.” From 10/24 through 11/6, Grubhub diners will also qualify for free delivery on an order over $10 from BK and “Burger Town” locations (no promo code needed).** To order, download Grubhub on on iOS or Android phones.

SOURCE: BusinessWire

comments below