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

In collaboration with Call of Duty and Treyarch, Kontrol Freek has released new Jugger-nog Kontrol Freek’s. The KontrolFreek Black Ops 3 Jugger-Nog is based on the Jugger-Nog soda bottle cap as seen in Call of Duty Zombies.

You can buy the Kontrol Freek’s here. Use code ‘INTEL’ for 10% off.

This limited, officially licensed Collector’s Edition Call of Duty®: Black Ops 3 Zombies thumbstick was designed in close collaboration with Call of Duty and Treyarch, the developers of Call of Duty Black Ops III. KontrolFreek Call of Duty Black Ops III Jugger-Nog is based on the Jugger-Nog soda bottle cap that has been featured in Call of Duty since the Nazi Zombies days of World at War. And like its Perk-a-Cola namesake, our Jugger-Nog thumbstick accessory is an invaluable tool for long-lasting survival.

Jugger-Nog features a stark crimson color and a highly detailed, laser-etched rendering of the iconic beverage’s bottle cap stamped on our specially formulated rubber pad. Our proprietary rubber compound combined with the fluted shape of the bottle cap provides solid grip and comfort, while the mid-rise (5.7mm) height of the sticks lends themselves to the short to medium range combat typical of Call of Duty Zombies.

KontrolFreek Call of Duty Black Ops III Jugger-Nog is a must have for Call of Duty Zombies fans who love the game mode and want to own a piece of the Zombies universe.

comments below