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

With Call of Duty: Modern Warfare officially going live today, we wanted to remind players how Crossplay works in Call of Duty: Modern Warfare.

Modern Warfare is the first Call of Duty game to support Cross Play between PlayStation 4, Xbox One, and PC allowing friends to play together regardless of platform of choice.

There’s also support for Cross Progression in Call of Duty: Modern Warfare, letting you transfer your data between platforms. Cross Progression works as long as you have all of your accounts linked to a single Call of Duty & Activision account. 

Now, let’s go over the basics of cross play in Modern Warfare. 

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.

How Cross Play works in Call of Duty: Modern Warfare 

Keep up to date with our Call of Duty: Modern Warfare launch coverage on our Modern Warfare game page.

comments below