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

It’s time, PlayStation 4 players!

The Call of Duty: Modern Warfare 2v2 Gunfight Open Alpha is now live on PlayStation 4.

The Gunfight 2v2 Alpha is open to every single PlayStation 4 player — no pre-order required, no code required, and no PS Plus required. The Alpha will be available from now through Sunday, August 25. An exact end time has not been confirmed.

The Gunfight 2v2 Open Alpha features five maps to play on: Stack, King, Pine, Speedball, and Docks. Per an Activision Support article, the Alpha starts with three maps (King, Pine, and Speedball), and the two new maps (Docks and Stack) will be added during the weekend.

Maps:

Docks (2V2 Alpha Exclusive)

A London shipyard with vessels travelling along the river behind one team’s infil point, with the other team spawning in street-side due west. Buildings 51 – the Foreman’s office – and 52 – the crew’s quarters – are two-story brick structures that define the map’s north and south, with a bridge connecting the two over a concrete walkway. The walkway under the bridge’s center – which also sits over a concrete waterway running east to west – serves as the overtime flag’s location.

King

A roughly-symmetrical training range warehouse with each player starting behind an L-shaped defensive structure made from sections of wood subfloor. Along the perimeter are two connected metal shipping containers (with “Shoot House” sprayed on each one), offering protection, but no clear line of sight. The center of the map is a half-constructed plywood stage with stairs at each end, crates to climb, and a concrete base with three small tunnels to traverse. The flag spawns in the center tunnel.

Pine

A woodland training range with working metal targets beyond the perimeter, and a small grassy area from the infil point. The eastern infil point is a firing range, while the western infil point is a bunker entrance. Each perimeter area leads to a rocky outcrop and a rusting vehicle to navigate or hide behind, and a raised, tarp-draped command post on the southern side. A stream bisects the map, running southwest to northeast, with an open red container where the flag appears.

Speedball (2v2 Alpha Exclusive)

A live firing range that is true to its name through its style. Containers, tire stacks, concrete slabs and wooden structures act as cover between the two squads that infil on opposite sides east and west. The overtime flag appears near the map’s southern portion, smack in the middle of two containers, dueling small towers and the central concrete-reinforced wood wall.

Stack

A desert training range, with both teams starting on a raised balcony (one with an overhang), each with two ramps; one at either perimeter edge. The side paths each have sand-filled buttress crates and tire stacks, and both widen slightly in the middle. The center of Stack is a raised platform, with plywood stairs (one at each corner), and an open container where the flag spawns.

Trailer:

Infinity Ward will be adding in variations of game modes into Gunfight throughout the weekend. More ‘surprises’ will be added throughout the weekend. Infinity Ward wants to use this weekend to test out scaling the servers with Gunfight alongside the overall balance and weapon system.

This is the first large scale Alpha testing that a Call of Duty title has ever had, so PS4 players be sure to try it out and give your constructive feedback to Infinity Ward developers.

Call of Duty: Modern Warfare will also feature an Open Beta in September for PS4, Xbox One, and PC. The Open Beta will begin September 12 on PS4 and be exclusive to PS4 for the first weekend. The second weekend, starting September 19, will be available across platforms.

comments below