Commit Graph

172 Commits

Author SHA1 Message Date
litetex b7a44560f5
Merge pull request #8170 from Stypox/player-refactor
Refactor player and extract UI components
2022-07-15 19:41:23 +02:00
Stypox 6ea85e6380
Rename dummy_* and more to placeholder_* 2022-07-14 14:27:33 +02:00
Stypox 8187a3bc04
Move PlayerType into its own class and add documentation
Also replace some `isPlayerOpen` with direct `playerType == null` checks.
2022-07-13 23:33:18 +02:00
Stypox 4979f84e41
Solve some Sonarlint warnings 2022-07-13 23:33:16 +02:00
Stypox a19073ec01
Restore checkstyle and solve its errors 2022-07-13 23:32:27 +02:00
Stypox 1b39b5376f
Add some javadocs; move preparing player uis to PlayerUiList 2022-07-13 23:31:59 +02:00
Stypox fa25ecf521
Add comment about broadcast receiver 2022-07-13 23:27:24 +02:00
Stypox 90a89f8ca5
Move player-notification files into their package 2022-07-13 23:27:24 +02:00
Stypox 0bba1d95de
Move all notification-related calls to NotificationPlayerUi 2022-07-13 23:27:24 +02:00
Stypox b3f99645a3
Fix some crashes / issues after player refactor 2022-07-13 23:27:23 +02:00
Stypox 76ced59b62
Refactor player: separate UIs and more 2022-07-13 23:25:26 +02:00
litetex 99104fc11d
Clean up pre-Lollipop checks 2022-07-13 19:02:24 +02:00
Robin 93b913e14d
Merge pull request #8536 from TacoTheDank/bumpExoPlayer
Update ExoPlayer to 2.18.0
2022-07-13 12:59:12 +02:00
TacoTheDank 00b9c082a3 Set setUsePlatformDiagnostics to false 2022-07-02 15:01:39 -04:00
Stypox 085d1e0d38
Actually fix wrong view count 2022-07-01 16:07:19 +02:00
TacoTheDank 1404581e9b Update ExoPlayer to 2.18.0 2022-06-25 21:14:42 -04:00
AudricV 73855cacb7
Use StreamTypeUtil where possible and add isAudio and isVideo to this utility class 2022-06-17 22:01:26 +02:00
Stypox 8445c381c5
Use DownloaderImpl.USER_AGENT directly
instead of passing it as a parameter
2022-06-17 22:00:52 +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
Isira Seneviratne 23c1fc3544 Remove unnecessary compat method calls. 2022-05-10 07:45:01 +05:30
karyogamy 29fc0eff38 fixed: added comments for DefaultTrackSelector auto-select fix. 2022-04-17 18:34:31 -04:00
karyogamy 4917da2d2e fixed: disabled caption to no longer automatically re-enable on new player instance. 2022-04-17 13:26:39 -04:00
karyogamy 9818f179c4 fixed: auto-generated captions to have lower selection priority as manual captions. 2022-04-11 22:06:43 -04:00
karyogamy 55fc3fc177 added: caption language stem utility to support language variant conversion between videos. 2022-04-08 18:21:30 -04:00
karyogamy 724eac9168 fixed: player caption auto-selection not reflected in gui.
fixed: player caption selection skipping on multiple language variants.
2022-04-07 20:02:56 -04:00
TiA4f8R 3261855b8f
Fix fetch of video streams (when switching between tracks in a play queue) and subtitles when using a seamless transition between background and video players
Make the use of the new method setDisabledTrackTypes in DefaultTrackSelector.ParametersBuilder, which disables selection of tracks type for every TrackGroup instead of the current group, which is the current behavior.
This removes the use of the deprecated of setSelectionOverride method.

