Commit Graph

1088 Commits

Author SHA1 Message Date
Isira Seneviratne 097d32b684 Migrate to non-transitive R classes. 2024-03-25 15:12:30 +01:00
Stypox 4b1824e8c1
Allow play/pausing from notification when buffering
This change is in line with a recent change in how the play/pause button behaves in the player ui: if the buffering indicator is shown, it's still possible to toggle play/pause, to allow e.g. pausing videos before they even start.
This change was needed because on Android 13+ notification actions can't be null, and thus the buffering hourglass action wasn't shown.
2023-12-29 16:18:26 +01:00
Stypox 17e88f1749
Do not update notification actions if nothing changed
This should avoid costly updates of the media session.
2023-12-29 16:16:45 +01:00
Stypox 5edafca05a
Implement notification actions via MediaSessionConnector on Android 13+ 2023-12-29 15:54:15 +01:00
Stypox 2c4c283099
Extract NotificationActionData from NotificationUtil 2023-12-29 15:54:15 +01:00
Stypox 9fb8125655
Allow each notification slot to contain any possible action 2023-12-29 15:54:15 +01:00
Isira Seneviratne f3b458c803
Bump compileSdk to 34 2023-12-23 11:38:32 +01:00
TobiGr e6965622bd
Fix crash with disabled thumbnails when trying to play a stream 2023-12-10 15:12:38 +01:00
Stypox 3dc593fe88
Merge pull request #10577 from AudricV/fix-npe-play-queue-audio-track-menu
Fix crash when building the play queue audio track menu if the player is null
2023-11-16 09:01:11 +01:00
AudricV 84d50da009
Restore player service start handling before player UI separation
This behavior was present before 0.24.0 and the player UI separation and
avoided crashes for which their exception contained
"Context.startForegroundService() did not then call Service.startForeground()".

Some player nullability checks have been also added, and the player service is
now stopped when it has been started from a media button and there is nothing
to play.
2023-11-15 23:21:20 +01:00
AudricV 2cf7764714
Fix crash when building the play queue audio track menu if the player is null
As the player can be null in some cases, we have to make sure that the player
is not null, by using Optionals on the player itself instead of its methods
returning Optionals.

If the player is null, the play queue audio track menu will now be hidden.
2023-11-15 21:45:56 +01:00
Stypox 37af2c87e8
Fix possible NPE in PlayQueueNavigator 2023-09-22 10:14:44 +02:00
Stypox 35073c780d
Implement better image selection strategy 2023-09-22 10:14:44 +02:00
Stypox 0a8f28b1c6
Add image quality preference 2023-09-22 10:14:43 +02:00
Stypox af2375948d
Support obtaining multiple images from the extractor 2023-09-22 09:57:33 +02:00
TobiGr 2a1b506d98 Improved accessibility of player interfaces 2023-09-21 12:20:00 +02:00
TobiGr 748c2babe9 Add comments and annotations 2023-09-20 15:41:21 +02:00
TacoTheDank b1faed586d Replace MathUtils.clamp with Kotlin coerceIn 2023-09-19 16:32:37 -04:00
TobiGr 57eaa1bbe1
Apply review
Co-Authored-By:  Audric V <74829229+AudricV@users.noreply.github.com>
2023-09-18 23:22:32 +02:00
Stypox 78b4b9441e
Update NewPipeExtractor and adapt imports 2023-09-18 23:22:32 +02:00
Stypox c076a0f771
Channels are now an Info
The previous "main" tab is now just a normal tab returned in getTabs().
Various part of the code that used to handle channels as ListInfo now either take the first (playable, i.e. with streams) tab (e.g. the ChannelTabPlayQueue), or take all of them combined (e.g. the feed).
2023-09-18 23:22:32 +02:00
AudricV 2d16a06bc4
Show play queue button in main player when there is one stream 2023-08-30 19:45:53 +02:00
TobiGr db5ed48dbb Fix some sonar warnings and make some smaller improvements 2023-08-14 23:09:50 +02:00
J-Stutzmann c06d61a83c Made audio-focus calls respect mute state. 2023-08-02 23:44:23 -04:00
TobiGr bc4f0c699f Ignore false positive inspection 2023-08-02 20:44:30 +02:00
AudricV 5ab3a4a9e0
Refactor Player.useVideoSource logic and improve its comments
- don't check for isAudioOnly == !videoEnabled, as this prevents enabling again
video and text tracks renderers in some cases;
- when reloading play queue manager if that's needed, disable or enable video
and text tracks renderers, as they may need to be enabled again in some cases
like starting a video in main player, opening play queue, switching to
background player on it and switching back to main player;
- disable or enable video renderers also for streams with AUDIO_STREAM
StreamType, as doing so doesn't raise any issue and simplifies code;
- reword and move some comments to make them easier to understand.
2023-07-19 22:52:18 +02:00
Stypox 00257e969e
Fix PlayerService leakead by Binder instance
Also see https://stackoverflow.com/q/63787707
2023-07-14 18:34:20 +02:00
ThetaDev 22671ca16c fix: audio stream cache key, code fmt 2023-05-01 00:04:04 +02:00
ThetaDev c377ffbce8 Merge branch 'dev' of github.com:TeamNewPipe/NewPipe into alang-selector 2023-04-21 23:32:33 +02:00
ThetaDev b567d428ad fix: small codestyle fixes 2023-04-21 23:15:37 +02:00
ThetaDev 2edc223e77 Merge branch 'dev' into alang-selector 2023-04-17 23:01:07 +02:00
TobiGr e18a6b09f8 Apply new itag filter only to YouTube streams 2023-04-17 13:10:29 +02:00
TobiGr f8c3ec4be7 Use a whitelist to filter all streams retrieved by the extractor.
NewPipe Extractor now extracts all YouTube Itags and therefore only those which can be handled by the player need to be retrieved from the list of all available streams.
2023-04-17 13:00:11 +02:00
Stypox ba3afd1e35
Merge pull request #10021 from Isira-Seneviratne/PendingIntentCompat
Switch to AndroidX's PendingIntentCompat.
2023-04-14 14:20:47 +02:00
Isira Seneviratne acebabd028 Use AndroidX's PendingIntentCompat class. 2023-04-13 10:53:46 +05:30
AudricV 787758a436
[Android 6+] Add ability to always use ExoPlayer's MediaVideoCodecRenderer setOutputSurface workaround
As some devices not present in ExoPlayer's list may not implement
MediaCodec.setOutputSurface(Surface) properly, this workaround could be useful
on these devices.

