Commit Graph

713 Commits

Author SHA1 Message Date
ThetaDev fdd3b03fe5 fix: audio stream format selection 2023-03-19 23:47:33 +01:00
ThetaDev dbd6e4d11f fix: sonarcloud lint 2023-03-19 22:55:37 +01:00
ThetaDev 61a14765f3 fix: ListHelper tests 2023-03-19 22:31:31 +01:00
ThetaDev 9b8ffdd2aa fix: improve track name localization 2023-03-19 21:20:21 +01:00
ThetaDev 7aed2eed8a feat: add prefer original option, improve audio stream ordering 2023-03-19 20:40:27 +01:00
ThetaDev 87a88e4df7 feat: localized audio track names 2023-03-19 15:45:52 +01:00
ThetaDev 366c39d4c6 feat: add language selector to audio player 2023-03-19 01:15:36 +01:00
ThetaDev 77649d388c fix: reduce complexity 2023-03-18 16:29:22 +01:00
ThetaDev 208887d538 feat: improve audio track sorting, add prefer_descriptive_audio option 2023-03-18 14:50:19 +01:00
ThetaDev de7872d8f2 feat: add audio language selector 2023-03-17 21:51:40 +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 be4f3d9d62
Improve javadocs in ShareUtils 2023-02-25 13:14:31 +01:00
Stypox 24ff6a4313
Rename videoURL to streamUrl 2023-02-25 13:14:31 +01:00
Stypox c2968a3ff2
Use non-deprecated resolveActivity method on API 33+
But such method is not available before API 33
2023-02-25 13:14:31 +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
Stypox 4cc653fdf1
Fix opening links on Android 12+ 2023-02-07 22:39:12 +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
Stypox cd12503f99
Merge pull request #9631 from TeamNewPipe/update-npe
Update NewPipeExtractor and properly linkify comments
2023-01-28 22:40:19 +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 489df0ed7d
Update NewPipeExtractor and properly linkify comments 2023-01-15 19:27:56 +01:00
Mahendran 7924bb5b6b Thumbnails used in NewPipe are small (list/grid) mode. This PR facilitates full width thumbnails and dubbed as card mode. 2023-01-15 22:32:03 +05:30
Stypox 22c201be39
Create text subpackage in util 2023-01-15 11:51:07 +01:00
AudricV cdd5e89b86
Add ability to copy hashtags, URLs and timestamps in descriptions on long-press
This commit adds the ability to copy to clipboard hashtags, URLs and timestamps
when long-pressing them.

Some changes in our TextView class related to text setting have been required
and metadata items are now using a NewPipeTextView instead of a standard
TextView.

Six new classes have been added:

- a custom LinkMovementMethod class;
- a custom ClickableSpan class, LongPressClickableSpan, in order to set a long
  press event;
- a class to avoid code duplication in CommentTextOnTouchListener, TouchUtils;
- three implementations of LongPressClickableSpan used when linkifying text:
  - HashtagLongPressClickableSpan for hashtags;
  - TimestampLongPressClickableSpan for timestamps;
  - UrlLongPressClickableSpan for URLs.
