// 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 that Call of Duty: Black Ops 4 had the biggest Day 1 digital sales in the company’s history, beating out Call of Duty: WWII from last year, which set the record.

Call of Duty: Black Ops 4 was also the best selling digital game on Day 1 in PlayStation 4 store history as well, taking the title from Call of Duty: WWII. Activision also says PC version sales were doubled from last year’s.

Call of Duty®: Black Ops 4 has set a new launch day record as the biggest day one digital release in Activision history. Digital sales for the first day of release broke the franchise record set in 2017 by Call of Duty®: WWII. Released Friday, Black Ops 4 also set a new PlayStation record for day one digital full game sales on PlayStation Store, globally. The title also quickly became the best-selling Activision Xbox One digital game on day one, globally. The first Call of Duty release ever on Blizzard’s Battle.net, the PC version of Black Ops 4 also delivered a new franchise high in which launch day PC digital sales more than doubled year on year.

Activision also says that the amount of people online on Day 1 was higher than Call of Duty: WWII’s Day 1 player count.

In its first day of availability, the total number of people who connected online to play Black Ops 4 increased from last year’s release.

“Black Ops 4 is an incredible game, and the community’s response to it has been amazing. We have shattered multiple digital day one sales records, and the number of people who connected online on day one to play has grown year on year,” said Rob Kostich, EVP and GM, Call of Duty. “But probably the most important thing is that the community is having so much fun across Multiplayer, Zombies and Blackout. We are so incredibly thankful for the community’s trust and support. This is just the beginning, it’s going to be an incredible journey with Black Ops 4.”

Call of Duty: Black Ops 4 launched on October 12 on PlayStation 4, Xbox One, and PC. Treyarch and Activision have stated that Black Ops 4 will have the most active post launch season in Call of Duty history, with a slew of free and Black Ops Pass content to come for the title.

comments below