It forces ExoPlayer to fall back on releasing and re-instantiating video codec
instances, which is always used on Android 5 and lower due to addition of this
method in Android 6.

To do so, a CustomMediaCodecVideoRenderer, based on ExoPlayer's
MediaVideoCodecRenderer which always return true for the
codecNeedsSetOutputSurfaceWorkaround method has been added, which is used in
CustomRenderersFactory, a class based on DefaultRenderersFactory which always
returns our CustomMediaCodecVideoRenderer as the video renderers.

CustomRenderersFactory replaces DefaultRenderersFactory in the player, in the
case this setting is enabled.
2023-04-10 17:39:27 +02:00
AudricV a6ff85a208
Move media tunneling setting to ExoPlayer settings and make this setting available on release builds
Media tunneling may be not supported by more devices than the ones we
whitelisted before.

As a matter of fact, the list of devices on which media tunneling is disabled
could be not maintainable in the future, especially if the list of devices
grows more and more.

A preferable solution is to allow users to configure this setting themselves,
allowing them to not wait for their device(s) to be whitelisted in a future
NewPipe update.

This solution has been applied in this commit and works on every build type.

The corresponding preference in the debug settings has been of course removed
and the code used to prevent media tunneling activation on specific devices has
been removed.
2023-04-10 17:37:30 +02:00
AudricV 41da8fc05f
Add ability to use ExoPlayer's decoder fallback option
This option could help to avoid decoder initialization issues, which falls back
to lower-priority decoders if decoder initialization fails. This may result in
poor playback performance than when using primary decoders.

It is disabled by default, but can be enabled in ExoPlayer settings.
2023-04-10 17:37:30 +02:00
ThetaDev 365bb2d0e4 Merge branch 'dev' of github.com:TeamNewPipe/NewPipe into alang-selector 2023-04-05 14:06:14 +02:00
ge78fug 32cec6c9a7 Changed the naming 2023-04-04 09:57:06 +02:00
Marius Wagner 72ca52a29b Made the requested changes 2023-04-04 09:57:06 +02:00
ge78fug 2ded8c7cc1 Made two list options 2023-04-04 09:57:06 +02:00
ge78fug 759a9080a8 Fixed a bug 2023-04-04 09:57:06 +02:00
ge78fug 2ba649949f Updated the gesture-switch-toggle 2023-04-04 09:57:06 +02:00
ge78fug c8d54ec6c7 Changed to val 2023-04-04 09:57:06 +02:00
Marius Wagner 96e9242431 Update app/src/main/java/org/schabi/newpipe/player/gesture/MainPlayerGestureListener.kt
Co-authored-by: Stypox <stypox@pm.me>
2023-04-04 09:57:06 +02:00
ge78fug 3c74cb3439 Created a setting to switch the sides of volume and brightness 2023-04-04 09:57:06 +02:00
ThetaDev d010384c88 Merge branch 'dev' of github.com:TeamNewPipe/NewPipe into alang-selector 2023-04-03 22:13:16 +02:00
Stypox 02906e8132
Merge pull request #9812 from TeamNewPipe/revert-8894-WindowCompat
Revert "Use WindowCompat."
2023-04-03 14:23:17 +02:00
ThetaDev dbd6e4d11f fix: sonarcloud lint 2023-03-19 22:55:37 +01:00