Commit Graph

115 Commits

Author SHA1 Message Date
AudricV 77bbbc88f8
Use ListHelper to get secondary audio streams for video-only streams
Instead of searching for the first audio stream matching a compatible media
format, this change makes SecondaryStreamHelper.getAudioStreamFor use methods
isLimitingDataUsage, getAudioFormatComparator and getAudioIndexByHighestRank of
ListHelper to get an audio stream which can be muxed into a video-only stream,
if available.

This allows users to download videos with the highest audio quality available
if no resolution limit on mobile data usage has been set.

The order of formats used to search a compatible audio stream has been kept.
2023-09-24 18:23:45 +02:00
TobiGr f3859ed710 Retrieve MediaFormat for streams that could not be extracted by the extractor 2023-08-14 23:06:32 +02:00
TobiGr 0db12e5561 Rename StreamSizeWrapper to StreamInfoWrapper 2023-08-14 22:48:39 +02:00
TobiGr 6b7ffbba4c [Download] Fix audio stream selection
Closes #10180
2023-07-14 17:06:12 +02:00
TacoTheDank c1f0a945c0 Clean up AlertDialogs 2023-07-11 21:54:10 -04:00
AudricV d89a3c6c4d
Remove "default" from audio track already present message
We don't know if, on muxed video streams we get for all services which support
multiple audio languages, that the audio language returned is the original one
or not, even if it should be the case.

In order to avoid saying potential false information, this word has been
removed from the string resource (ID and value) and the corresponding layout ID
in the download dialog.
2023-05-02 00:11:09 +02:00
ThetaDev 22671ca16c fix: audio stream cache key, code fmt 2023-05-01 00:04:04 +02:00
ThetaDev b567d428ad fix: small codestyle fixes 2023-04-21 23:15:37 +02:00
ThetaDev 39a5c8bdfb fix: reset video stream sizes on audio track selection 2023-03-29 13:39:29 +02:00
ThetaDev 694418d30d fix: update stream sizes when audio track changed 2023-03-21 16:58:36 +01:00
ThetaDev ed06f559ae feat: add track selection to downloader 2023-03-20 21:41:28 +01:00
Stypox 03f5dd71a5
Merge pull request #9499 from pratyaksh1610/branch-9466
Added Language suffix for subtitle downloads
2023-01-11 19:46:51 +01:00
Stypox 2afbe58722
UX improvements: keep user edits & do not reset cursor 2023-01-11 19:45:55 +01:00
pratyaksh1610 3e15c77a05 move string to donottranslate.xml and fix nits 2023-01-03 14:07:28 +05:30
pratyaksh1610 50269d0f5e updated caption file name and clean code 2023-01-02 16:23:45 +05:30
pratyaksh1610 1afb9cdba9 added Language suffix for subtitle downloads 2022-12-04 17:59:22 +05:30
Isira Seneviratne d6617007d4 Use SparseArrayCompat instead of SparseArray in StreamItemAdapter.
Make additional small improvements as well.
2022-11-22 18:31:58 +05:30
plasticanu 40815086ad
Fix crash when the user clicks download then quits the history fragment (#9143)
* Fix crash when the user clicks download then quits the history fragment

* add a nonnull annotation to the context parameter in the DownloadDialog constructor.

* Revert "Merge branch 'TeamNewPipe:dev' into fix/HistoryFragmentDownloadDialogCrash"

This reverts commit 968d7a7603.

* Revert "Merge branch 'TeamNewPipe:dev' into fix/HistoryFragmentDownloadDialogCrash"

This reverts commit 968d7a7603, reversing
changes made to 52963ba37d.

Reverted merge

jlhzxc

* update project to the latest dev branch

* Revert "update project to the latest dev branch"

This reverts commit fb3ed83d51.

revert changes to build files

* Revert "Revert "Merge branch 'TeamNewPipe:dev' into fix/HistoryFragmentDownloadDialogCrash""

This reverts commit f9e1835e71.
2022-10-26 11:22:32 +02:00
devlearner ab99c14fd2
Fix crash on screen rotation 2022-10-06 18:15:36 +08:00
litetex 8b209df253 Changed the code accordingly
+ Removed some unused code
2022-07-15 19:55:19 +02:00
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