Commit Graph

53 Commits

Author SHA1 Message Date
Stypox e784af3e2d
Merge pull request #10446 from AudricV/dl_improve_video_audio_stream_selection
Improve audio stream selection for video-only streams in the downloader
2023-12-07 16:48:57 +01:00
AudricV e5fda35c51
Remove OPUS HLS streams from playable streams
This format is not supported by ExoPlayer when returned as HLS streams, so we
can't play streams using this format and this delivery method.

Also improve the Javadoc of ListHelper.getPlayableStreams.
2023-11-15 23:37:22 +01:00
AudricV cdb79ef78a
Make isLimitingDataUsage method of ListHelper package-private and fix some typos in the class 2023-09-24 18:23:44 +02:00
TobiGr 19640d5e7c Add documentation to increase maintainablilty
Rename a variable
2023-09-18 01:45:53 +02:00
Edward d1a82a85cd Include a high-resolution option in the default resolution settings. 2023-09-18 01:15:22 +02:00
ThetaDev 22671ca16c fix: audio stream cache key, code fmt 2023-05-01 00:04:04 +02:00
ThetaDev c377ffbce8 Merge branch 'dev' of github.com:TeamNewPipe/NewPipe into alang-selector 2023-04-21 23:32:33 +02:00
ThetaDev b567d428ad fix: small codestyle fixes 2023-04-21 23:15:37 +02:00
TobiGr e18a6b09f8 Apply new itag filter only to YouTube streams 2023-04-17 13:10:29 +02:00
TobiGr f8c3ec4be7 Use a whitelist to filter all streams retrieved by the extractor.
NewPipe Extractor now extracts all YouTube Itags and therefore only those which can be handled by the player need to be retrieved from the list of all available streams.
2023-04-17 13:00:11 +02:00
ThetaDev ed06f559ae feat: add track selection to downloader 2023-03-20 21:41:28 +01: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
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 ebd06bdd24
Improve comment 2022-08-06 11:56:00 +02:00
Isira Seneviratne 059cfcbad2 Use Comparator factory methods in ListHelper. 2022-08-05 05:36:21 +05:30
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
Isira Seneviratne c53143ef4f Use Set.of(). 2022-07-19 08:53:15 +05:30
litetex 8b209df253 Changed the code accordingly
+ Removed some unused code
2022-07-15 19:55:19 +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 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 7a356412d5
Fixed typo 2022-02-20 19:40:01 +01:00
litetex a489f40b76
Fixed checkstyle problems
Unable to compile!

* Cleaned up ``getMostCompactAudioIndex`` and ``getHighestQualityAudioIndex`` into a new method ``getAudioIndexByHighestRank``
* Removed unreadable code and use Java Streams API
* Tests work as expected
2022-02-20 19:38:40 +01:00
litetex 8ed87e7fbb
Improved ``ListHelper#getSortedStreamVideosList`` 2022-02-20 19:38:40 +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
TiA4f8R 79e98db3bd
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
TobiGr 7a8dab2d58 Fix typos 2020-11-22 10:39:00 +01:00
Isira Seneviratne abcacf8c74 Use Comparator's comparing(), nullsLast() and reversed() methods. 2020-11-01 14:44:04 +05:30
Isira Seneviratne 58b720b004 Use ContextCompat.getSystemService() and the Context.getSystemService() extension function. 2020-10-09 08:52:05 +05:30
TacoTheDank ba6c7de35a
Use AndroidX preference 2020-09-06 12:52:42 +02:00
wb9688 87228673b4 Use final where possible 2020-08-16 10:25:09 +02:00
Avently d2aaa6f691 Merged the latest changes 2020-07-13 04:17:21 +03:00
wb9688 93ba7510e1 Fix ListHelper ANR 2020-05-18 13:40:01 +02:00
wb9688 fda5405e48 Improve code style to be more consistent 2020-04-02 15:57:50 +02:00
Avently 4c57893312 New features and fixes
- added autoplay options inside settings: always, only on wifi, never
- now statusbar will be shown in fullscreen mode
- playlists, channels can be autoplayed too (if enabled)
- changed title of background activity to Play queue
- fixed a crash
2020-01-08 19:16:50 +03:00
Robin bf2a3ca043 Migrate to AndroidX 2019-10-04 14:59:08 +02:00
kapodamy 9e34fee58c New MP4 muxer + Queue changes + Storage fixes
Main changes:
* correctly check the available space (CircularFile.java)
* misc cleanup (CircularFile.java)
* use the "Error Reporter" for non-http errors
* rewrite network state checking and add better support for API 21 (Lollipop) or higher
* implement "metered networks"
* add buttons in "Downloads" activity to start/pause all pending downloads, ignoring the queue flag or if the network is "metered"
* add workaround for VPN connections and/or network switching. Example: switching WiFi to 3G
* rewrite DataReader ¡Webm muxer is now 57% more faster!
* rewrite CircularFile, use file buffers instead of memory buffers. Less troubles in low-end devices
* fix missing offset for KaxCluster (WebMWriter.java), manifested as no thumbnails on file explorers

Download queue:
* remember queue status, unless the user pause the download (un-queue)
* semi-automatic downloads, between networks. Effective if the user create a new download or the downloads activity is starts
* allow enqueue failed downloads
* new option, queue limit, enabled by default. Used to allow one or multiple downloads at same time

Miscellaneous:
* fix crash while selecting details/error menu (mistake on MissionFragment.java)
* misc serialize changes (DownloadMission.java)
* minor UI tweaks
* allow overwrite paused downloads
* fix wrong icons for grid/list button in downloads
* add share option
* implement #2006
* correct misspelled word in strings.xml (es) (cmn)
* fix MissionAdapter crash during device shutdown

New Mp4Muxer + required changes:
* new mp4 muxer (from dash only) with this, muxing on Android 7 is possible now!!!
* re-work in SharpStream
* drop mp4 dash muxer
* misc changes: add warning in SecondaryStreamHelper.java,
* strip m4a DASH files to normal m4a format (youtube only)

Fix storage issues:
* warn to the user if is choosing a "read only" download directory (for external SD Cards), useless is rooted :)
* "write proof" allow post-processing resuming only if the device ran out of space
* implement "insufficient storage" error for downloads
2019-06-03 18:09:43 -03:00
Ritiek Malhotra 642b499e70 Fix crash with default resolution best on mobile data 2018-10-31 21:44:12 +05:30
BO41 0ab86937d2 data flow issue + declaration redundancy
make final
unused methods
make final

BUILD SUCCESSFUL in 0s
39 actionable tasks: 39 up-to-date
2018-09-11 19:18:41 +02:00
kapodamy 4ef8b93344
patch for ListHelper.java
double check for null
2018-07-28 12:07:10 -03:00
James Straub 646fa877ba Update to mobile data limiting
- Moved non-key strings from string_keys.xml to strings.xml
- Code style changes
- Replaced a hard coded key string with resource constant
2018-04-22 10:20:19 -04: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