Commit Graph

373 Commits

Author SHA1 Message Date
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
litetex 99104fc11d
Clean up pre-Lollipop checks 2022-07-13 19:02:24 +02:00
Stypox 4e87f5aabc
Remove misleading first "Non" from getNonUrlAndNonTorrentStreams 2022-06-18 18:52:32 +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 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 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
litetex 2985258074 Bonus fix: Made ``single_choice_dialog_view`` scrollable + use viewbinding 2022-05-28 00:46:28 +02:00
karyogamy 4e459b3383 updated: ExoPlayer to 2.17.1.
added: MediaItemTag for ManagedMediaSources.
added: silent track for FailedMediaSource.
added: keyframe fast forward at initial playback buffer.
added: error notification on silently skipped streams.
2022-03-19 15:56:45 -04:00
litetex a95318a4f9
Merge pull request #7349 from TiA4f8R/seamless-transition-players
Add seamless transition between background and video players when putting the app in background (for video-only streams and audio-only streams only)
2022-02-26 16:16:18 +01:00
litetex 96b930cd07 Revert "Respect cutouts when playing in MultiWindow"
This reverts commit c92a90749e.
2022-02-21 20:30:56 +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 608e73e2f2
Set workaround for playback position reset when switching to main player with content thumbnail
The workaround set before was not applied when switching to main player with content thumbnail from popup or background player. This commit fixes this by applying the workaround when switching to main player with content thumbnail from popup or background player.
2022-02-11 19:32:13 +01:00
litetex 41faf70da1 Workaround: Set recovery before switching player
Quick fix
2022-01-17 20:52:07 +01:00
litetex ddcbe27fd3
Fixed search not accepting key input after closing player overlay (#7607)
* Fixed search not accepting key input after closing player overlay

* Made comments easier to understand

* More comments
2022-01-03 11:52:08 +01:00
Jaspann 558c9147a2 Move sub icon visibility line 2021-12-28 15:54:36 -05:00
William Parker fb3be544ce
Fixed code styling 2021-12-26 00:12:48 -05:00
Jaspann 53f5741317 Fixes view of sub-channel icon when not in use 2021-12-25 18:10:05 -05:00
TobiGr a163d5461d Make PlayerHolder.bound private 2021-12-21 20:51:18 +01:00
Robin d3562c70f5
Merge pull request #7451 from Cheechaii/respect-cutout-in-multiwindow
Respect cutouts when playing in MultiWindow
2021-12-19 13:23:28 +01:00
Cheechaii c92a90749e Respect cutouts when playing in MultiWindow 2021-12-09 20:58:05 +01:00
Stypox 81f740d409
Replace ErrorActivity with ErrorUtil 2021-12-04 10:36:36 +01:00
litetex 4c8dca5300 Fixed NPE + Problems with context 2021-11-28 13:42:26 +01:00
litetex 0d51eefbb9 Refactoring 2021-11-23 20:12:16 +01:00
litetex 769791af7a Added a "Crash the player" debug option 2021-11-23 20:12:09 +01:00
Tobi 44cad27d0a
Merge pull request #7268 from TeamNewPipe/release/0.21.13
Release 0.21.13
- Fix playback resume
- Ensure that the service for new version checks is not started in background
2021-10-21 20:51:01 +02:00
Stypox ac071b383f Revert part of #6872 and fix playback resuming 2021-10-20 23:20:26 +02:00
litetex 731640997e Cleaned up PlaylistDialog-related code 2021-10-09 18:46:20 +02:00
Stypox 7e26748dc4
Merge branch 'master' into dev 2021-09-19 22:37:00 +02:00
Stypox 7667b2ce59
Fix restoring orientation in onBack 2021-09-19 19:09:11 +02:00
z3r0r4 70354eb73e
Add play next to long press menu & refactor enqueue methods (#6872)
* added mvp play next button in long press menu; new intent handling, new long press dialog entry, new dialog functions, new strings

* changed line length for checkstyle pass

* cleaned comments, moved strings

* Update app/src/main/res/values/strings.xml

to make long press entry more descriptive

Co-authored-by: opusforlife2 <53176348+opusforlife2@users.noreply.github.com>

* Update app/src/main/res/values/strings.xml

Co-authored-by: Stypox <stypox@pm.me>

* replace redundant nextOnVideoPlayer methods

Co-authored-by: Stypox <stypox@pm.me>

* add enqueueNextOnPlayer and enqueueOnPlayer without selectOnAppend and RESUME_PLAYBACK/ deprecate enqueueNextOn*Player and enqueueOn*Player methods
add getPlayerIntent, getPlayerEnqueueIntent and getPlayerEnqueueNextIntent without selectOnAppend and RESUME_PLAYBACK/ deprecate those with
add section comments

* removed deprecated methods
removed redundant methods

* removed deprecated methods
removed redundant methods

* replaced APPEND_ONLY, removed SELECT_ON_APPEND / replaced remaining enqueueOn*Player methods

* now works with playlists

* renamed dialog entry

* checking for >1 items in the queue using the PlayerHolder

* making enqueue*OnPlayer safe to call when no video is playing (defaulting to audio)

* corrected strings

* improve getQueueSize in PlayerHolder

* long press to enqueue only if queue isnt empty

* add Whitespace

Co-authored-by: Stypox <stypox@pm.me>

* clarify comments / add spaces

* PlayerType as parameter of the enqueueOnPlayer method
add Helper method

* using the helper function everywhere (except for the background and popup long-press actions (also on playlists, history, ...)), so basically nowhere
/ passing checkstyle

* assimilated the enqueue*OnPlayer methods

* removed redundant comment, variable

* simplify code line

Co-authored-by: Stypox <stypox@pm.me>

* move if

* replace workaround for isPlayerOpen()

Co-authored-by: Stypox <stypox@pm.me>

* replaced workarounds (getType), corrected static access with getInstance

* remove unused imports

* changed method call to original, new method doesnt exist yet.

* Use getter method instead of property access syntax.

* improve conditional for play next entry

Co-authored-by: Stypox <stypox@pm.me>

* show play next btn in feed fragment

Co-authored-by: Stypox <stypox@pm.me>

* add play next to local playlist and statistics fragment

Co-authored-by: Stypox <stypox@pm.me>

* formating

Co-authored-by: Stypox <stypox@pm.me>

* correcting logic

Co-authored-by: Stypox <stypox@pm.me>

* remove 2 year old unused string, formating

Co-authored-by: Stypox <stypox@pm.me>

* correct enqueue (next) conditionals, default to background if no player is open. Dont generally default to background play.

* remove player open checks from button long press enqueue actions

* improve log msg

* Rename next to enqueue_next

* Refactor kotlin

Co-authored-by: opusforlife2 <53176348+opusforlife2@users.noreply.github.com>
Co-authored-by: Stypox <stypox@pm.me>
2021-09-18 11:22:49 +02:00
TobiGr 298e96b821 Fix updating the wrong tabs when changing settings while running the minimized player in VideoDetailFragment
The comments tab was updated although the settings for the description tab were changed.
2021-09-04 22:36:47 +02:00
Stypox ed408b2094
Move fullscreen-related comments to javadocs 2021-09-01 20:13:27 +02:00
Stypox cf9b482be2
Completely close player when changing stream w/o autoplay 2021-09-01 20:13:27 +02:00
Stypox 1d935b46f9
Open fullscreen when switching from popup to main player 2021-09-01 20:13:24 +02:00
Stypox 520ac2e935
Fix bottom sheet state after automatic fullscreen 2021-09-01 20:12:14 +02:00
Stypox c6316abbce
Fix opening directly fullscreen on tablets 2021-09-01 20:12:09 +02:00
Stypox 2dfe837c35
Extract isLandscape and isInMultiWindow to DeviceUtils 2021-09-01 20:09:08 +02:00
Stypox 3c2ea7697c
Add option to directly open fullscreen when the main player starts 2021-09-01 20:08:37 +02:00
Stypox cfdcb92fa3
Always use our strings, not android ones 2021-08-30 16:37:01 +02:00
Stypox 6eaff5ca6a
Apply review: move thumbnail loading out of Player 2021-08-24 10:56:25 +02:00
Stypox fcef783bbb
Replace UniversalImageLoader with Picasso 2021-08-24 10:56:25 +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 fa8630ddae
Use url comparison between queue items when disabling preloading
From #4562: Disable player stream preloading only if the current stream is going to be replaced for sure (see this). equals() was implemented for PlayQueueItems, so that (only) the url is compared when checking them.
2021-07-21 18:09:18 +02:00
evermind 48c2c156cb convert PlayerHolder to Singleton, handle context within, bugfix ServiceConnection leak
- bugfix: have ServiceConnection created only once!

- select the context within the PlayerHolder to start, stop, bind or unbind the service
  -> we have to make sure the Service is started AND stopped within the same context
  -> so let PlayerHolder be the one to select the context

- remove removeListener() and replace the call with setListener(null)
- Compatibility: use ContextCompat.startForegroundService instead of startService()
2021-07-06 12:31:26 +02:00
evermind 435813355f use viewBinding correctly 2021-07-06 07:56:05 +02:00
evermind e30a552b6c remove duplicated code for toggle Fullscreen 2021-07-06 07:56:00 +02:00
evermind 22a4a4b2df move null checks for player and playerService to helper methods
- code is easier to read
- duplication of code reduced
2021-07-06 07:55:52 +02:00
Tobi be676ad93c
Merge pull request #3371 from mauriciocolli/feed-hide-played-items
Add ability to hide played items in a feed
2021-06-18 09:18:48 +02:00