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

Weapons in Call of Duty: Modern Warfare have been updated with a new leveling system that offers deeper progression and customization than ever before seen in Call of Duty. 

Each weapon in Call of Duty: Modern Warfare has between 50 and 71 levels to progress through. The level varies based on the weapon. For example, the P90 has 50 levels; the M4 has 71 levels. 

You level up weapons in Call of Duty: Modern Warfare by just using the weapon in game to earn Weapon XP. While leveling up weapons in Call of Duty: Modern Warfare, you also get bonus player XP. 

Leveling up weapons in Modern Warfare unlocks two different things: certain levels will unlock new attachments to use in the Gunsmith, and other levels will unlock new camo classes in Modern Warfare.

All attachments in Call of Duty: Modern Warfare are earned through leveling up the weapon and can be equipped in Gunsmith, similar to the beta experience of Call of Duty: Modern Warfare. 

Weapons have 100+ attachments options, the most in any Call of Duty game ever, allowing for a deep customization and weapon changes that Call of Duty has not seen before. You can make a variety of new weapons in Gunsmith and save them as you want. 

Call of Duty: Modern Warfare also features cosmetic weapon variants. The cosmetic weapon variants have different looks with a set of attachments that provide a different feel to the overall weapon. Cosmetic weapon variants can be earned through completing objectives, pre-order bonuses, and more in the game. 

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

comments below