Commit graph

988 commits

Author SHA1 Message Date
Isira Seneviratne
c0a2b6c1f3 Use OnClickListener and OnLongClickListener lambdas in the player UIs. 2022-11-03 05:09:35 +05:30
Stypox
86d5214e72 Merge pull request #9203 from Callisto404/add-chapter-timestamp-share
Added timestamped link sharing from the start of a chapter with a long hold press
2022-10-30 22:31:09 +01:00
Daniel M
8e08c2abd0 Added an "isYouTube" check to start of long click handler 2022-10-30 13:48:03 +11:00
Stypox
fd1237698d Merge pull request #8747 from Isira-Seneviratne/Range_limit
Use range-limiting methods in more places.
2022-10-28 10:34:04 +02:00
Daniel M
2b9df99617 Added sharing a link with timestamp from a chapter into the long click for each chapter 2022-10-24 14:14:41 +11:00
Tobi
d697191086 Merge pull request #8946 from HybridAU/add_play_queue_button_to_video_details_fragment
Add play queue button to video details fragment
2022-10-06 18:55:50 +02:00
HybridAU
dcca274ecc Add play queue button to video details fragment
* Add play queue button to video details fragment

* Use existing ic_list icon

* Still open play queue even when queue is empty

* Change app:srcCompat to android:src
2022-09-14 21:00:44 +08:00
Stypox
0e5ad2ec3a Only update notification large icon when it changes 2022-08-28 23:14:02 +02:00
Stypox
3cdc9154ea Use player.getThumbnail() instead of field in VideoPlayerUi 2022-08-28 18:35:21 +02:00
Stypox
9d45c80324 Remove thumbnail before sync, if outdated
Also refactor onPlaybackSynchronize and add comments
2022-08-28 18:32:27 +02:00
Stypox
2fd24b745d Unify onThumbnailLoaded calls to ensure UIs always updated 2022-08-28 17:24:51 +02:00
litetex
cac64a9964 Fixed sonar detected problems
+ Automatically fixed code style (imports)
2022-08-25 17:02:53 +02:00
Stypox
624292abe4 Review suggestions 2022-08-25 17:02:53 +02:00
Stypox
ce1b88eeec Keep strong reference to Picasso thumbnail loading target
Before the Target would sometimes be garbage collected before being called with the loaded thumbnail, since Picasso holds weak references to targets
2022-08-25 17:02:52 +02:00
Stypox
573b4ff8bc Merge MediaSessionManager into MediaSessionPlayerUi 2022-08-25 17:02:52 +02:00
Stypox
c8066c6eb7 Let exoplayer decide when to update metadata
Though still make sure metadata is updated after the thumbnail is loaded.
This fixes the wrong seekbar properties (duration and current position) being shown in the notification sometimes.
2022-08-25 17:02:52 +02:00
Stypox
a4c5d1ee3b Remove useless checks before updating metadata
A while ago NewPipe called the metadata update function very often, so checks were needed to ensure not wasting time updating metadata if it were already up to date. Now, instead, the metadata update function is called exactly when needed, i.e. when metadata changes, so such checks are not needed anymore (and were probably also a little resource-heavy).
2022-08-25 17:02:51 +02:00
Stypox
1a4e886d4b Even when thumbnails should not be shown, set it to null in notification
This makes sure the thumbnail is removed from the notification if the user disables thumbnails
2022-08-25 17:02:51 +02:00
Stypox
9fe370cda1 Fix sometimes seeing outdated thumbnail in notification
Before the thumbnail finishes loading for the new video the player is now playing, the old thumbnail was being used, leading to wrong thumbnails set in the media session and the notification.
2022-08-25 17:02:51 +02:00
Stypox
356fa3f12d Fix thumbnail sometimes not set to media session metadata
The thumbnail was not being updated in the media session metadata after it was loaded, since there was no metadata update in that case, only a notification update.
2022-08-25 17:00:41 +02:00
Stypox
97892be897 Remove useless MediaSessionCallback
The player is now passed directly, it made no sense to wrap around it in a callback that was not really a callback but rather, actually, a wrapper.
2022-08-25 17:00:41 +02:00
Stypox
aa0a1cd70e Create MediaSessionPlayerUi 2022-08-25 17:00:41 +02:00
Isira Seneviratne
2e350c9675 Use range-limiting methods in more places. 2022-08-08 07:10:16 +05:30
Stypox
2fac881694 Merge pull request #8724 from Isira-Seneviratne/toArray_improvements
Use toArray() with zero-length arrays.
2022-08-06 11:33:05 +02:00
Isira Seneviratne
fbf3df2c60 Applied code review changes. 2022-08-05 06:54:03 +05:30
Isira Seneviratne
b49b8f325d Use toArray() with zero-length arrays. 2022-08-05 06:50:55 +05:30
Isira Seneviratne
177dffdcbd Replace coerceIn() with MathUtils.clamp(). 2022-08-05 06:19:06 +05:30
Stypox
4cfc1765f7 Merge pull request #8656 from Isira-Seneviratne/Use_WindowMetrics
Use WindowMetrics API.
2022-08-04 10:12:32 +02:00
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
Isira Seneviratne
c99b2e21b9 Use WindowMetrics API in VideoDetailFragment and PopupPlayerUi. 2022-07-30 19:22:39 +05:30
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