Commit Graph

155 Commits

Author SHA1 Message Date
Stypox 8187a3bc04
Move PlayerType into its own class and add documentation
Also replace some `isPlayerOpen` with direct `playerType == null` checks.
2022-07-13 23:33:18 +02:00
Stypox 76ced59b62
Refactor player: separate UIs and more 2022-07-13 23:25:26 +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
Stypox 6e8c9f92cb
Merge branch 'dev' into pr2335 2022-03-19 22:29:10 +01:00
litetex 37517c7dd1
Merge pull request #7570 from TeamNewPipe/improvement/infoItemDialogBuilder
Refactor generating InfoItemDialog's
2022-02-26 16:18:39 +01:00
TobiGr ee477b25e5 Move StreamDialogEntry.openChannelFragment to NavigationHelper 2022-02-20 20:26:27 +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
Stypox d5cfcb28fc
Merge branch 'dev' into pr2335 2022-01-24 10:25:07 +01:00
litetex e127db6fa6 Simplified toast showing behavior
after feedback from the review
2022-01-23 15:34:11 +01:00
litetex 49b1649348 Revert "Merge pull request #7568 from vhouriet/vhouriet_feature_already-playing-in-backgroud"
This reverts commit ee19ea66b3, reversing
changes made to 6b490ee547.
2022-01-23 15:34:11 +01:00
Stypox cd95ec4e12
Merge branch 'dev' into pr2335 2021-12-31 19:20:18 +01:00
litetex fc0e709817
Fixed usage of wrong string 2021-12-27 00:14:04 +01:00
litetex b67bf16d4f
Minified code 2021-12-26 23:57:54 +01:00
vhouriet 989bcbf895 Add Already playing in background toast 2021-12-23 22:12:38 +01:00
TobiGr 1130aba7ca Merge remote-tracking branch 'origin/dev' into notifications-1 2021-11-02 07:56:09 +01:00
TobiGr 80bf47493e Fix check wether the app's notifications are disabled via system settings
Add comments
Rename a few methods
2021-10-22 21:24:43 +02: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
TobiGr 5fcc3b4dab [Player] Fix resuming playback
This was caused by #6872
2021-10-17 12:13:38 +02:00
litetex 7edef8d5a2
Merge pull request #7222 from ktprograms/queue-menu-channel-details
Added the 'Show Channel Details' menu item to the Queue long press menu
2021-10-15 20:28:18 +02:00
litetex 2271ea4281 Improved documentation 2021-10-15 20:16:34 +02:00
TobiGr 16d4a034e2 Merge remote-tracking branch 'origin/dev' into notifications 2021-10-14 21:15:43 +02:00
ktprograms afc8db8f81 Add reasoning for separate openChannelFragmentUsingIntent method 2021-10-14 09:51:25 +08:00
litetex 9f7a8407ca
Merge pull request #7224 from vhouriet/vhouriet_fix_check-background-player-type
Check if background player already active before displaying player toast
2021-10-12 19:47:50 +02:00
vhouriet 50634eb2b3 Check player type before displaying background player toast 2021-10-11 19:41:22 +02:00
TobiGr cea14c9d0d Merge remote-tracking branch 'origin/dev' into notifications-1 2021-10-11 16:37:49 +02:00
ktprograms a2ff770afc Added the 'Show Channel Details' menu item to the Queue long press menu
Created a method in NavigationHelper that opens the channel fragment using an Intent to MainActivity instead of replacing fragments.
2021-10-11 14:47:37 +08:00
vhouriet 1c9f68bcae Fix clicking timestamp shows Toast "Playing in popup mode"
Fixes #6662
2021-10-05 18:15:36 +02:00
litetex b633108a4c Use the correct TAG in NavigationHelper 2021-10-03 22:04:34 +02:00
Koitharu fb0473da39
Merge branch 'dev' of https://github.com/TeamNewPipe/NewPipe into feature/notifications 2021-09-20 07:26:01 +03:00
Stypox 7e26748dc4
Merge branch 'master' into dev 2021-09-19 22:37:00 +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
Tobi a2887034a6
Merge pull request #7068 from litetex/fix-restart
Fixed restarting not working properly
2021-09-11 12:51:38 +02:00
Vasiliy da9bd1d420
Notifications about new streams 2021-09-07 13:30:16 +03:00
litetex fda0a550fd Fixed the app restarting not working properly
* Using [``process-phoenix``](https://github.com/JakeWharton/ProcessPhoenix)
2021-09-06 20:47:44 +02:00
TobiGr 4d51ebc37a Fix a few SonarLint warnings 2021-09-05 19:54:28 +02:00
Stypox 1d935b46f9
Open fullscreen when switching from popup to main player 2021-09-01 20:13:24 +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 fcef783bbb
Replace UniversalImageLoader with Picasso 2021-08-24 10:56:25 +02:00
Tobi 14dab85ff0
Merge pull request #6566 from evermind-zz/various-fixes-for-upstream
Convert PlayerHolder to Singleton; cleanup in VideoDetailFragment; Player/MainPlayer do not call onDestroy() directly
2021-07-14 09:46:04 +02:00
TobiGr 9ca2691a2c Add close() method to NewPipeDatabase 2021-07-10 14:46:51 +02:00
TobiGr 7c3f5a62c5 Fix crash when refreshing feed after importing database or subscriptions
The database was not closed correctly
2021-07-10 13:09:01 +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
Stypox 841fb4cfc5
Merge pull request #6495 from danielmbutler/Replace-System.exit-calls
Replace the System.exit calls with getActivity.finishAffinity()
2021-06-17 21:07:48 +02:00
danielmbutler 90de75968d Replaced System.Exit calls with FinishAffinity and Start Activity calls
Implemented "RestartApp" method defined in NavigationHelper.java.
 This method is used in ExitActivity.java and ContentSettingsFragment.java
2021-06-17 17:18:15 +01:00
TiA4f8R d6decc05d7
Move some classes to a new subpackage and adress requested changes
Rename URLHandler and KoreUtil classes to InternalUrlsHandler and KoreUtils.
Move InternalUrlsHandler, KoreUtils, TextLinkfier, ShareUtils classes to external_communication subpackage.
Remove unused param showPreviewText in shareText method of ShareUtils class.
Add initial work to be able to display an image preview of the content shared (not for downloads).
Use a better regular expression to parse timestamps in plain text descriptions.
2021-06-11 12:12:02 +02:00