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

Get ready for the upcoming Call of Duty: Modern Warfare Early Access Open Beta on PS4!

Activision has announced that PlayStation 4 players that have pre-ordered Call of Duty: Modern Warfare will be able to start pre-loading the Open Beta to play in Early Access starting between 10-11AM PDT on Tuesday, September 10.

The Early Access Open Beta is set to go live on September 12 at 10AM PT.

How to Pre-Load on PS4 for pre-orders:

Digital Pre-Orders:

Players who pre-ordered Call of Duty: Modern Warfare Digitally can find the Open Beta file on the PlayStation 4 store by searching for Modern Warfare once its live for pre-load. Once there, there will be an option to download and load the beta ahead of its start. If you’re not near your console, you can use the link HERE to pre-load the beta remotely.

Retailer Pre-Orders:

For players who pre-ordered the game at a retailer and redeemed a code on the Call of Duty website, codes will be emailed out and available on the website at some point during the day on Sept. 10.

For those who may not have received their emails, you can check the Call of Duty website HERE (starting between 10AM PT and 11AM PT) to get your code.

Pre-loading for Xbox One and PC players will be available starting next week.

FROM ACTIVISION BLOG:

Retail Pre-Order Players

Accessing Your Beta Code: Check the email of the address that’s attached to your Call of Duty account.If you don’t see this email in your inbox, check your SPAM/Junk folder.If you find the Beta Codes email in either of these folders, make sure you mark these emails as “Not Spam” so you can continue to receive important messages from Call of Duty. Head to the callofduty.com/redeem and login with your COD account.If you don’t find the email in either place, or your beta code on the redemption site reach out to Player Support.

Downloading the Beta (PS4): Once you’ve received your Beta Code, go to the PlayStation® StoreSelect ‘Redeem Codes’Enter your Beta Code and the download will begin!

Downloading the Beta (Xbox One): Once you’ve received your Beta Code, go to the Microsoft Store.Select ‘Use a Code’.Enter your Beta Code and the download will begin!

Downloading the Beta (PC Dark Edition: Battle.net)

Once you’ve received your Beta Code, log in to Battle.net. Visit ‘Account Settings’. Select the ‘Games & Codes’ tab then ‘Code Redemption’. Enter your Beta Code and the download will begin!

Digital Pre-Order Players

Beta Code is Not Needed: If you pre-ordered Modern Warfare digitally, you are automatically ready to download the Beta. Look for instructions regarding preloading availability, and then visit your platform’s store:

Downloading the Beta (PS4): Go to the PlayStation® Store, search for Modern Warfare, follow the prompts and install the Beta.

Downloading the Beta (Xbox One): Go to the Microsoft Store, look for Modern Warfare, following the prompts to download the Beta, and you’re set!

Downloading the Beta (PC: Battle.net)

Log in to Battle.net. Head to the Modern Warfare page and install the Beta.    

It’s almost time to get into the Open Beta. Stay tuned for the latest information.

SOURCE: Activision Blog

comments below