Commit Graph

40 Commits

Author SHA1 Message Date
Profpatsch e0cbddfe54 getAudioIndexByHighestRank: simplify & make list NonNull 2024-01-06 18:33:48 +01:00
Stypox 0a2d6d1d62
Add test for ImageStrategy 2023-09-22 10:14:45 +02:00
ThetaDev 22671ca16c fix: audio stream cache key, code fmt 2023-05-01 00:04:04 +02:00
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
Stypox 22c201be39
Create text subpackage in util 2023-01-15 11:51:07 +01:00
Stypox f4fe5fcb16
Fix ListHelperTest failure caused by immutable list being used 2022-07-22 16:09:43 +02:00
Isira Seneviratne ca26fcb0eb Use List.of(). 2022-07-20 04:39:11 +05:30
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
litetex 93deaa5687 Fixed test compilation 2022-03-26 21:44:16 +01:00
TacoTheDank 678edb1846 Update ktlint to 0.44.0 2022-02-26 16:08:10 -05:00
litetex 015982bed4
Extended Tests for ListHelper#getSortedStreamVideosList
* Fixed expected and actual results. They were reversed...
* Added new method ``getSortedStreamVideosListWithPreferVideoOnlyStreamsTest``
2022-02-20 19:40:01 +01: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 0e4c8ea8af Added tests for the ``TimestampExtractor`` 2021-08-06 22:09:03 +02:00
Stypox 1e09a1768e
Revert all commits related to ContentSettingsFragment
Revert "Annotate methode parameters as NonNull"
This reverts commit 004907d306.

Revert "Commit path immediately when import backup"
This reverts commit 05eb0d0fbe.

Revert "Set ImportExportDataPath only on successful import"
This reverts commit f13a1b04e6.

Revert "Set ImportExportDataPath only on successful export"
This reverts commit fd4408e572.

Revert "Invert if condition in ContentSettingsFragment.setImportExportDataPath for better readability"
This reverts commit 92ab9cae27.

Revert "Move ContentSettingsFragment.isValidPath to helpers and add unit test for it."
This reverts commit fa2b11b768.

Revert "Save backup import/export location for feature import/exports"
This reverts commit 82f43ac6a6.

Remove FilePathHelperTest file
2021-06-08 10:40:44 +02:00
XiangRongLin 376e5c1546 Remove unnecessary conversion between file and path 2021-05-21 20:24:11 +02:00
Alireza Tofighi e8ad947d37 Split up FilePathHelperTest tests in simpler methods 2021-05-21 22:44:38 +04:30
Alireza Tofighi 067528211f Add more tests for FilePathUtils.isValidDirectoryPath for better coverage 2021-05-21 20:28:42 +04:30
Alireza Tofighi fa2b11b768 Move ContentSettingsFragment.isValidPath to helpers and add unit test for it. 2021-05-21 20:21:58 +04:30
Isira Seneviratne 74e20a8c52 Use PrettyTime's new formatUnrounded(OffsetDateTime) method.
Also change the types of the relevant variables from Calendar to OffsetDateTime.
2021-03-18 06:38:12 +05:30
Stypox 9ee7740fcc
Merge pull request #4947 from Isira-Seneviratne/Convert_ExceptionUtils_to_extensions
Rewrite ExceptionUtils methods as extension functions.
2021-01-14 14:54:37 +01:00
XiangRongLin 031585be3f Add comment about unexpected assertion 2021-01-13 17:25:00 +01:00
Isira Seneviratne 486e720e00 Rewrite ExceptionUtils methods as extension functions. 2021-01-11 16:49:45 +05:30
XiangRongLin 50a026183d Make Localization.relativeTime testable
Problem is global state in static variable prettyTime. But for performance reasons on Android that is preferred.
Now allow injecting prettyTime dependency by making init function public.
2021-01-06 14:48:34 +01:00
Tobias Groza db9f20a22f
Merge pull request #4961 from TeamNewPipe/lint
Fix some Lint errors
2020-12-07 11:19:01 +01:00
Stypox f0ca916432
Update most dependencies 2020-11-22 14:03:10 +01:00
TobiGr 7a8dab2d58 Fix typos 2020-11-22 10:39:00 +01:00
wb9688 87228673b4 Use final where possible 2020-08-16 10:25:09 +02:00
wb9688 b0415a5289 Auto-format using Ktlint 2020-05-01 20:13:21 +02:00
Mauricio Colli a1b9892c77
Move exception utils to a separate class and add tests for it 2020-04-09 13:22:18 -03:00
wb9688 fda5405e48 Improve code style to be more consistent 2020-04-02 15:57:50 +02:00
Mauricio Colli f133bbf499
Introduce a proper way to find urls in a string input 2020-03-28 14:06:09 -03:00
BO41 af280a7343 Java language level + javadoc + xml
replace with <>
String builder

BUILD SUCCESSFUL in 4s
39 actionable tasks: 4 executed, 35 up-to-date
2018-09-11 19:20:10 +02:00
BO41 27fbe69033 code cleanup
mainly removes throw statements

automated using Android Studio, staged by hand

BUILD SUCCESSFUL in 52s
39 actionable tasks: 37 executed, 2 up-to-date
2018-09-11 19:14:21 +02:00
James Straub d1b0cd74be Added the ability to limit video quality if using mobile data.
* Added a dropdown to video & audio settings
* Changes to ListHelper:
** Limits resolution when code requests the default video resolution
** Limits audio bitrate when code requests the default audio bitrate
** Removed some dead code and did some cleanup
** Make methods private/protected to help understand what was in use
** The code now chooses one format over an other using a simple raking system defined in array constants. I realized I needed to do this in order to choose the most efficient video stream. I did my best to evaluate the video and audio formats based on quality and efficiency. It's not an exact science.
** Made changes to the tests to support my changes
2018-04-21 12:35:04 -04:00
John Zhen Mo 18d019c62a -Added quadratic slider strategy implementation and tests.
-Modified playback speed control to use quadratic sliders instead of linear.
-Modified number formatters in player helper to use double instead of float.
-Simplified slider behavior in playback parameter dialog.
-Fixed potential NPE in base local fragment.
2018-03-21 20:08:33 -07:00
Coffeemakr 962e070150
Use Mediaformat objects instead of ids for tests 2017-12-08 13:57:44 +01:00
Mauricio Colli 146d4a8365 Update extractor and refactored NewPipe 2017-09-03 13:57:12 -03:00
Mauricio Colli 3b9a477499 Add resolution support up to 4k and 60 fps
- Up to 4k with 60 fps
    - Not every device can play in that resolution and bitrate
    - Add option to hide these high resolution greater than 1080p (2k,4k) for not clutter the menus
- Add a default resolution for the popup, wil be used when opening in popup mode from another app
2017-04-12 03:07:15 -03:00