Commit Graph

3208 Commits

Author SHA1 Message Date
Stypox 6ea85e6380
Rename dummy_* and more to placeholder_* 2022-07-14 14:27:33 +02:00
Stypox 7b9b9218dc
Remove bottom-sheet-thumbnail placeholder, clear the image instead 2022-07-14 14:14:33 +02:00
krlvm 35eeccd45a
Rename buddy.xml to dummy_person.xml 2022-07-14 14:14:32 +02:00
krlvm cc7a8fb1a6
Improve image placeholders
- Show placeholders until the image is loaded because timeout can be very long and missing profile pictures and video thumbnails make app inconvenient to use

- Adapt profile picture and video thumbnail placeholders to light theme

- Replace profile picture and video thumbnail placeholders with vector graphics
2022-07-14 14:14:32 +02:00
Stypox 70e3c9805a
Merge pull request #8542 from carmebar/share-playlist
Add 'Share playlist' option to Playlist fragment
2022-07-13 23:45:08 +02:00
TacoTheDank 189c92affa
More minSdk 21 cleanup 2022-07-13 19:03:47 +02:00
TacoTheDank 4ec9cbe379
Remove AndroidX Webkit 2022-07-13 19:03:47 +02:00
litetex 99104fc11d
Clean up pre-Lollipop checks 2022-07-13 19:02:24 +02:00
litetex 7cb137ae8d
Remove MultiDex 2022-07-13 19:02:24 +02:00
Alex 6f7298b9db
Crop the notification thumbnail in 1:1 mode instead of stretching it (#8533)
Change square bitmap transformation strategy: change the bitmap transformation strategy when a 1:1 aspect ratio is
enabled to not stretch the bitmap but rather crop it.

On Android 11/12, the way the whole thumbnail was used for the
notification icon was not ideal, however the setting to toggle a 1:1
(as it states in settings) resulted in distortions.

Fix this by simply cropping the bitmap.

Also update the 1:1 mode strings to remove mentions of scaling or
distortions, as those no longer apply.
2022-07-13 17:19:44 +02:00
Carlos Melero d0b6d95f1b
Add Share option to local playlists
A newline-separated text is shared
2022-07-13 14:32:23 +02:00
Robin 93b913e14d
Merge pull request #8536 from TacoTheDank/bumpExoPlayer
Update ExoPlayer to 2.18.0
2022-07-13 12:59:12 +02:00
Stypox b96c8a0c2f
Merge pull request #8545 from carmebar/hide-future-videos
Add option to hide future videos in feed
2022-07-13 11:07:38 +02:00
nikita.artikhovich a4724fec4a
Add download option to long-press menu 2022-07-06 11:42:57 +02:00
litetex 155c6e94a3
Use correct ``NonNull`` 2022-07-04 23:19:41 +02:00
litetex 4e285a4e70
Fix compile errors 2022-07-04 23:19:41 +02:00
TacoTheDank 00b9c082a3 Set setUsePlatformDiagnostics to false 2022-07-02 15:01:39 -04:00
Stypox 085d1e0d38
Actually fix wrong view count 2022-07-01 16:07:19 +02:00
TacoTheDank 1404581e9b Update ExoPlayer to 2.18.0 2022-06-25 21:14:42 -04:00
Carlos Melero f22417e7e7 Add option to hide future videos in feed 2022-06-24 18:03:48 +02:00
AudricV cbd3308da6
Ensure that progressive contents are URL contents for playback
A ResolverException will be now thrown otherwise.
2022-06-19 15:41:29 +02:00
Stypox 4e87f5aabc
Remove misleading first "Non" from getNonUrlAndNonTorrentStreams 2022-06-18 18:52:32 +02:00
Stypox 2019af831a
Refactor PlaybackResolver and fix cacheKeyOf
In commonCacheKeyOf the result of an Objects.hash() was ignored
2022-06-18 18:41:44 +02:00
Stypox 1e076ea63d
Wrap debug log in if(DEBUG) 2022-06-18 18:09:12 +02:00
Stypox 4863084fa2
Improve code in VideoDetailFragment 2022-06-18 17:49:04 +02:00
Stypox 7ba79171c7
Refactor creation of DownloadDialog 2022-06-18 17:40:22 +02:00
AudricV e3c2aea3cc
Fix playback of non-URI HLS streams
A custom HlsPlaylistParserFactory cannot be used anymore to play HLS streams.

This needs to be replaced by a custom HlsDataSourceFactory, which returns a ByteArrayDataSource (where the bytes of this DataSource correspond to the bytes of the playlist string) and a specified DataSource for other request types.

This model has two limitations:

- if media requests are relative, the URI from which the manifest comes from (either the manifest URI (preferred) or the master URI (if applicable)) must be returned, otherwise the content will be not playable, as it will be an invalid URL, or it may be treat as something unexpected, for instance as a file for DefaultDataSources;
- if the playlist is a master playlist, endless loops should be encountered because the DataSources created for media playlists will use the master playlist response instead of fetching the corresponding playlist. With the current model of HlsDataSourceFactory, there is no possibility to distinguish the playlist type or the URI that is requested.

If ExoPlayer provides a way to create HlsMediaSources with an HlsPlaylist in the future, it should be used instead of this solution.
2022-06-17 22:01:30 +02:00
AudricV 21c9530e8b
Throw a dedicated exception when errors occur in PlaybackResolver
A new exception, ResolverException, a subclass of PlaybackResolver, is now thrown when errors occur in PlaybackResolver, instead of an IOException
2022-06-17 22:01:29 +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 73855cacb7
Use StreamTypeUtil where possible and add isAudio and isVideo to this utility class 2022-06-17 22:01:26 +02:00
Stypox 8dad6d7e1c
Code improvements here and there 2022-06-17 22:00:53 +02:00
Stypox e5ffa2aa09
Add comments to PlaybackResolver and remove useless @NonNull 2022-06-17 22:00:52 +02:00
Stypox 8445c381c5
Use DownloaderImpl.USER_AGENT directly
instead of passing it as a parameter
2022-06-17 22:00:52 +02:00
Stypox fa46b7bf85
Add comments and use downloader user agent in YT data source
YoutubeHttpDataSource
2022-06-17 22:00:52 +02:00
Stypox 7ce2250d85
Improve CacheFactory and PlayerDataSource code 2022-06-17 22:00:51 +02:00
Stypox ef20d9b91a
Move stream's cache key generation in PlaybackResolver and improve PlaybackResolver's code 2022-06-17 22:00:51 +02:00
AudricV fbee310261
Move SimpleCache creation in PlayerDataSource to avoid an IllegalStateException
This IllegalStateException, almost not reproducible, indicates that another SimpleCache instance uses the cache folder, which was so trying to be created at least twice.
Moving the SimpleCache creation in PlayerDataSource should avoid this exception.
2022-06-17 22:00:51 +02:00
AudricV 7d6bf4b0ca
Improve dialog of streams for external players and fix use of the wrong codec in the list of available streams in it after a codec change in Video and Audio settings
The VideoDetailFragment will now get video streams dynamically instead of storing them as a field, so the good codec can be chosen by ListHelper.
To select a stream to play, user has now to select the quality in the list of available qualities and then press the new OK button in the alert dialog.
2022-06-17 22:00:50 +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
Stypox a59660f421
Merge pull request #8340 from litetex/fix-add-to-playlist
Fix "Add to playlist" not working and cleanup "RouterActivity" choice handling
2022-06-05 11:47:51 +02:00
Stypox 75e5fe7d27
Merge pull request #8404 from Isira-Seneviratne/Use_AppCompatResources
Use AppCompatResources.
2022-05-30 15:42:04 +02:00
litetex 2985258074 Bonus fix: Made ``single_choice_dialog_view`` scrollable + use viewbinding 2022-05-28 00:46:28 +02:00
litetex 911ac65d1e Code cleanup 2022-05-28 00:46:27 +02:00
litetex d2967f514b Improved docs, format and code style 2022-05-28 00:46:27 +02:00
litetex a68c6a2cfc Reworked incorrect choice handling and centralized it 2022-05-28 00:39:13 +02:00
litetex 733f6aae85 Fix add to playlist 2022-05-28 00:39:13 +02:00
Stypox 1daece3bee
Merge pull request #8382 from Isira-Seneviratne/Remove_compat_methods
Remove unnecessary compat method calls.
2022-05-22 21:59:04 +02:00
Stypox adddd48c1d
Merge pull request #8391 from Isira-Seneviratne/Use_JvmOverloads
Use JvmOverloads.
2022-05-22 21:56:17 +02:00
Stypox bd5eda92a7
Improvements to sharing content with thumbnail 2022-05-22 21:34:10 +02:00
Isira Seneviratne ac5843edb0 Merge branch 'dev' into Use_JvmOverloads 2022-05-16 12:43:24 +05:30