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

Last updated: October 5th, 2019.

It’s almost time for the release of Call of Duty: Modern Warfare. The latest Call of Duty game, from Infinity Ward and Activision, releases worldwide on October 25, 2019 on PlayStation 4, Xbox One, and PC.

Here’s a look at just some of the pre-order bonuses we have spotted from different retailers around the world:

  • Digital Purchases on PS4 Store, Xbox One Store, or Battle.net: Purchase Call of Duty®: Modern Warfare® on digital and receive the in-game XRK Weapons Pack for day 1 launch use. The XRK M4 assault rifle and XRK .357 handgun are built to be fast, accurate and hard hitting, giving you versatile options adaptable to any play style. Learn more about the XRK offer here.
  • Digital Pre-Orders on PlayStation 4 Store, Xbox Store, or Battle.net + Retailer pre-orders at majority of stores worldwide: Get a Prestige Token to use in Call of Duty: Black Ops 4 (Note: if you redeemed a code for the Call of Duty: Modern Warfare beta, you also already received access to Captain Price in Black Ops 4 Blackout mode).
  • GameStop US: Pre-order Modern Warfare (any edition) at GameStop US to get a bonus Call of Duty Endowment™ Calling Card in Call of Duty: Modern Warfare. GameStop will also donate a portion of the sales of Modern Warfare to the Endowment. Only at GameStop, get an exclusive GameStop C.O.D.E. Calling card with purchase of the game. For every copy sold, GameStop will donate to the Call of Duty Endowment, which helps find high quality jobs for unemployed veteran.
  • GAME UK: Get 2XP Bonus in Modern Warfare and a Captain Price figurine with pre-order
  • Amazon UK: Get the Captain Price Figurine with pre-order
  • Call of Duty: Modern Warfare “Precision” Edition: Exclusively available at GameStop in US, EB Games in Australia and Canada. More regions will have this edition exclusive to select retailers.

More information on the different editions of Call of Duty: Modern Warfare is available here.

Call of Duty: Modern Warfare is available on October 25, 2019.

comments below