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

PlayStation announced this morning that they are integrating MLG GameBattles directly into the PlayStation 4 start menu, to allow players to quickly create teams, find GameBattles matches, and be placed directly into a Call of Duty: WWII lobby with the settings enabled of the GameBattles match.

PlayStation worked with Activision, Sledgehammer Games, High Moon Studios, and MLG to integrate GameBattles fully into the PlayStation 4 menus. The feature is available in America and select Asia regions. This system will have MLG GameBattles’ 2v2, 4v4, and 6v6 tournaments available to sign up for.

Through the PS4 Events and Tournaments platform, you can now create and manage teams of up to 100 members including your friends, family, and favorite players on PlayStation Network. Once you setup your team, registering and participating in any of the featured Call of Duty: WWII events is as quick as a few button presses. Included in your team setup is team-specific chat, unique banners and logos, and complete tracking of your gameplay history and events you and your team have participated in.

Beyond this, the new system is also directly integrated with Call of Duty: WWII. If you find a MLG GameBattles match, accept it in the PS4 start menu, you can then press “Join Lobby” to have the game and system automatically set up the GameBattles lobby inside of Call of Duty: WWII.

Once you have chosen an event, registered, and checked-in, getting into gameplay is completely automated. Call of Duty: WWII and the Tournaments platform will automatically match your team with your opponent, setup the match types (including map rotation, rule set, etc.), and place you directly into the game lobby after you click “Join Match” from the PlayStation Tournaments section or directly within Call of Duty: WWII’s menu screen.

But what about when the match is over you ask? Again, the integration work done between our development teams ensures that your results are automatically reported, verified, and finalized without ever having to enter the results. This makes moving to your next match (Hopefully you won!) smooth, quick, and accurate, with no manual input or verification needed.

SOURCE: PS Blog

comments below