// 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 Call of Duty: Modern Warfare launch, PlayStation Store has put up the trophies for the game.

Here’s a look at each of the trophies. Please note — there are spoilers here, so read at your own discretion.

  • Tier 1 (Platinum) Unlock all Trophies
  • Press [BOOM] to Defuse (Bronze) Blow up 3 tripwires with explosives.
  • Ashes to Ashes (Silver) Burn 4 enemies with a single molotov.
  • Hang Time (Bronze) Kill 3 Enemies while you are on a ladder.
  • Long Way Down (Silver) Crash a helicopter by shooting the pilot.
  • Wild Fire (Gold) Take down a flying Helicopter with a molotov.
  • Good Effect on Target (Silver) Kill an enemy with a direct hit from a smoke grenade.
  • Out of the Fire (Gold) Complete every single player mission on Veteran or Realism difficulty.
  • Tea Time (Silver) Complete the single player Campaign on any difficulty.
  • Nothing but Net (Bronze) Neutralize the ‘Fog of War’ machine gun with a frag grenade.
  • Trigger Discipline (Gold) Do not injure any civilians in ‘Piccadilly’.
  • Play Dead (Silver) Kill all the enemies in the ‘Embedded’ field of dead bodies.
  • Companion Block (Silver) Only use one cinder block and bring it to the end of ‘Embedded’.
  • Wall Hax (Bronze) Save Alpha 3-2 from being downed.
  • Golden Path (Gold) Complete ‘Clean House’ without being hit using one bullet per threat.
  • Circus Tour (Bronze) Kill at least one enemy while inside The Reading Place, Aural Chic and both Subway undergrounds.
  • Love from Above (Silver) Destroy 4 trucks with 4 drone strikes before they reach the end of their path in ‘The Embassy’.
  • Pit Stop (Silver) Stop three APCs with Hadir’s sniper rifle.
  • Driver’s Ed (Silver) Shoot the driver of the suicide truck.
  • Two Birds (Silver) Kill both soldiers with one shot in ‘Hometown’.
  • Tunnel Rat (Silver) Complete ‘The Wolf’s Den’ tunnels using only the 1911.
  • Dodged a Bullet (Silver)Never get hit by the sniper while escaping captivity.
  • Got Something on Your Face (Silver) Spit on Barkov.
  • Hot Swap (Silver) Get at least one kill with eight different weapons when completing ‘Old Comrades’.
  • Lights Out (Bronze) Shut off the power to 4 buildings in ‘Going Dark’.
  • We Own the Night (Gold) Kill all enemies at the Church, Clocktower, and Pool without anyone calling for backup.
  • Warheads on Foreheads (Silver) Reach Barkov’s lab entrance using only drone strikes.
  • Liberation (Bronze) Complete all Special Operations missions.

Call of Duty: Modern Warfare is available October 25 on PS4, Xbox One, and PC.

SOURCE: Reddit

comments below