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

The Call of Duty Endowment, Activision Blizzard’s non profit organization that helps veterans find jobs, has announced a new “Hire. Honor.” campaign to celebrate the organization’s 10 year anniversary of helping veterans find jobs.

The Call of Duty Endowment has helped many veterans find jobs over the last 10 years and has found unique ways of allowing the community to help support the charity through in-game content packs in Call of Duty titles.

General James Mattis, Decorated American Veteran and Former United States Secretary of Defense, joins the campaign in a call-to-action Public Service Video which can be viewed at: callofdutyendowment.org/HireHonor. In addition to urging viewers to honor veterans by hiring veterans, General Mattis asserts that the vast majority of veterans who have experienced combat emerge stronger and are even greater assets to our society and the workforce.

The campaign encompasses a variety of programs that support the Endowment, with 100% of Activision proceeds going directly to finding jobs for veterans. The Call of Duty Endowment has funded the placement of more than 63,000 veterans into well-paying, high-quality jobs and expects to place 100,000 veterans in meaningful jobs by 2024.

“It is my great honor to partner with General Mattis and General Jones in honoring our veterans by hiring our veterans,” said Bobby Kotick, CEO of Activision Blizzard and co-founder of the Call of Duty Endowment. “We are committed to finding 100,000 jobs for veterans by 2024.”

For the Hire. Honor. campaign, the Endowment is adding additional ways to support veterans and earn in-game content in both Call of Duty: Mobile and Call of Duty: Modern Warfare.

  • Starting Monday, Nov. 11, Call of Duty®: Mobile will feature an Endowment-themed content pack entitled the Call of Duty Endowment Honor Pack which includes a new skin for in-game items
  • Players can participate by watching some of their favorite streamers play Call of Duty®: Modern Warfare on Twitch this Veterans Day. Look for streamers with CODE clan tags to see the Call of Duty Endowment streams. Fans who watch for 1 hour will receive 30 minutes of 2XP. Fans who watch for 2 hours will also receive a Call of Duty Endowment Calling Card.

The company also announced a donation partnership with Klay Thompson and Dr. Disrespect.

Gaming superstar Dr Disrespect and basketball legend Klay Thompson are teaming up with Omaze to raise funds for the Call of Duty Endowment. To bring attention to this important cause, they are offering the chance for one lucky fan to play Call of Duty®: Modern Warfare with Dr Disrespect and Klay Thompson, which will be livestreamed on Twitch. The lucky winner will play alongside one of gaming’s most dynamic personalities and one of the greatest three-point shooters in basketball, while supporting the work and mission of the Call of Duty Endowment. Visit Omaze.com/COD for details.

The organization partnered with General Jim Mattis for this campaign and released a new video discussing the campaign.

comments below