1
0
mirror of https://github.com/TeamNewPipe/NewPipe synced 2024-07-02 18:13:19 +00:00
Commit Graph

1081 Commits

Author SHA1 Message Date
Stypox
73aebc1110
Merge pull request #9847 from Redirion/exo183
Update to ExoPlayer 2.18.3
2023-02-26 19:16:25 +01:00
Stypox
a4767fc48a
Listen to ignore hardware buttons pref changes 2023-02-26 14:28:57 +01:00
Nyan Cat
42d861688e
Implement Ignore hardware media button events option 2023-02-26 14:02:50 +01:00
Stypox
097c2368f4
Merge pull request #8180 from Trust04zh/fix-4053-8176
Make UI behavior for playback information display more consistent
2023-02-26 13:22:13 +01:00
Stypox
600ebdae18
Correctly open urls in browser on Android 11+
- Fix misconfiguration in manifest ('http|https|market' is not valid)
- Split ShareUtils functions taking a boolean parameter into pairs of functions with better names and less runtime checks
- Move all Kore-related functions to KoreUtils
- Remove the toast_no_player string
2023-02-25 09:13:59 +01:00
Robin
5560cea470 Update to ExoPlayer 2.18.3 2023-02-23 12:46:05 +01:00
Stypox
39c500f33c
Revert "Use WindowCompat." 2023-02-14 08:27:04 +01:00
Stypox
e0cb2892b8
Merge branch 'master' into dev 2023-02-08 22:48:14 +01:00
Trust_04zh
e947e86eae
Make positions in list depend on watch history, remove confusing animations
The following is the list of all commits squashed together:

Regain function for option `Positions in lists`

use option `Resume playback` to control display of progress info in VideoDetailFragment, remove this (extra) function from option `Positions in lists`.
remove extra check for live streams, live streams updates just as non-live streams.

fix #8176 by eliminating exit delay

Regain function for option `Positions in lists`

update code with developer's comments

 apply static import to methods in util class DependentPreferenceHelper

Regain function for option `Positions in lists`

use option `Resume playback` to control display of progress info in VideoDetailFragment, remove this (extra) function from option `Positions in lists`.
remove extra check for live streams, live streams updates just as non-live streams.

fix behavior for displaying progress bar when autoplay off but video resume on

not to retrieve unnecessary states when position in lists disabled

fix mistake in code

simplify conditional logic

update doc comment and remove unused method

Fix not showing duration if position indicators disabled

