Commit graph

959 commits

Author SHA1 Message Date
Stypox
f7a2c3ff9c Merge pull request #8692 from TacoTheDank/bumpMaterial
Update Google Material to 1.6.1
2022-08-02 11:05:24 +02:00
Stypox
2bb269b46d Merge branch 'dev' into bumpFragment 2022-08-02 10:54:39 +02:00
TacoTheDank
427ff7857e Update Google Material to 1.6.1 2022-07-24 16:51:26 -04:00
TacoTheDank
59460aa3a6 Update AndroidX Fragment to 1.4.1 2022-07-24 15:35:33 -04:00
TacoTheDank
65027ebdf0 Update ExoPlayer to 2.18.1 2022-07-24 14:11:31 -04:00
Isira Seneviratne
ec1154cf2d Refactor notifying method in PlayQueue. 2022-07-21 08:02:23 +05:30
Stypox
24dad270d9 Merge pull request #8651 from Isira-Seneviratne/Use_limiting_methods
Use range-limiting methods.
2022-07-20 15:06:45 +02:00
Stypox
b882058c1a Improve code style 2022-07-20 15:05:25 +02:00
Isira Seneviratne
7d0645a32d Use coerceIn(). 2022-07-20 05:36:01 +05:30
Isira Seneviratne
000da24de2 Use MathUtils.clamp().
Co-authored-by: Stypox <stypox@pm.me>
2022-07-20 05:36:01 +05:30
Isira Seneviratne
bcab7925d2 Use Map.of(). 2022-07-20 04:39:11 +05:30
Isira Seneviratne
6f77ff6c53 Use List.of(). 2022-07-20 04:39:11 +05:30
litetex
dc341bb6ac Fixed conflicts/build 2022-07-15 20:00:08 +02:00
litetex
c32fd9a20c Changed the code accordingly
+ Removed some unused code
2022-07-15 19:55:19 +02:00
litetex
1706856f24 Merge pull request #8170 from Stypox/player-refactor
Refactor player and extract UI components
2022-07-15 19:41:23 +02:00
Stypox
a6cc11225d Rename dummy_* and more to placeholder_* 2022-07-14 14:27:33 +02:00
Stypox
d71da66cc5 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
47589426b1 Fix SonarLint java:S5320, restrict broadcasts to app package 2022-07-13 23:33:18 +02:00
Stypox
6e571a252a Some SonarLint refactors 2022-07-13 23:33:18 +02:00
Stypox
65651e0302 Some refactorings after review comments 2022-07-13 23:33:18 +02:00
Stypox
7e64750460 Move popup layout param to PopupPlayerUi 2022-07-13 23:33:18 +02:00
Stypox
cf4a472b5c Move functions to get Android dimen to ThemeHelper 2022-07-13 23:33:18 +02:00
Stypox
cb4a771a4e Fix volume gestures not working anymore 2022-07-13 23:33:18 +02:00
Stypox
b3201b20c7 Solve some Sonarlint warnings 2022-07-13 23:33:16 +02:00
Stypox
986be98a80 Restore checkstyle and solve its errors 2022-07-13 23:32:27 +02:00
Stypox
74addaa1c2 Add some javadocs; move preparing player uis to PlayerUiList 2022-07-13 23:31:59 +02:00
Stypox
9b701b373f Improve //region comments in player UIs 2022-07-13 23:30:30 +02:00
Stypox
9f2d912691 Add comment about broadcast receiver 2022-07-13 23:27:24 +02:00
Stypox
d689c9013b Remove unused PlayerServiceBinder 2022-07-13 23:27:24 +02:00
Stypox
e707113920 Remove unused PlayerState 2022-07-13 23:27:24 +02:00
Stypox
0352d546fd Move player-notification files into their package 2022-07-13 23:27:24 +02:00
Stypox
7f99dbbfe8 Move all notification-related calls to NotificationPlayerUi 2022-07-13 23:27:24 +02:00
Stypox
eba3996878 Fix some crashes / issues after player refactor 2022-07-13 23:27:23 +02:00
Stypox
5ba14c4b7c Refactor player: separate UIs and more 2022-07-13 23:25:26 +02:00
litetex
4a4ca3c18e Clean up pre-Lollipop checks 2022-07-13 19:02:24 +02:00
Alex
a68e34b430 Crop the notification thumbnail in 1:1 mode instead of stretching it (#8533)
Change square bitmap transformation strategy: change the bitmap transformation strategy when a 1:1 aspect ratio is
enabled to not stretch the bitmap but rather crop it.

On Android 11/12, the way the whole thumbnail was used for the
notification icon was not ideal, however the setting to toggle a 1:1
(as it states in settings) resulted in distortions.

Fix this by simply cropping the bitmap.

Also update the 1:1 mode strings to remove mentions of scaling or
distortions, as those no longer apply.
2022-07-13 17:19:44 +02:00
Robin
e1029800f3 Merge pull request #8536 from TacoTheDank/bumpExoPlayer
Update ExoPlayer to 2.18.0
2022-07-13 12:59:12 +02:00
litetex
eff828aeea Fix compile errors 2022-07-04 23:19:41 +02:00
TacoTheDank
bc6d68980f Set setUsePlatformDiagnostics to false 2022-07-02 15:01:39 -04:00
Stypox
0581ad0075 Actually fix wrong view count 2022-07-01 16:07:19 +02:00
TacoTheDank
ee609330d7 Update ExoPlayer to 2.18.0 2022-06-25 21:14:42 -04:00
AudricV
6f9a06c205 Ensure that progressive contents are URL contents for playback
A ResolverException will be now thrown otherwise.
2022-06-19 15:41:29 +02:00
Stypox
321714eddc Remove misleading first "Non" from getNonUrlAndNonTorrentStreams 2022-06-18 18:52:32 +02:00
Stypox
17c70c58a9 Refactor PlaybackResolver and fix cacheKeyOf
In commonCacheKeyOf the result of an Objects.hash() was ignored
2022-06-18 18:41:44 +02:00
Stypox
3836f29866 Wrap debug log in if(DEBUG) 2022-06-18 18:09:12 +02:00
AudricV
a3369ba3a4 Fix playback of non-URI HLS streams
A custom HlsPlaylistParserFactory cannot be used anymore to play HLS streams.

This needs to be replaced by a custom HlsDataSourceFactory, which returns a ByteArrayDataSource (where the bytes of this DataSource correspond to the bytes of the playlist string) and a specified DataSource for other request types.

This model has two limitations:

- if media requests are relative, the URI from which the manifest comes from (either the manifest URI (preferred) or the master URI (if applicable)) must be returned, otherwise the content will be not playable, as it will be an invalid URL, or it may be treat as something unexpected, for instance as a file for DefaultDataSources;
- if the playlist is a master playlist, endless loops should be encountered because the DataSources created for media playlists will use the master playlist response instead of fetching the corresponding playlist. With the current model of HlsDataSourceFactory, there is no possibility to distinguish the playlist type or the URI that is requested.

If ExoPlayer provides a way to create HlsMediaSources with an HlsPlaylist in the future, it should be used instead of this solution.
2022-06-17 22:01:30 +02:00
AudricV
d4614e176b Throw a dedicated exception when errors occur in PlaybackResolver
A new exception, ResolverException, a subclass of PlaybackResolver, is now thrown when errors occur in PlaybackResolver, instead of an IOException
2022-06-17 22:01:29 +02:00
AudricV
ce58a2df30 Filter streams using Java 8 Stream's API instead of removing streams with list iterators and add a better toast when there is no audio stream for external players
This ensures to not remove streams from the StreamInfo lists themselves, and so to not have to create list copies.

The toast shown in RouterActivity, when there is no audio stream available for external players, is now shown, in the same case, when pressing the background button in VideoDetailFragment.
2022-06-17 22:01:29 +02:00
AudricV
c0b4c41aff Use StreamTypeUtil where possible and add isAudio and isVideo to this utility class 2022-06-17 22:01:26 +02:00
Stypox
beeb8ae24b Add comments to PlaybackResolver and remove useless @NonNull 2022-06-17 22:00:52 +02:00