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

NVIDIA and Activision today announced that Call of Duty: Ghosts will be using NVIDIA graphics to deliver the best experience on the PC than ever before.

Earlier today at GamesCom, NVIDIA and Activision announced a Call of Duty: Ghosts technical partnership that will result in the PC version of the massively anticipated game being the best of any platform. Already, NVIDIA developers are on-site at Infinity Ward, working hand in hand with Activision’s developers to ramp up the quality and fidelity of the game’s Sub D tessellation, displacement mapping and HDR lighting.

Furthermore, the agreement will see the integration of exclusive NVIDIA technologies like TXAA temporal anti-aliasing, and hardware-accelerated NVIDIA PhysX effects. The one example given by Infinity Ward was the enhancement of smoke through the use of APEX Turbulence, a PhysX toolkit that allows artists to quickly and easily bolster existing effects with super-realistic, physically-led particles. With APEX Turbulence, explosions, gunshots and character movement will disrupt smoke clouds, causing them to be realistically manipulated in reaction to the forces exerted. More effects are planned, so make sure to stay tuned to GeForce.com for additional details as they’re revealed.

NVIDIA members are already at Infinity Ward studios working with the team to deliver these new enhancements.

While on stage, Infinity Ward made several other announcements that are sure to please PC gamers and fans of the mega franchise. First and foremost, the PC version will support dedicated multiplayer servers, ensuring the optimum online experience for frag addicts.

Additionally, the PC version of Ghosts will be integrated with Call of Duty ELiTE like consoles.

Secondly, Call of Duty Elite will be rolled out on the PC, giving players access to all the services of the popular online portal. And finally, the Call of Duty Elite smartphone app will also grant access to the same PC stats and services, letting gamers manage their profile while on the go.

SOURCE: NVIDIA via @lord187x

comments below