Commit Graph

95 Commits

Author SHA1 Message Date
Stypox 7ba79171c7
Refactor creation of DownloadDialog 2022-06-18 17:40:22 +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
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
TacoTheDank 86f335b01f Create stub implementation for OnSeekBarChangeListener 2022-03-17 21:49:04 -04:00
TiA4f8R 79f8270c35
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
litetex b21d231e3a
Merge pull request #7452 from litetex/show-alert-when-file-manager-not-found
Show an alert-dialog when no appropriate file-manager was found
2021-12-14 20:01:02 +01:00
Stypox 81f740d409
Replace ErrorActivity with ErrorUtil 2021-12-04 10:36:36 +01:00
litetex b2323859e5 Refactoring + deduplicated code 2021-11-28 14:07:45 +01:00
litetex 68e7fcf8ee Fixed typos 2021-11-27 23:39:17 +01:00
litetex f78983b16b Show an alert/dialog when no appropriate file-manager was found 2021-11-27 15:52:54 +01:00
Stypox 039bd5d413
Rename string finish to ok, as its content was "OK" 2021-08-30 16:36:57 +02:00
Stypox f8caed139a
Use custom cancel string everywhere
to fix missing somali translation for android.R.string.cancel
2021-08-04 18:58:35 +02:00
Stypox 8f559965f6
Call DownloadDialog dismiss() in the correct way 2021-07-19 10:59:45 +02:00
Stypox 35e005caaa
Improve method order in DownloadDialog and add separator comments 2021-07-18 14:23:38 +02:00
TacoTheDank ae39b31c68 Fix onActivityResult deprecation in DownloadDialog 2021-06-20 14:14:44 -04:00
Stypox 2a99e0e435
Reimplement storing backup import/export path
#6319 and #6402 were reverted before adding SAF changes, and have been readded at the end of SAF changes
2021-06-08 10:41:24 +02:00
Stypox 5ffc667bea
Remove misplaced comment 2021-06-08 10:40:45 +02:00
Stypox 21b8df0375
Check if file really exists before asking user to overwrite it 2021-06-08 10:40:45 +02:00
Stypox b78ac7d2e9
Fix strange behaviour when app loses access to saf download folder 2021-06-08 10:40:45 +02:00
Stypox 114dc8ffa0
Pass mime type so that SAF treats file extension correctly 2021-06-08 10:40:45 +02:00
wb9688 1164ea52f9
Move Stored(File|Directory)Helper into NewPipe 2021-06-08 10:40:44 +02:00
wb9688 0f75024e03
Support SAF properly 2021-06-08 10:40:44 +02:00
Tobi 62b593da08
Merge pull request #6118 from sauravrao637/errorHandlingInSubcribe
Error handling in subscribe() in DownloadDialog
2021-05-29 11:30:36 +02:00
Sub Raizada e775037366
Only show 'download has started' toast when a download has started 2021-04-22 02:45:04 +00:00
camo0112 4357e02c58 user can report the error 2021-04-20 16:21:20 +05:30
camo0112 67c0ceedc9 Error handling in subscribe() in DownloadDialog 2021-04-20 13:06:40 +05:30
krlvm fd14c8cdce
Fix Dark elements in Light Theme 2021-03-27 17:46:05 +03:00
Matskidis Giannis bf6645e829
Show Toast when download starts
Add toast to inform the user that download started and add the right string in values.
2021-03-20 22:18:01 +01:00
Stypox 463dd8ea74
Completely remove return activity, now outdated 2021-03-12 23:21:54 +01:00
Stypox 1fc8e4c148
Optimize imports and solve checkstyle issues 2021-03-12 23:21:53 +01:00
Stypox c43bca6007
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 553b80164b
Move all error-related classes into error package 2021-03-07 17:49:28 +01:00
Isira Seneviratne 7682ebd245 Use view binding in DownloadDialog. 2021-01-14 11:16:01 +05:30
Stypox f0ca916432
Update most dependencies 2020-11-22 14:03:10 +01:00
Isira Seneviratne 340b92e32b Convert ErrorInfo to Kotlin and use the Parcelize annotation. 2020-11-21 12:47:35 +05:30
TacoTheDank 31cffa68c5 Push conditionals inside branch expressions 2020-10-31 15:57:26 -04:00
TacoTheDank ba6c7de35a
Use AndroidX preference 2020-09-06 12:52:42 +02:00
vmazoyer 99442b6e04
Remember last selected media type for downloads. 2020-09-03 19:47:34 +02:00
wb9688 87228673b4 Use final where possible 2020-08-16 10:25:09 +02:00
Stypox 9e57195e14
Fix checkstyle issues
Also replace all tabs with 4 spaces
2020-05-21 15:39:36 +02:00
Stypox ea43b28f74
Use vector drawables instead of PNGs for material icons
For all manually-created images PNG have been kept.
- rename all icon attrs to have a `ic_` prefix
- always use `_24dp` icons, because there is no real difference, since they are vector drawables
- always use the original name found on material.io for icon drawables, as to not create confusion and possibly duplicates. Icon names can still be different from real drawable names, though I have made some of them compliant to this or maybe more meaningul.
- remove duplicate `getIconByAttr()` in ThemeHelper (use `resolveResourceIdFromAttr()`
- use standard icons for `expand_more` and `expand_less` instead of triangles
- use `play_button_outline` instead of custom PNG as play button in VideoDetailFragment (questionable, as there is no shadow anymore)
2020-05-21 15:39:35 +02:00
wb9688 63bcc04eff Move things back to its original place 2020-04-02 15:57:50 +02:00
wb9688 fda5405e48 Improve code style to be more consistent 2020-04-02 15:57:50 +02:00
bopol 6be23a0a6f fix wrong language shown many popup dialogs
Changed android.R.string.ok, which is "OK", into R.string.finish, which is also OK, but from our strings
Then for a small amount of languages that don't have Android translation, it will show the good string.
2020-02-01 09:44:49 +01:00
kapodamy 42ec6f0810 ttml to srt conversion
rewrite SubtitleConverter (use JSoup library instead, remove unused methods)
2020-01-14 00:04:16 -03:00
kapodamy 8d53b07167 fixup
* [DownloadDialog.java] use *.opus extension instead of *.webm (bad change from 844f80a5f1)
* [StreamItemAdapter.java] show "opus" in format label instead of "WebM Opus"
2020-01-08 12:42:34 -03:00
Nico-late 6fb16bad85 Update app/src/main/java/org/schabi/newpipe/download/DownloadDialog.java
Space added for more clarity

Co-Authored-By: Tobias Groza <TobiGr@users.noreply.github.com>
2019-12-31 00:52:01 +01:00
Nico-late 694813ac90 Fixed issue #2838 2019-12-31 00:52:01 +01:00
kapodamy 84ec320df4 commit
* rebase fixup, add null check
* better ETA string
* drop connection read timeout, for HSDPA networks
* bump NPE version
2019-11-26 13:41:16 -03:00