Positions in lists only depends on watch history
2023-02-07 09:48:18 +01:00
Tobi
e0ba872b66 Revert "Update ExoPlayer to 2.18.2"
This commit reverts 1bb166a
2023-02-03 18:33:35 +01:00
Stypox
1e724eba6c
Merge pull request #9706 from Jared234/9131_bug_background_player
Fixed a bug that caused the background player to stop working
2023-01-28 21:56:00 +01:00
Jared Fantaye
5b3f8a3d30 Replaced the equals method 2023-01-21 14:56:55 +01:00
Jared Fantaye
ddda80a577 Fixed the bug 2023-01-17 22:31:22 +01:00
Robin
9ecd5dff09 Orientation is locked if there is no sensor for it 2023-01-16 13:56:45 +01:00
Stypox
abe6dfb99c
Merge pull request #9671 from Stypox/fix-toast-crash-api33
Fix popup enablement toast crash on API 33
2023-01-15 21:05:05 +01:00
Stypox
51af961e0d
Merge pull request #8894 from Isira-Seneviratne/WindowCompat
Use WindowCompat.
2023-01-15 15:14:05 +01:00
Isira Seneviratne
f766ef2033 Replace the system UI visibility flags with WindowCompat calls. 2023-01-15 05:44:45 +05:30
Stypox
062570cc47
Merge pull request #8886 from Isira-Seneviratne/Remove_Runnable_variables
Remove Runnable variables for Handlers.
2023-01-12 15:34:12 +01:00
Isira Seneviratne
9514316be3
Remove Runnable variables for Handlers. 2023-01-12 15:30:19 +01:00
Stypox
b6e6d39985
Fix toast crash on API 33
You shouldn't call getView() on toasts.
Also simplified some duplicate code.
2023-01-12 11:39:25 +01:00
Stypox
ad605e2c5a
Actually there is no need to use flatMap
`null` values returned in the lambda are converted to empty `Optional`s in the `map` method: https://developer.android.com/reference/java/util/Optional#map(java.util.function.Function%3C?%20super%20T,%20?%20extends%20U%3E)
2023-01-11 15:26:46 +01:00
Stypox
9c7ed80662
Use Optional.map correctly and other improvements 2023-01-11 14:47:53 +01:00
Isira Seneviratne
e8216b2e80 Apply code review suggestions. 2023-01-04 06:10:14 +05:30
Isira Seneviratne
e3062d7c66 Use Optional chaining. 2023-01-04 05:16:21 +05:30
Isira Seneviratne
fd55d85bbf Remove SimplifyOptionalCallChains. 2023-01-04 05:16:21 +05:30
Stypox
1bb166a9e8
Merge pull request #9553 from Redirion/exo182
Update ExoPlayer to 2.18.2
2023-01-02 18:21:53 +01:00
Stypox
7454b31788
Merge pull request #9562 from bravenewpipe/use-videostream-for-audio-only-background-playback
Support audio only background for services only supporting video streams
2023-01-02 17:51:10 +01:00
Robin
f17155bb3f
Merge branch 'TeamNewPipe:dev' into exo182 2023-01-02 10:35:20 +01:00
Stypox
367ece8ffa
Merge pull request #9496 from Jared234/9437_continue_playing_while_seeking
Seeking no longer pauses the played video
2022-12-31 19:19:21 +01:00
Stypox
661cd4c182
Merge pull request #9159 from Isira-Seneviratne/Refactor_VideoPlayerUi
Refactor VideoPlayerUi.
2022-12-31 19:01:19 +01:00
Stypox
69e8e4d63e
Merge pull request #9306 from Stypox/target-api-33
Set compileSdk and targetSdk to 33 (Android 13)
2022-12-31 14:49:30 +01:00
Stypox
231e677b16
Merge pull request #8895 from Isira-Seneviratne/SparseArrayCompat
Use SparseArrayCompat.
2022-12-28 20:37:05 +01:00
evermind
dfc46c3b6c Support audio only background for services only supporting video streams
Some services may only have video streams and no separate audio streams available.
This commit will add audio background playback support for those services.
It uses the video source as audio source for background playback.
2022-12-17 21:17:42 +01:00
Robin
eea4f0f41c Update ExoPlayer to 2.18.2 2022-12-16 17:53:56 +01:00
Jared Fantaye
12796920a3 Removed the wasPlaying variable 2022-12-10 21:56:04 +01:00
Isira Seneviratne
161007fe92 Merge branch 'dev' into Refactor_VideoPlayerUi 2022-12-06 20:21:08 +05:30
Douile
e5f30a07bf
Only show "Enqueue next" when in the middle of the queue
Add a check that the queue position is not the last in the queue before
showing "Enqueue next".

