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

The Call of Duty: Modern Warfare 2v2 Open PS4 Alpha has officially come to an end. Players on PS4 were able to try out the 2v2 Gunfight mode for the very first time.

Looking ahead, the Call of Duty: Modern Warfare Open Beta is coming up. We’ve got a post here highlighting all of the big pieces of information regarding the beta, and we’ll keep you updated as more information is shared.

Infinity Ward posted on Reddit a recap of this weekend’s Gunfight and a preview of what’s to come with the Open Beta.

From Infinity Ward:

On behalf of everyone at the studio, thank you for participating in the 2v2 Gunfight Open Alpha. From sharing your gameplay highlights with us to finding humor in our “proper English welcome”, it was truly inspiring for us to see so many 2v2 matches out in the wild.

Your feedback and suggestions have been incredibly valuable to us and have already contributed to creating a better game experience for everyone as we sprint toward the Beta next month and the full game launch on October 25th. So again, thank you!

If you’d like to see some of the feedback we’ve addressed along with other updates, check out our Day Two and Day Three recap posts here on Reddit.

Now. Let’s Talk Beta.

Post image

Coming up in September, you’ll have the opportunity to participate in one of the most important testing periods for our game. As we’ve mentioned, the 2v2 Gunfight Alpha was only a sliver of what’s to come and the Beta will be another chance for us to show you more of what Modern Warfare multiplayer has to offer.

Which means you probably have a lot of questions.

Before Weekend 1 of the Beta kicks off on September 12th, we’ll be sharing information about what you can expect to see when you hop online, including maps, modes, customization options, weapons, Operators, and much, much more. But it won’t stop there. Just like the Alpha, we’ll be online with you providing daily updates during both Beta weekends, so make sure you follow @InfinityWard on Twitter and check back here so you don’t miss any important intel.

Want to know how you can your hands on the Call of Duty: Modern Warfare Beta? Click HERE to get all the details!

And again, everyone at Infinity Ward,

THANK YOU!

SOURCE: Reddit

comments below