Note that for progressive media, the content is still fetched, but only for initialization purposes (so requests are pretty small, most of times with a few kilobytes size).
2022-04-03 14:07:56 +02:00
karyogamy a00bc95acc updated: source loading error for FailedMediaSource to wait for 3 seconds before allowing retry.
updated: minor style fixes.
2022-03-27 13:24:37 -04:00
karyogamy d289dc8a53 updated: onPlayerError to not catch unspecified source errors so notifications are created.
updated: Throwable usage to Exceptions.
updated: minor styles and documentations.
2022-03-26 20:17:52 -04:00
karyogamy b81eb35f3d added: documentations on lifecycles for FailedMediaSource and LoadedMediaSource.
fixed: onPlaybackSynchronize to rewind when not playing, which was incorrectly removed in previous commit.
fixed: sonar and checkstyle issues.
2022-03-19 22:40:32 -04:00
karyogamy 69646e5b5d added: documentations to MediaItemTags and Player.
fixed: checkStyle failures.
2022-03-19 15:56:45 -04: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
Stypox 53f8415e9b
Use @SuppressWarnings for checkstyle suppressions & warnings
It's better to use @SuppressWarnings instead of the suppressions file, so that the warning suppression is at the place where it acts.
2022-03-18 23:57:11 +01:00
litetex cefb52471f Better naming 2022-03-16 15:52:30 +01:00
litetex ee5e0e13b7 Made ``onClick`` less (cognitive) complex 2022-03-16 15:52:30 +01:00
litetex 30a8f25d52 Refactored code 2022-03-16 15:47:04 +01:00
XiangRongLin d348c2099e stupid checkstyle 2022-03-16 15:47:04 +01:00
XiangRongLin 6a400dda7b delete unused methods 2022-03-16 15:47:03 +01:00
XiangRongLin 080c4ba680 Extract 2 view click listeners from Player 2022-03-16 15:47:03 +01:00
litetex 00e4631b3b
Merge pull request #7963 from Stypox/android-tv-player
Improve player UI and navigability for Android TV
2022-03-15 21:41:48 +01:00
ktprograms 02fa5aa0fa
Implement appending queue to playlist in main player (#8008)
This also allows saving a remote playlist locally.

- Add an "Add to playlist" button to the queue menu in the Player.
- Move the appendAllToPlaylist functionality from PlayQueueActivity to
Player.

Fixes: #8004
2022-03-15 18:32:39 +01:00
Stypox af89f05011
Merge pull request #7341 from ktprograms/external-play-hide-controls
Fix player controls not hiding if resumed from media button
2022-03-15 13:43:35 +01:00
Stypox e588abd4e7
Restore handling SPACE as play-pause only in fullscreen
When not in fullscreen SPACE should be not handled by the player, and hence result in a scroll down
2022-03-03 10:14:58 +01:00
Stypox 146062d921
Fix player pop-ups not giving feedback on touch/focus 2022-02-27 18:49:16 +01:00
Stypox 96c4201929
Fix controls shown below queue/segments list when using DPAD
Also invert if
2022-02-27 18:49:16 +01:00
Stypox a0bbcd2fee
Fix player queue/segments list buttons not focusable with DPAD
Now the in-player play queue and the segments list are closeable
2022-02-27 18:49:16 +01:00
litetex a95318a4f9
Merge pull request #7349 from TiA4f8R/seamless-transition-players
Add seamless transition between background and video players when putting the app in background (for video-only streams and audio-only streams only)
2022-02-26 16:16:18 +01:00
litetex 1030e09fc1
Merge pull request #7901 from Stypox/player-small-refactor
Small refactor in player class
2022-02-21 20:48:03 +01:00
TiA4f8R 8932adbf88
Apply suggested change and add a note about data consumption for HLS streams in background
ExoPlayer right now fetches HLS video tracks even if you disable them (with setRendererDisabled or setSelectionOverride).
See issue 9282 of ExoPlayer's issue tracker for more information.
2022-02-20 19:40:03 +01:00
TiA4f8R d27d36b76a
Adress requested changes 2022-02-20 19:40:02 +01:00
TiA4f8R ba804c7d4a
Use a enum to understand better what source type is used.
This commit also allows a seamless transition for livestreams.
2022-02-20 19:40:02 +01:00