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

Activision Publishing has announced that Call of Duty: Modern Warfare is the most played Call of Duty game in this console generation, beating out Black Ops 3, WWII, and more to be the #1 Call of Duty game since 2012.

Activision’s Call of Duty®: Modern Warfare® continues to drive momentum delivering new highs in multiplayer engagement within the franchise for this console generation. Modern Warfare has outpaced all previous Call of Duty multiplayer experiences of this generation in hours played, hours per player and average daily players on its way to becoming the most played Call of Duty multiplayer in the first 50 days since launch in six years.

Activision also confirmed that Modern Warfare has passed $1 billion in worldwide sell through through the end of November 2019 and is the best selling premium game of 2019. There has been over 500 million hours played and over 300 million MP matches played thus far.

The award-winning title, which has sold more than $1 billion in sell-through worldwide, has surpassed 500 million multiplayer hours played since release with nearly 300 million multiplayer matches. Upon release, the title featured a series of firsts for Call of Duty, including crossplay and cross-progression support, as well as the removal of Season Pass and delivery of new post-release content coming free to all players on all platforms.

“The momentum for Modern Warfare from day one has been incredible. Players are having a great time and are continuing to engage across the multiplayer experience at the highest level in years. We’re also seeing new franchise highs for this console generation in hours played, hours per player and average daily players,” said Byron Beede, executive vice president and general manager for Call of Duty, Activision. “It’s great to see the fan response to the hard work from our development teams led by Infinity Ward. Players are having a great time, and there’s much more to come as we continue to deliver new content.”

Activision re-highlighted that brand new content is coming to the game today, including new MP maps and modes.

“We’re bringing our players together to play across all platforms and that continues today with a new wave of content coming to everyone for free,” said Patrick Kelly, co-studio head and creative director for developer Infinity Ward. “Starting today Vacant and Shipment are in full multiplayer rotation. Players can also jump into new Gunfight maps, play a new Special Ops mission and play fun new modes, starting with Cranked.”

Call of Duty: Modern Warfare Season One featuring the new Battle Pass as well as the largest free content offering in Call of Duty history continues today with the release of the following to all players for free:

  • Two new multiplayer maps: Vacant, Shipment
  • Two Gunfight maps
  • New Special Ops missions
  • New, multiplayer game mode

Stay tuned for the new update.

comments below