2023-01-15 11:40:27 +01:00
Stypox a15a5adacc
Merge pull request #9619 from Redirion/avoidreflectionifpossible
Check availability of Samsung DeX only on Samsung devices
2023-01-12 12:06: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
petlyh edff696ecc
Ask for permission when enqueuing in a popup 2023-01-10 14:16:19 +01:00
Robin f10d591462 Samsung DeX should only be checked on Samsung devices
Co-authored-by: opusforlife2 <53176348+opusforlife2@users.noreply.github.com>
2023-01-03 15:12:02 +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
Isira Seneviratne b0516fbf1d
Use BitmapCompat.createScaledBitmap(). 2022-11-29 15:56:19 +01:00
Stypox 9d01d88eed
Request permission to send notifications 2022-11-28 18:49:11 +01:00
AudricV 6b89b44dcd
Merge pull request #8961 from dhruvpatidar359/Toast-Popup
Remove the redundant/overlapping toast "Copied to clipboard" for Android 13+
2022-11-26 21:33:12 +01:00
Isira Seneviratne d6617007d4 Use SparseArrayCompat instead of SparseArray in StreamItemAdapter.
Make additional small improvements as well.
2022-11-22 18:31:58 +05:30
Isira Seneviratne aad5e26f31
Merge pull request #8870 from Isira-Seneviratne/Locale_forLanguageTag
Use Locale.forLanguageTag().
2022-11-10 19:56:34 +05:30
AudricV abf1cc536d
Improve code of DeviceUtils.isDesktopMode
- Avoid NullPointerException crashes if there is no UiModeManager or desktop
system service mode
- Use final for every exception
- Suppress missing fields warnings
- Add missing NonNull annotation
2022-11-09 16:22:49 +01:00
cybersphinx c38f150562
Remove now obsolete API check. 2022-11-09 15:50:09 +01:00
cybersphinx d2b6bda7a2
Remove errant return. 2022-11-09 15:50:09 +01:00
cybersphinx 9e5c68c575
Add check for input devices with cursor. 2022-11-09 15:50:06 +01:00
Hanif Shersy 88eed6cc23
Add JSDoc comment and a performance note for `isDesktopMode` 2022-11-09 15:48:50 +01:00
Hanif Shersy 5e2ef7ff0d
Address review comments 2022-11-09 15:44:36 +01:00
Hanif Shersy cfda073aa5
Fix DeX mode check 2022-11-09 15:44:36 +01:00
Hanif Shersy ff774a1870
Fix persistent hover overlay when mouse connected 2022-11-09 15:44:27 +01:00
Isira Seneviratne 5c1af6d296 Group private Localization methods together. 2022-11-09 08:54:47 +05:30
Isira Seneviratne 6d812b86aa Use Locale.forLanguageTag(). 2022-11-09 08:51:12 +05:30
dhruvpatidar359 ef35b36eba
Remove the redundant/overlapping toast "Copied to clipboard" for Android 13+
Signed-off-by: dhruv <dhruvpatidar35@gmail.com>

