Commit graph

98 commits

Author SHA1 Message Date
Stypox
bb4a8ebcd8 Refactor creation of DownloadDialog 2022-06-18 17:40:22 +02:00
AudricV
f7d2975ad1 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
litetex
481152acdd Bonus fix: Made `single_choice_dialog_view` scrollable + use viewbinding 2022-05-28 00:46:28 +02:00
litetex
5c1d5341ff Code cleanup 2022-05-28 00:46:27 +02:00
litetex
d624bce55e Improved docs, format and code style 2022-05-28 00:46:27 +02:00
litetex
201acb9347 Reworked incorrect choice handling and centralized it 2022-05-28 00:39:13 +02:00
litetex
6d53fe1339 Fix add to playlist 2022-05-28 00:39:13 +02:00
Isira Seneviratne
37fdd548c9 Remove unnecessary compat method calls. 2022-05-10 07:45:01 +05:30
litetex
bb55c420fe Use non-static method 2022-05-04 19:09:41 +02:00
litetex
269d9e933a Make sure Routeractivity does the same as MainActivity 2022-05-01 21:59:00 +02:00
TiA4f8R
7786a18517 Prefer video-only streams to video streams
Prefering video-only streams to video streams for our player will allow us to make seamless transitions on 360 and 720p qualities on YouTube.
External players and the downloader are not affected by this change.
2022-02-20 19:38:40 +01:00
Stypox
5583f71a8e Replace ErrorActivity with ErrorUtil 2021-12-04 10:36:36 +01:00
litetex
3c4e392ce1 Add to playlist - Showing toast that this may take a moment 2021-10-09 18:47:36 +02:00
litetex
2361d32f75 Cleaned up PlaylistDialog-related code 2021-10-09 18:46:20 +02:00
Kalle Struik
dc999b4f71 Add a add to playlist option in the share menu. 2021-10-02 19:21:25 +02:00
Stypox
1663da64a2 Call DownloadDialog dismiss() in the correct way 2021-07-19 10:59:45 +02:00
evermind
61a54d9a64 convert PlayerHolder to Singleton, handle context within, bugfix ServiceConnection leak
- bugfix: have ServiceConnection created only once!

- select the context within the PlayerHolder to start, stop, bind or unbind the service
  -> we have to make sure the Service is started AND stopped within the same context
  -> so let PlayerHolder be the one to select the context

- remove removeListener() and replace the call with setListener(null)
- Compatibility: use ContextCompat.startForegroundService instead of startService()
2021-07-06 12:31:26 +02:00
Stypox
4a963858ba Merge pull request #6394 from TacoTheDank/androidx-fragment-134
Update AndroidX Fragment to 1.3.4
2021-06-18 13:14:30 +02:00
evermind
a218fcb79d dismiss choice dialog in onStop() to avoid a leaked window Exception:
E/WindowManager: android.view.WindowLeaked: Activity org.schabi.newpipe.RouterActivity has leaked window DecorView@d99fe3b[] that was originally added here
        at android.view.ViewRootImpl.<init>(ViewRootImpl.java:418)
2021-06-17 06:53:47 +02:00
TacoTheDank
cece4c1252 Add super.onRequestPermissionsResult where missing 2021-06-15 22:08:41 -04:00
TiA4f8R
0844e448a3 Fix an error and add a new method in the ShareUtils class
Fix the error due to the rebase on the dev branch of this branch
Add a shareText method in the ShareUtils class which has 3 parameters and calls
the original shareText method with an empty string for the
imagePreviewUrl param.
2021-06-11 12:12:09 +02:00
TiA4f8R
a23dff74a3 Move some classes to a new subpackage and adress requested changes
Rename URLHandler and KoreUtil classes to InternalUrlsHandler and KoreUtils.
Move InternalUrlsHandler, KoreUtils, TextLinkfier, ShareUtils classes to external_communication subpackage.
Remove unused param showPreviewText in shareText method of ShareUtils class.
Add initial work to be able to display an image preview of the content shared (not for downloads).
Use a better regular expression to parse timestamps in plain text descriptions.
2021-06-11 12:12:02 +02:00
TiA4f8R
1d615df928 Initial work to add the image of the content in the share sheet
Also do some fixes when sharing a file in downloads and some improvements in JavaDocs of ShareUtils class.
2021-06-11 12:12:00 +02:00
TiA4f8R
ae6f77d0dc Fix title of the subject when sharing an URL 2021-06-11 12:11:59 +02:00
Tobi
5438064555 Merge pull request #6385 from sauravrao637/6371
Option for download is redundant and thus removed when linkType is CHANNEL or PLAYLIST
2021-05-28 14:23:04 +02:00
camo0112
46e41ab913 Option for download is redundant and thus removed when linkType is CHANNEL or PLAYLIST 2021-05-28 03:38:53 +05:30
TobiGr
ac3707c3b0 Fix black drawables in night themes in share dialog (RouterActivity) 2021-04-25 11:36:40 +02:00
krlvm
a8de222577 Fix Dark elements in Light Theme 2021-03-27 17:46:05 +03:00
Stypox
d075cc424f Better handle url not supported in RouterActivity
Make sure the url not supported dialog is only shown when the url is really not supported, not on any ExtractionException
2021-03-12 23:21:54 +01:00
Stypox
22c92f1fb3 Completely remove return activity, now outdated 2021-03-12 23:21:54 +01:00
Stypox
0ea6b4928c Add report/solve-recaptcha button in error panel
It will be shown even when nothing could be loaded not due to a network error, and the user can choose to ignore or report it.

