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

Yes, it’s finally a thing!

Call of Duty: Modern Warfare uses a brand new engine, the first time for Call of Duty in a long time.

Call of Duty: Modern Warfare features a new engine delivering an immersive and photo-realistic experience. The new technology utilizes the latest advancements in visual engineering, including a physically-based material system allowing for state of the art photogrammetry, a new hybrid tile based streaming system, new PBR decal rendering system, world volumetric lighting, 4K HDR, DirectX Raytracing (PC) and more as well as a new GPU geometry pipeline. Spectral rendering delivers thermal heat radiation and infrared identification for both thermal and night-vision in-game imaging. The technical investment provides a cutting edge animation and blend shape system, while the new suite of audio tools supports full Dolby ATMOS, on supported platforms, along with the latest in audio simulation effects.

We had a chance to see the new engine in action at Infinity Ward and it was incredible. Lots of details, new level of realism, and so much more.

Beyond this, Eurogamer is reporting that Infinity Ward will be sharing the new engine across the teams, including Sledgehammer Games and Raven Software. We were not told this during our visit, but we wanted to pass this along as it’s big news that the new engine will be used going forward:

One of the key objectives with the latest engine is to help lay the foundation for the future of the Call of Duty series, with initial work starting on the revamp as long as five years ago. Going forward, Infinity Ward’s work will be shared across studios such as Sledgehammer and Raven Games, where there has already been a healthy collaborative history.

For more of our coverage on Call of Duty: Modern Warfare, check out our page for all the news we’ve posted here.

comments below