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

Ahead of the start of Weekend 2 of the Call of Duty: Modern Warfare Beta, Activision and Infinity Ward have shared details on how the cross play feature will work in Call of Duty: Modern Warfare.

This weekend of the Modern Warfare Beta is on PlayStation 4, Xbox One, and PC, and Cross Play will be enabled allowing players to play with friends on any platform.

Infinity Ward has shared some new info via Activision Blog and the live stream on how exactly Cross Play is going to work in Call of Duty: Modern Warfare and what their plans are for this feature.

Here’s the details on the Cross Play support in Modern Warfare:

1. You can Opt in, or Opt out:

In Modern Warfare, players can choose to enable crossplay, allowing players to play with friends on all three supported platforms, so the game offers an opt-in choice. 

2. A COD Account is Needed:

Remember, you will need a COD Account to play Modern Warfare, if you don’t have one already you can create one here.

3. Matchmaking and Balancing:

In Modern Warfare, crossplay has been designed to factor play balancing across differences in controller type. No one should feel an unfair advantage. Plus, players have choices on which control device they wish to use on any platform. Here are some examples you may experience:

·      You can decide to use keyboard and mouse on PlayStation® 4 or Xbox One.

·      You can decide to use a controller on PC.

·      PlayStation 4, Xbox One, and PC players can all play against each other, provided they all utilize controllers, or all utilize KBM (a keyboard and mouse).

·      You can place into a lobby where there are no control scheme filters, allowing you to play with players using both controllers and/or KBM across up to all three supported platforms.

Plus, with the addition of crossplay, we anticipate that players should look forward to even shorter lobby wait times.

4. Adding your Friends and Gathering Parties:

Using your COD Account, you are able to create cross-platform Friends lists and Parties from all three supported platforms. This unites the community by removing barriers, creating platform-agnostic friend groups. Are you a PS4 player with friends on Xbox One and PC, for example? Now you can organize parties and jump into matches with your friends, easily and quickly regardless of platform!

5. Crossplay Applicable Modes:

Crossplay supports all multiplayer modes in Modern Warfare. There are no plans currently to support Ranked Play or competitive tournaments.

These are just a few of the highlights. Today at 10AM PDT, Infinity Ward developers will go even deeper on the ins and outs of crossplay gameplay live via stream. You can tune in here.

In addition, the company announced that PlayStation will not be getting Modern Warfare content early. All platforms will be getting post launch maps and modes at the same time.

SOURCE: Activision

comments below