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

Activision has announced today that they are releasing a brand new Companion App for Call of Duty. This new app lets you track your stats, stay up to date on in-game events, see what your friends are up too, and more.

The new Companion App is available now iOS and Android. Download here. In addition, logging in to the app will grant a 500 Call of Duty Points bonus! You will see an offer redemption screen when you load up into Black Ops 4 after logging into the app for the first time.

Here’s the features of the app, from Activision:

Keep Your Friends Close, and Turn Your Enemies into Friends

Keep tabs on your friends’ progress in the friends feed! Track their accomplishments and battle stats, see what they’re playing, and compare their achievements to yours so you can either join the fight or talk some trash.

Plus, you can form a squad with up to 20 other players and earn in-game and exclusive rewards by completing weekly objectives as a Squad. Each week, your Squad will be tasked with in-game challenges, such as getting a certain number of zombie kills or winning matches in a specific game mode.

Completing challenges will give your entire Squad rewards to show off in-game or in the real-world from our partners such as KontrolFreek.

“The Call of Duty Companion App is something that we are very excited for players to use to enhance their gameplay experience,” said Gina Hope, Senior Director of Marketing Technology at Activision. “From connecting you with friends and fellow players, to providing personalized match analysis to checking out your loadouts and competing in challenges with your own squad, it’s a new way for players to engage with the game and the community.”

Personalized Match Reports and Gameplay Analysis

By connecting to your in-game profile, the Companion App will give you a personalized, deep dive into your previously played matches across Call of Duty: Black Ops 4 in Blackout, Multiplayer, and Zombies, as well as Call of Duty: WWII Multiplayer, including War Mode.

Once you sign up, you will receive a weekly Action Report of how you played in the previous week, as well as a Weekly Briefing with suggestions, tips and tricks that can get you back into the battle with an edge. Now you’ll be able to head into the weekend warfare with a new battle plan based on this intel!

Along with stats for your individual Weapons, Equipment and Loadouts – the Companion App will show you Match Analyses and Heat Maps to track every bullet and movement in that match. Based on your play, the app will give you personalized recommendations to help you drive up those stats.

Want to be an elite run-and-gun player? Or how about the ultimate sniper? The Call of DutyCompanion App can track what fits you and put you on the road to improved performance.

Stay in the Know

What in-game event is happening this weekend? Why was there a game update today? And wait, what’s that amazing item that I just saw in the game?

There’s a lot happening in Call of Duty — you don’t want to miss out on all the in-game events, updates and more. The Call of Duty Companion App features a News tab that can give you the latest details on all of these and more at the tap of a button. Stay on top of all the latest intel while you’re on the go, or even while you’re quietly waiting to get the drop on someone in Blackout.

“The release of the Call of Duty Companion App is part of our continued commitment to creating personalized services for players that enhances their gameplay and deepens their connection to the game, as well as other players,” said Monte Lutz, SVP of Consumer Engagement, Activision. “We’re launching with compelling features that are tailor-made for the Call of Duty community, and we’ll continue to add new capabilities, including localization, a load-out editor and chat, that will give players the tools they need to get the most out of Call of Duty. We look forward to partnering with the community on developing the roadmap for future features.”

SOURCE: Activision

comments below