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

[nggallery id=506]

A forums member on NeoGAF has obtained a copy of the July version of the GameInformer magazine via his Google Play tablet subscription. In the magazine, it has confirmed the first details about Respawn’s newest game, ‘Titanfall’. According to the magazine, the game will be out on Xbox One and PC, with the Xbox 360 version being developed by another studio. “After a bitter split with Activision and Call of Duty, Respawn debuts its bold vision for next-gen multiplayer,” reads the cover.

The new game from Respawn is a futuristic multiplayer-centric online shooter, one of our sources says. The source describes the game as a battle of Davids and Goliaths. The Davids are heavily-armed foot soldiers. The Goliaths are the giant exosekeltons—Titans—that these soldiers can pilot. These Titans are big mech-style walkers that move with an agility not seen in games like Mechwarrior or Steel Battalions.

To keep the action balanced, game maps limit the number of Titans that can be used in a skirmish. Weapon loadouts for the foot soldiers are designed to ensure that the characters on foot can take out the Titans if need be. The source who described the game does not work at Respawn, but their description tracks with the long-reported desire by the former Infinity Ward team to make a sci-fi shooter.

The game is expected to ship in ‘Spring 2014’ according to the magazine. The game will be using Microsoft’s Cloud tech to support the always online aspect. The game has a Campaign Multiplayer and Regular Multiplayer. The leak also states that the game is using a source engine, as making a new engine would take too long.

According to the leak, it says that

They thought working on PS4, Xbox One and PC would prove too difficult for a small team, so they decided to focus on one console instead of two. (er…). “Not to say we won’t [go multiplatform] in the future, but for our first game we wanted to focus on making the best game we could.”

UPDATE: @EA has confirmed that Titanfall is real, and more information is coming during their E3 conference on Monday, June 10th.


SOURCE: Neogaf Via Kotaku Image via @NicholasGigante

comments below