Co-authored-by: Tobi <TobiGr@users.noreply.github.com>
Co-authored-by: AudricV <74829229+AudricV@users.noreply.github.com>
2022-11-08 20:47:50 +01:00
Isira Seneviratne 3dc1adb69e Add helper methods for adding PendingIntent mutability. 2022-11-07 17:12:22 +05:30
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
Stypox ea875c59af
Deduplicate isGridLayout calls 2022-10-27 17:25:06 +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 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 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 52dbfdee00 Keep strong references to Picasso notification icon loading targets
Before the Target would sometimes be garbage collected before being called with the loaded channel icon, since Picasso holds weak references to targets. This meant that sometimes a new streams notification  would not be shown, because the lambda that should have shown it had already been garbage collected.
2022-08-25 16:41:51 +02:00
Stypox 571bf397c5
Merge pull request #8666 from TacoTheDank/filepicker
Update FilePicker to our custom fork and disable Jetifier
2022-08-12 09:15:34 +02:00
Isira Seneviratne e136a6f915 Use range-limiting methods in more places. 2022-08-08 07:10:16 +05:30
Stypox edd2b110b0
Merge pull request #8738 from Isira-Seneviratne/Collectors_joining
Use Collectors.joining().
2022-08-06 22:31:31 +02:00
Stypox ebd06bdd24
Improve comment 2022-08-06 11:56:00 +02:00
Isira Seneviratne 5c7dfd1d69 Remove unused method. 2022-08-06 06:54:21 +05:30
Isira Seneviratne 7aacaf8c38 Use Collectors.joining(). 2022-08-06 06:54:21 +05:30
Isira Seneviratne 059cfcbad2 Use Comparator factory methods in ListHelper. 2022-08-05 05:36:21 +05:30
Stypox 1a8f396e77
Merge pull request #8721 from Isira-Seneviratne/OnClickGesture_interface
Make OnClickGesture an interface.
2022-08-04 16:15:54 +02:00
Isira Seneviratne 47f58040d1 Make OnClickGesture an interface. 2022-08-01 06:47:00 +05:30
Isira Seneviratne 4d7a6fb6de Use WindowMetrics API in VideoDetailFragment and PopupPlayerUi. 2022-07-30 19:22:39 +05:30
TacoTheDank 8f5d564f84 Migrate NoNonsense-FilePicker to our updated fork 2022-07-24 15:07:31 +02:00
litetex 51e72d1a05
Removed the "(beta)"-tag from services (#8637) 2022-07-24 15:57:23 +03:00
Stypox 3281ed2ef1
Merge pull request #8648 from Isira-Seneviratne/Use_IO_extensions
Use IO extensions.
2022-07-22 18:30:51 +02:00
Stypox f4fe5fcb16
Fix ListHelperTest failure caused by immutable list being used 2022-07-22 16:09:43 +02:00
Isira Seneviratne b845645b80 Use IO extensions.
Co-authored-by: Stypox <stypox@pm.me>
2022-07-21 05:15:39 +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
Isira Seneviratne d62cdc659f Use MathUtils.clamp().
Co-authored-by: Stypox <stypox@pm.me>
2022-07-20 05:36:01 +05:30
Isira Seneviratne ca26fcb0eb Use List.of(). 2022-07-20 04:39:11 +05:30
Isira Seneviratne c53143ef4f Use Set.of(). 2022-07-19 08:53:15 +05:30
litetex 3890d0abdb Added note that explains that unused code was removed. 2022-07-15 19:55:19 +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
krlvm 35eeccd45a
Rename buddy.xml to dummy_person.xml 2022-07-14 14:14:32 +02:00
krlvm cc7a8fb1a6
Improve image placeholders
- Show placeholders until the image is loaded because timeout can be very long and missing profile pictures and video thumbnails make app inconvenient to use

- Adapt profile picture and video thumbnail placeholders to light theme

- Replace profile picture and video thumbnail placeholders with vector graphics
2022-07-14 14:14:32 +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 9c51fc3ade
Move functions to get Android dimen to ThemeHelper 2022-07-13 23:33:18 +02:00
Stypox 76ced59b62
Refactor player: separate UIs and more 2022-07-13 23:25:26 +02:00
litetex 99104fc11d
Clean up pre-Lollipop checks 2022-07-13 19:02:24 +02:00
nikita.artikhovich a4724fec4a
Add download option to long-press menu 2022-07-06 11:42:57 +02:00
litetex ad97b3d995 Use correct ``NonNull`` 2022-06-22 19:54:46 +02:00
litetex 04e8e03d8f Fix compile errors 2022-06-22 19:47:03 +02:00
Stypox 4e87f5aabc
Remove misleading first "Non" from getNonUrlAndNonTorrentStreams 2022-06-18 18:52:32 +02:00
AudricV 036196a487
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 73855cacb7
Use StreamTypeUtil where possible and add isAudio and isVideo to this utility class 2022-06-17 22:01:26 +02:00
Stypox 8dad6d7e1c
Code improvements here and there 2022-06-17 22:00:53 +02:00
AudricV 210834fbe9
Add support of other delivery methods than progressive HTTP (in the player only)
Detailed changes:

- External players:

  - Add a message instruction about stream selection;
  - Add a message when there is no stream available for external players;
  - Return now HLS, DASH and SmoothStreaming URL contents, in addition to progressive HTTP ones.

- Player:

  - Support DASH, HLS and SmoothStreaming streams for videos, whether they are content URLs or the manifests themselves, in addition to progressive HTTP ones;
  - Use a custom HttpDataSource to play YouTube contents, based of ExoPlayer's default one, which allows better spoofing of official clients (custom user-agent and headers (depending of the client used), use of range and rn (set dynamically by the DataSource) parameters);
  - Fetch YouTube progressive contents as DASH streams, like official clients, support fully playback of livestreams which have ended recently and OTF streams;
  - Use ExoPlayer's default retries count for contents on non-fatal errors (instead of Integer.MAX_VALUE for non-live contents and 5 for live contents).

- Download dialog:

  - Add message about support of progressive HTTP streams only for downloading;
  - Remove several duplicated code and update relevant usages;
  - Support downloading of contents with an unknown media format.

- ListHelper:

  - Catch NumberFormatException when trying to compare two video streams between them.

- Tests:

  - Update ListHelperTest and StreamItemAdapterTest to fix breaking changes in the extractor.

- Other places:

  - Fixes deprecation of changes made in the extractor;
  - Improve some code related to the files changed.

- Issues fixed and/or improved with the changes:

  - Seeking of PeerTube HLS streams (the duration shown was the one from the stream duration and not the one parsed, incomplete because HLS streams are fragmented MP4s with multiple sidx boxes, for which seeking is not supported by ExoPlayer) (the app now uses the HLS manifest returned for each quality, in the master playlist (not fetched and computed by the extractor));
  - Crash when loading PeerTube streams with a separated audio;
  - Lack of some streams on some YouTube videos (OTF streams);
  - Loading times of YouTube streams, after a quality change or a playback start;
  - View count of YouTube ended livestreams interpreted as watching count (this type of streams is not interpreted anymore as livestreams);
  - Watchable time of YouTube ended livestreams;
  - Playback of SoundCloud HLS-only tracks (which cannot be downloaded anymore because the workaround which was used is being removed by SoundCloud, so it has been removed from the extractor).
2022-06-17 22:00:22 +02:00
Stypox 75e5fe7d27
Merge pull request #8404 from Isira-Seneviratne/Use_AppCompatResources
Use AppCompatResources.
2022-05-30 15:42:04 +02:00
Stypox bd5eda92a7
Improvements to sharing content with thumbnail 2022-05-22 21:34:10 +02:00
Isira Seneviratne 21d2ae709f Merge branch 'dev' into Use_AppCompatResources
# Conflicts:
#	app/src/main/java/org/schabi/newpipe/fragments/list/playlist/PlaylistFragment.java
2022-05-16 12:36:00 +05:30
Isira Seneviratne c5e509f069 Use AppCompatResources. 2022-05-16 12:27:44 +05:30
TiA4f8R 761c0ff9ac
[Android 10+] Add image preview of the content shared where possible
These previews will be only available for images cached in the cache used by Picasso.
The Bitmap of the content is compressed in JPEG 90 and saved inside the application cache folder under the name android_share_sheet_image_preview.jpg.
The current image will be, of course, always overwritten by the next one and cleared when the application cache is cleared.
2022-05-14 16:53:24 +02:00
litetex 1228ce277f Removed placeholder prefix 2022-05-07 15:08:37 +02:00
litetex bd6fdd625a Use material icon 2022-05-07 15:08:37 +02:00
litetex 70e0085596 Converted placeholders to svg
* Required for SubscriptionFragment (otherwise the PopUp-menu uses half of the screen)
* Size reduction
* Fixed/Improved some images:
  * Bandcamp: Was facing in the wrong direction and used an incorrect logo
  * Media CCC: Update logo
  * YT: Added NewPipe logo so that it's not just a rectangle
2022-05-07 15:08:35 +02:00
Stypox 7646c683b5
Merge pull request #7989 from litetex/refactor-playback-parameter-dialog
Rewrote ``PlaybackParameterDialog``
2022-04-30 17:53:26 +02:00
Yingwei Zheng 127a27315e
Fix keyboard showing after the search box acquiring focus (#8227)
* Fix keyboard showing after the search box acquiring focus
* Fix the underlying problem as described in the issue #7647
2022-04-18 16:05:42 +02:00
litetex 1dc146322c Merged ``DrawableResolver`` into ``ThemeHelper`` 2022-04-16 21:21:57 +02:00