Also improve error reporting arguments
Also completely refactor error activity
Also improve some code here and there
2021-03-12 23:21:49 +01:00
Stypox
bb398189d6 Move all error-related classes into error package 2021-03-07 17:49:28 +01:00
TiA4f8R
e44495af9a Apply the requested changes and little improvements
Apply the requested changes, use ShareUtils.shareText to share an stream in the play queue and optimize imports for Java files, using Android Studio functionality.

Apply the requested changes and do little improvements
Apply the requested changes, use ShareUtils.shareText to share an stream in the play queue and optimize imports for Java files, using Android Studio functionality.
2021-01-16 13:23:42 +01:00
Isira Seneviratne
da095794a4 Use ServiceCompat.stopForeground(). 2020-12-19 16:52:17 +05:30
Isira Seneviratne
6ba6323b65 Use view binding in RouterActivity. 2020-12-19 04:21:58 +05:30
Stypox
34dd7c0fbf Update most dependencies 2020-11-22 14:03:10 +01:00
TacoTheDank
290751ba78 Correct some other small lints 2020-11-19 18:54:27 -05:00
TacoTheDank
7d4e8bd7a8 Lint: Lambda fix 2020-11-18 17:57:30 -05:00
Stypox
429ba53016 More fixes with opening VideoDetailFragment 2020-11-08 10:00:28 +01:00
Stypox
d17308c711 Show "Show info" instead of "Video player" if a stream is playing not on the main player when sharing something to NewPipe 2020-11-08 10:00:28 +01:00
Stypox
72f25383bd Unify all ways of opening VideoDetailFragment 2020-11-08 10:00:27 +01:00
Isira Seneviratne
0e2f57bc60 Use TextViewCompat.setCompoundDrawablesRelativeWithIntrinsicBounds(). 2020-10-22 06:01:49 +05:30
Tobias Groza
bccba7acd6 Merge pull request #4259 from TeamNewPipe/pref_migration
Add settings migration, remove "Detail page" option from share dialog and minimize to background by default
2020-09-27 11:20:39 +02:00
Tobias Groza
36f26542cb Merge pull request #3178 from cool-student/notificationImprovements
Notification Improvements
2020-09-27 10:43:11 +02:00
TobiGr
0949453cb5 Remove "Detail Page" open action from share dialog under certain circumstances
With the new application workflow and unified player, video detail page and video player are the same activity. So show only one of these options based on whether autoplay is enabled or not, and show both if using external player
2020-09-26 21:58:34 +02:00
bopol
1f3a768f71 Merge remote-tracking branch 'upstream/dev' into unsupported-url-dialog 2020-09-12 23:19:18 +02:00
Stypox
e861be10d9 Merge branch 'dev' into pr3178 2020-09-08 23:58:10 +02:00
Stypox
847fb84854 Add notification costumization settings menu 2020-09-08 22:00:24 +02:00
TacoTheDank
0ef2e07cf4 Some general-purpose lint cleanup 2020-09-06 12:55:26 +02:00
TacoTheDank
7795a5f733 Fix some lambdas 2020-09-06 12:52:43 +02:00