Commit Graph

141 Commits

Author SHA1 Message Date
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
TiA4f8R 3db37166b4
Apply suggestion 2022-02-20 19:40:02 +01:00
TiA4f8R bf02a569ee
Fix a NullPointerException when the current metadata is null
Reload the play queue manager and set the recovery in this case, like on the current behavior (without this PR).
2022-02-20 19:40:02 +01:00
TiA4f8R a1c5c94753
Add some comments and a JavaDoc 2022-02-20 19:40:01 +01:00
litetex bb27bf9d34
Resolver: Cleaned up ``isVideoStreamVideoOnly``
* Replaced by ``wasLastResolvedVideoAndAudioSeparated``
* Uses an ``Optional`` instead (we can't determine if the video and audio streams are separated when we did not fetch it)
2022-02-20 19:38:41 +01:00
TiA4f8R cc96ac173c
Apply suggestion 2022-02-20 19:38:40 +01:00
TiA4f8R 336f9f3813
Add seamless transition between background player and video players (for video-only and audio-only streams only)
This is only available when playing video-only streams (and when there is no audio stream and only video streams with audio) and audio-only streams.
For more details about which conditions are required to get this transition, look at the changes in the useVideoSource(boolean) method of the Player class.
2022-02-20 19:38:39 +01:00
Stypox 3c23fb0b13
Small refactor in player class 2022-02-19 13:30:55 +01:00
Stypox da12b92d75
Fix fast seek arc not going under system ui 2022-02-19 11:29:33 +01:00
Stypox 00767f4bf3 Fix fast seek overlay arc not correctly centered
This happened in fullscreen player: while play-pause, brightness, volume, ... buttons were correctly centered in the app UI, the fast seek overlay was centered in the system UI, causing a mismatch between the two that looked ugly
2022-02-18 22:34:55 +01:00
litetex be95d7fe0f
Merge pull request #7704 from Stypox/fix-stream-menu-crash
Fix crash when long-pressing stream while player is starting
2022-02-09 19:53:09 +01:00
TiA4f8R e103e4817c
Apply suggested changes and remove the CustomHlsPlaylistTracker class 2022-01-30 20:42:02 +01:00
TiA4f8R 651b79d3ed
Catch properly BehindLiveWindowExceptions
Instead of trying to reload the play queue manager and then throwing an error, BehindLiveWindowExceptions now make the app seek to the default playback position, like recommended by ExoPlayer.
The buffering state is shown in this case.

Error handling of other exceptions is not changed.
2022-01-30 20:42:01 +01:00
litetex 2886bc3b01
Merge pull request #4833 from vkay94/youtube-rewind-forward
YouTube's Fast Forward/Rewind behavior
2022-01-30 17:07:15 +01:00
litetex af79479716 Fixed "Changing the seeks duration does not update the displayed seconds" 2022-01-25 20:44:49 +01:00
Stypox 5108d75682
Fix NPE and add some `@Nullable`s
Fix NullPointerException in PlayerHolder.getQueueSize() and add `@Nullable` here and there so that the linter reports risks of NPEs
2022-01-25 17:37:20 +01:00
TiA4f8R ea07d7751b
Fix first item played in playlists when switching player type or resolution
The issue was caused by an ExoPlayer change, which when setting a media source, resets the current playback position and the current window index by default.

Also set player recovery in more places to fix playback position not propely set in some cases after a player type switch.
2022-01-24 21:40:16 +01:00
litetex 54ef604569 Improved docs 2022-01-21 22:49:25 +01:00
litetex 30ce906f72 Apply seek conditions based on direction
* When rewinding: Check if <0,5s
* When fast-forwarding: Check if player has completed or the current playback has ended

This allows rewinding on the endscreen
2022-01-21 22:49:25 +01:00
litetex 1c20eabb48 Code cleanup 2022-01-21 22:49:25 +01:00
litetex f8c52c4dac Fixed SonarLint problems
* Removed alphaRelativeDuration as there is no use for it
2022-01-21 22:49:24 +01:00
litetex 345ba74d58 Fixed naming 2022-01-21 22:49:24 +01:00
litetex d2aaf152a0 Removed related import 2022-01-21 22:49:24 +01:00
litetex 7bf1f3dba6 Removed unused field 2022-01-21 22:49:24 +01:00
litetex c25e523df6 Removed all animations to be consistent with the current behavior 2022-01-21 22:49:23 +01:00
litetex 65bb1dcdbf Refactored code 2022-01-21 22:49:23 +01:00
litetex fe42206e94 Code cleanup and minimization
* Deduplicated and simplified a lot of code
* Fixed ``invalidSeekConditions`` so that it's possible to seek while the player is loading (like currently the case)
2022-01-21 22:49:23 +01:00
TobiGr dac47d9f52 Replace NotNull annotation with NonNull annotation 2022-01-21 22:49:23 +01:00
Stypox 83a3d11f38 Small improvements to player 2022-01-21 22:49:22 +01:00
Stypox a454a41b51 Fix controls not hiding correctly when switching player 2022-01-21 22:49:22 +01:00
vkay94 3aebfa22e9 SeekOverlay: Switch to merge for SecondsView and other adjustments 2022-01-21 22:49:21 +01:00
vkay94 72eb3b4415 SeekOverlay: Add seek overlay logic to player 2022-01-21 22:49:21 +01:00