Commit Graph

15 Commits

Author SHA1 Message Date
Stypox 7ce2250d85
Improve CacheFactory and PlayerDataSource code 2022-06-17 22:00:51 +02:00
AudricV fbee310261
Move SimpleCache creation in PlayerDataSource to avoid an IllegalStateException
This IllegalStateException, almost not reproducible, indicates that another SimpleCache instance uses the cache folder, which was so trying to be created at least twice.
Moving the SimpleCache creation in PlayerDataSource should avoid this exception.
2022-06-17 22:00:51 +02:00
AudricV 210834fbe9
Add support of other delivery methods than progressive HTTP (in the player only)
Detailed changes:

- External players:

  - Add a message instruction about stream selection;
  - Add a message when there is no stream available for external players;
  - Return now HLS, DASH and SmoothStreaming URL contents, in addition to progressive HTTP ones.

- Player:

  - Support DASH, HLS and SmoothStreaming streams for videos, whether they are content URLs or the manifests themselves, in addition to progressive HTTP ones;
  - Use a custom HttpDataSource to play YouTube contents, based of ExoPlayer's default one, which allows better spoofing of official clients (custom user-agent and headers (depending of the client used), use of range and rn (set dynamically by the DataSource) parameters);
  - Fetch YouTube progressive contents as DASH streams, like official clients, support fully playback of livestreams which have ended recently and OTF streams;
  - Use ExoPlayer's default retries count for contents on non-fatal errors (instead of Integer.MAX_VALUE for non-live contents and 5 for live contents).

- Download dialog:

  - Add message about support of progressive HTTP streams only for downloading;
  - Remove several duplicated code and update relevant usages;
  - Support downloading of contents with an unknown media format.

- ListHelper:

  - Catch NumberFormatException when trying to compare two video streams between them.

- Tests:

  - Update ListHelperTest and StreamItemAdapterTest to fix breaking changes in the extractor.

- Other places:

  - Fixes deprecation of changes made in the extractor;
  - Improve some code related to the files changed.

- Issues fixed and/or improved with the changes:

  - Seeking of PeerTube HLS streams (the duration shown was the one from the stream duration and not the one parsed, incomplete because HLS streams are fragmented MP4s with multiple sidx boxes, for which seeking is not supported by ExoPlayer) (the app now uses the HLS manifest returned for each quality, in the master playlist (not fetched and computed by the extractor));
  - Crash when loading PeerTube streams with a separated audio;
  - Lack of some streams on some YouTube videos (OTF streams);
  - Loading times of YouTube streams, after a quality change or a playback start;
  - View count of YouTube ended livestreams interpreted as watching count (this type of streams is not interpreted anymore as livestreams);
  - Watchable time of YouTube ended livestreams;
  - Playback of SoundCloud HLS-only tracks (which cannot be downloaded anymore because the workaround which was used is being removed by SoundCloud, so it has been removed from the extractor).
2022-06-17 22:00:22 +02:00
karyogamy 4e459b3383 updated: ExoPlayer to 2.17.1.
added: MediaItemTag for ManagedMediaSources.
added: silent track for FailedMediaSource.
added: keyframe fast forward at initial playback buffer.
added: error notification on silently skipped streams.
2022-03-19 15:56:45 -04:00
TacoTheDank cf213affa2 Annotate some NonNulls, some lint cleaning 2022-03-18 13:15:44 -04:00
wb9688 87228673b4 Use final where possible 2020-08-16 10:25:09 +02:00
wb9688 63bcc04eff Move things back to its original place 2020-04-02 15:57:50 +02:00
wb9688 fda5405e48 Improve code style to be more consistent 2020-04-02 15:57:50 +02:00
Robin 87eab2a9b0 Fixed deprecations 2019-10-07 11:18:26 +02:00
Robin bf2a3ca043 Migrate to AndroidX 2019-10-04 14:59:08 +02:00
Robin 4d80bdcc9f Update ExoPlayer to 2.9.6, including httook dependency and deprecations 2019-03-05 18:05:44 +01:00
BO41 802b26e870 error handling + imports + unboxing 2018-09-11 19:18:50 +02:00
John Zhen Mo b3b2748bb7 -Improved player queue stability by using more aggressive synchronization policy.
-Added sync buttons on live streams to allow seeking to live edge.
-Added custom cache key for extractor sources to allow more persistent reuse.
-Refactored player data source factories into own class and separating live and non-live data sources.
2018-02-26 19:57:59 -08:00
John Zhen Mo 563a4137bd -Fixed inconsistent audio focus state when audio becomes noisy (e.g. headset unplugged).
-Fixed live media sources failing when using cached data source by introducing
cacheless data sources.
-Added custom track selector to circumvent ExoPlayer's language normalization NPE.
-Updated Extractor to correctly load live streams.
-Removed deprecated deferred media source and media source manager.
-Removed Livestream exceptions.
2018-02-25 15:10:11 -08:00
John Zhen Mo 1fb3774e03 -Changed play queue item building to shrink thumbnail before caching.
-Renamed refactor directory in player to helper.
-Fixed background player notification update causing lag on older spec models.
-Fixed service activity theme not changing after user setting is changed.
-Fixed NPE on popup player fling to close.
-Fixed audio reactor volume and max volume mixup.
-Added correct toast for each player error case.
-Fixed button coloring for play queue service activity on landscape.
-Changed title and uploader text to marquee for vertical service activity.
-Removed cache clearing on every thumbnail load.
2017-10-30 20:58:47 -07:00