// 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 next major software release for the PlayStation 4 console, update 3.0, is now available worldwide for users to download. The new update introduces the ability to upload videos natively to Twitter (up to 10 seconds), live stream directly to YouTube (including to YouTube Gaming), and more.

Here’s the full feature lists, announced by Sony:

  • Sharing video clips to Twitter: Now it’s easy to share video clips to Twitter directly from your PS4. You’ll see a new icon on the Upload Video Clip menu, nestled between Facebook and YouTube. Maximum video length is 10 seconds, though you’ll have the ability to trim longer clips. Don’t forget — you can double tap the Share button to start recording a video, and press it again to stop.
  • PlayStation Plus: We’ve made a dedicated section for PlayStation Plus, which you can access by clicking the big Plus icon on the top right corner of your PS4 home screen. Once there you can easily manage your membership, see the monthly free games to download, deals for PS Plus members, and all of the games you’ve redeemed through PS Plus on PS4.
  • YouTube live: You’ll see a new icon for YouTube on the Broadcast Gameplay Screen, accessible after hitting the Share button. Now you can live stream directly from your PS4 to YouTube. Livestreams will be viewable across YouTube.
  • PNG Screenshots: If you’d like your game screenshots to be in a higher quality format, you can now select PNG instead of JPEG. To access, press Share > Share Settings > Screenshot Settings > Image Format.
  • Events: A new hub for Events has been added to PS4, accessible from the home screen. This will give you an overview of activities taking place in the games you play most, as well as official broadcasts. For instance, here’s an in-game racing event taking place in Project Cars, which you can register for directly from the Events hub.
  • Improvements to Messages and Favorite Groups: We’ve improved Messages by making it easier to access groups of people you chat and play games with frequently. Once you’re added to or create a group, you’ll see the online status for friends, what games they are playing, and the option to message or chat in party all in one spot. When you add or create a new favorite group, they’ll appear in your Friends app under Favorite Groups for quick access. For example, you can see we have favorite groups for Call of Duty, Rocket League, and Destiny.
  • Communities: PS4 users will have the ability to create communities based around shared interests, like games, genres, and more. Communities include a message board with general discussion, screenshots shared by players, and the ability to join parties / games.
  • Stickers: From the PS4 system’s Messages app, you’ll see a new option for Stickers. The 3.00 update will contain stickers themed around Uncharted 4: A Thief’s End, Knack, LittleBigPlanet 3, Resogun, and more. Instead of typing out a message, just send a sticker — like Drake looking at a watch, asking you to wait a minute.”

SOURCE: PS Blog 

comments below