Previously the "Enqueue next" action would always be shown if the queue
length was greater than one, this meant even if you were at the end of
the queue (when "Enqueue" would have the same effect as "Enqueue next")
the action would still be shown.
2022-12-04 18:20:50 +01:00
Isira Seneviratne
b0516fbf1d
Use BitmapCompat.createScaledBitmap(). 2022-11-29 15:56:19 +01:00
Jared Fantaye
e5af1c93ae Seeking no longer pauses the played video 2022-11-26 15:35:13 +01:00
Isira Seneviratne
8db90ba449 Use SparseArrayCompat for thumbnails. 2022-11-22 17:51:54 +05:30
Stypox
048b0972de Set compileSdk and targetSdk to 33 (Android 13)
android:exported in now required in the manifest on all activities/services/receivers/providers. It was set to true for those that need to interact with outside apps or the OS, while others have exported=false.
This also required updating LeakCanary to the latest version as the older version being used was not using android:exported in AndroidManifest.xml.
2022-11-18 08:33:13 +01:00
Isira Seneviratne
a7989795e8 Merge branch 'dev' into Refactor_VideoPlayerUi 2022-11-14 08:59:03 +05:30
Isira Seneviratne
3dc1adb69e Add helper methods for adding PendingIntent mutability. 2022-11-07 17:12:22 +05:30
Isira Seneviratne
e333197ed5 Use OnClickListener and OnLongClickListener lambdas in the player UIs. 2022-11-03 05:09:35 +05:30
Stypox
9d2ab61993
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
7f3da04fee Added an "isYouTube" check to start of long click handler 2022-10-30 13:48:03 +11:00
Stypox
9524c6245d
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
83357ca67e 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
8bc8355b68
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
9db0133a5b
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
ed87465565
Only update notification large icon when it changes 2022-08-28 23:14:02 +02:00
Stypox
f9109ebc81
Use player.getThumbnail() instead of field in VideoPlayerUi 2022-08-28 18:35:21 +02:00
Stypox
4a7af6f9ac
Remove thumbnail before sync, if outdated
Also refactor onPlaybackSynchronize and add comments
2022-08-28 18:32:27 +02:00
Stypox
7fbef35daa
Unify onThumbnailLoaded calls to ensure UIs always updated 2022-08-28 17:24:51 +02:00
litetex
59d1ded94e Fixed sonar detected problems
+ Automatically fixed code style (imports)
2022-08-25 17:02:53 +02:00
Stypox
973a966011 Review suggestions 2022-08-25 17:02:53 +02:00
Stypox
510efaae97 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
11bd2369e5 Merge MediaSessionManager into MediaSessionPlayerUi 2022-08-25 17:02:52 +02:00
Stypox
f80d1dc48d 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
8bff445ec3 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
d73ca41cfe 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
f3a9b81b67 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
3cc43e9fb9 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
bc33322d4b 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
c054ea0737 Create MediaSessionPlayerUi 2022-08-25 17:00:41 +02:00
Isira Seneviratne
e136a6f915 Use range-limiting methods in more places. 2022-08-08 07:10:16 +05:30
Stypox
6f86e21605
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
a9af1dfdd2 Applied code review changes. 2022-08-05 06:54:03 +05:30
Isira Seneviratne
fc46233baf Use toArray() with zero-length arrays. 2022-08-05 06:50:55 +05:30
Isira Seneviratne
2eec2e9128 Replace coerceIn() with MathUtils.clamp(). 2022-08-05 06:19:06 +05:30
Stypox
ffc1d9a212
Merge pull request #8656 from Isira-Seneviratne/Use_WindowMetrics
Use WindowMetrics API.
2022-08-04 10:12:32 +02:00
Stypox
a548b34811
Merge pull request #8692 from TacoTheDank/bumpMaterial
Update Google Material to 1.6.1
2022-08-02 11:05:24 +02:00
Stypox
ad30eb809c
Merge branch 'dev' into bumpFragment 2022-08-02 10:54:39 +02:00
Isira Seneviratne
4d7a6fb6de Use WindowMetrics API in VideoDetailFragment and PopupPlayerUi. 2022-07-30 19:22:39 +05:30
TacoTheDank
d66997c2ed Update Google Material to 1.6.1 2022-07-24 16:51:26 -04:00
TacoTheDank
d7a654fc27 Update AndroidX Fragment to 1.4.1 2022-07-24 15:35:33 -04:00
TacoTheDank
229422bfa9 Update ExoPlayer to 2.18.1 2022-07-24 14:11:31 -04:00
Isira Seneviratne
8b400b48f7 Refactor notifying method in PlayQueue. 2022-07-21 08:02:23 +05:30
Stypox
cacce6d2d0
Merge pull request #8651 from Isira-Seneviratne/Use_limiting_methods
Use range-limiting methods.
2022-07-20 15:06:45 +02:00
Stypox
373ee53143
Improve code style 2022-07-20 15:05:25 +02:00
Isira Seneviratne
394eb92e71 Use coerceIn(). 2022-07-20 05:36:01 +05:30
Isira Seneviratne
d62cdc659f Use MathUtils.clamp().
Co-authored-by: Stypox <stypox@pm.me>
2022-07-20 05:36:01 +05:30
Isira Seneviratne
a6cc13845a Use Map.of(). 2022-07-20 04:39:11 +05:30
Isira Seneviratne
ca26fcb0eb Use List.of(). 2022-07-20 04:39:11 +05:30
litetex
3ba04f179f Fixed conflicts/build 2022-07-15 20:00:08 +02:00
litetex
8b209df253 Changed the code accordingly
+ Removed some unused code
2022-07-15 19:55:19 +02:00
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
4443c908cb
Fix SonarLint java:S5320, restrict broadcasts to app package 2022-07-13 23:33:18 +02:00
Stypox
c03eac1dc9
Some SonarLint refactors 2022-07-13 23:33:18 +02:00
Stypox
61c1da144e
Some refactorings after review comments 2022-07-13 23:33:18 +02:00
Stypox
3692858a3d
Move popup layout param to PopupPlayerUi 2022-07-13 23:33:18 +02:00
Stypox
9c51fc3ade
Move functions to get Android dimen to ThemeHelper 2022-07-13 23:33:18 +02:00
Stypox
1cf746f721
Fix volume gestures not working anymore 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
6559416bd8
Improve //region comments in player UIs 2022-07-13 23:30:30 +02:00
Stypox
fa25ecf521
Add comment about broadcast receiver 2022-07-13 23:27:24 +02:00