Commit Graph

399 Commits

Author SHA1 Message Date
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
Stypox edfe0f9c30
Fix disposables handling for text linkifier
also use differently Markwon methods to convert plain text to markdown
2021-06-11 12:12:12 +02: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
TiA4f8R d85afd6435
Initial work to add the image of the content in the share sheet
Also do some fixes when sharing a file in downloads and some improvements in JavaDocs of ShareUtils class.
2021-06-11 12:12:00 +02:00
Stypox 0113ad5e14
Correctly save stream progress at the end of a video 2021-06-09 15:53:51 +02:00
evermind a012e26d63 fix Rotation crash on „Video not available“ page (#5941)
The EmptyFragment should not have a constructor at all.
Now a static methods creates the Fragment and arguments
are handled via a Bundle.
2021-05-05 08:55:54 +02:00
krlvm e484339cca
Merge branch 'dev' into daynight 2021-04-03 00:08:26 +03:00
Stypox 2af20d5c40
Merge pull request #5974 from fynngodau/related-items
Rename related streams to related items
2021-04-02 20:34:39 +02:00
Saurav Rao 8df935f5fe
NullPointerException on screen rotation during exit fix (#5976) 2021-04-01 15:07:21 +02:00
Fynn Godau c9766d25ef Rename related streams to related items 2021-03-31 22:33:22 +02:00
krlvm fd14c8cdce
Fix Dark elements in Light Theme 2021-03-27 17:46:05 +03:00
Stypox 93592d23f4
Merge pull request #5820 from TeamNewPipe/mini_player_title
Fix empty stream title in minimized player
2021-03-17 08:56:50 +01:00
TobiGr 292e103073 Ignore ContentNotSupportedException caused by Bandcamp fan pages 2021-03-14 17:52:15 +01:00
Tobi 404a6c12a6
Merge pull request #5148 from Stypox/error-panel
Show improved error panel instead of annoying snackbar or crashing
2021-03-14 17:41:27 +01:00
Tobi 8271409afe
Merge pull request #5562 from mbarashkov/hardware_keyboard_space_shortcut_v2
Implement "pause/play" toggle on hardware keyboard space button.
2021-03-14 13:08:44 +01:00
TobiGr 985f659026 Fix empty stream title in minimized player 2021-03-13 20:12:57 +01:00
Stypox c2b6cec37d
Hide meta info panel in search when starting a new search 2021-03-12 23:21:54 +01:00
Stypox b265cabc22
Fix views not scrollable when showing error panel 2021-03-12 23:21:54 +01:00
Stypox 463dd8ea74
Completely remove return activity, now outdated 2021-03-12 23:21:54 +01:00
Stypox c43bca6007
Add report/solve-recaptcha button in error panel
It will be shown even when nothing could be loaded not due to a network error, and the user can choose to ignore or report it.

Also improve error reporting arguments
Also completely refactor error activity
Also improve some code here and there
2021-03-12 23:21:49 +01:00
Stypox 553b80164b
Move all error-related classes into error package 2021-03-07 17:49:28 +01:00
Stypox 138513d790
Hide tab layout view pager on error 2021-02-14 13:40:17 +01:00
Stypox 1e5dc01825
Fix tab layout visibility with age restricted videos
Add comments
2021-02-14 13:25:39 +01:00
Mikhail Barashkov aea912f499 Implement "pause/play" toggle on hardware keyboard space button. 2021-02-12 11:58:15 +03:00
Stypox 3868243c2a
Animate secondary controls toggle 2021-01-17 15:59:29 +01:00
Stypox 243f539439
Use KoreUtil function 2021-01-17 15:46:00 +01:00
Stypox 71d92c8d1b
Hide tab layout in detail fragment when there is no space 2021-01-17 15:42:54 +01:00
Stypox e840d42fb9
Add content description to detail fragment tabs 2021-01-17 15:38:12 +01:00
Stypox 750c4ffbd3
Add preference to hide description tab in video details 2021-01-17 15:36:42 +01:00
Stypox 4c3ba0fe3d
Add icons to VideoDetailFragment tab layout for better accessibility 2021-01-17 15:34:24 +01:00
Stypox a314f55a17
Move description to a tab alongside related streams and comments 2021-01-17 15:26:25 +01:00
Stypox 78a9811fe3
Add a secondary control panel to video detail fragment
It is shown when the user expands the description
It contains share, open in browser and play in kodi
2021-01-17 15:12:29 +01:00
Isira Seneviratne fe92abde0e Use view binding in VideoDetailFragment. 2021-01-17 09:57:40 +05:30
Stypox 594f0b10ba
Move TextLinkifier computation out of main thread 2021-01-16 13:23:42 +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
TiA4f8R a57fd69fb4
External sharing improvements
Improve NewPipe's share on some devices + fix crash when no browser is set on some devices

Catching ActivityNotFoundException when trying to open the default browser
Use an ACTION_CHOOSER intent and put as an extra intent the intent to
open an URI / share an URI when no default app is set.

Add a LinkHelper class which set a custom action when clicking web links
in the description of a content. This class also helps to implement a confirmation dialog when trying to open web links in an external app.
2021-01-16 13:23:06 +01:00
Isira Seneviratne 920e560b4b Convert AnimationUtils functions to extension functions. 2021-01-16 14:49:37 +05:30
vkay94 37aa41afae Add stream segments to player 2021-01-14 21:58:19 +01:00
Tobias Groza 8fd48a88be
Merge pull request #4939 from Atemu/dont-exit-fullscreen-on-rotation
VideoDetailFragment: Don't exit fullscreen on rotation in tablet UI
2021-01-14 16:25:51 +01:00
Stypox 4a12b0ab2d
Revert hiding detail fragment tabs when in fullscreen 2021-01-14 10:25:48 +01:00
Stypox f6e2dd1480
Merge player classes into a single one 2021-01-14 10:25:44 +01:00
Mikhail Barashkov 907106156f When in Fullscreen playback mode, toggle play/pause with the hardware Space button. 2021-01-07 17:32:16 +02:00
Stypox 1b4bde4e78
Merge pull request #5221 from B0pol/notifications
Dynamically get package name
2021-01-01 18:05:43 +01:00
urlordjames d45ce19b04 Fix #4481 2020-12-28 09:46:10 -05:00
Stypox 19f9b4f502
Improve meta info layout and merge duplicate code 2020-12-20 15:10:18 +01:00
bopol 2b8837609b dynamically get package name
it fixes issues with forks or debug builds, e.g. when you open two newpipe apps (with debug or fork apps), close one notification, it closes all newpipe notifications
fixes https://github.com/TeamNewPipe/NewPipe/issues/4653
2020-12-20 13:52:20 +01:00
TobiGr 0a831ec84e
Display meta info about search query, stream creator or topic
Closes #4614
2020-12-20 11:56:22 +01:00
Stypox f0ca916432
Update most dependencies 2020-11-22 14:03:10 +01:00
Isira Seneviratne 340b92e32b Convert ErrorInfo to Kotlin and use the Parcelize annotation. 2020-11-21 12:47:35 +05:30
Atemu c0ff1e86b9 VideoDetailFragment: Don't exit fullscreen on rotation in tablet UI
Fixes https://github.com/TeamNewPipe/NewPipe/issues/4936

Going from portrait to landscape doesn't toggle fullscreen in tablet mode, so
the reverse action shouldn't do it either.
2020-11-20 21:52:27 +01:00
TacoTheDank 2669ba944d Correct some other small lints 2020-11-19 18:54:27 -05:00
TacoTheDank ad2ea0b807 Lint: 'if' replaceable with 'switch' 2020-11-18 17:58:41 -05:00
TacoTheDank 773bde14ab Lint: 'size() == 0' replaceable with 'isEmpty()' 2020-11-18 17:54:16 -05:00
Stypox 4c7b5d44a0
[Regression] Fix videos added multiple times to detail fragment stack 2020-11-15 22:23:47 +01:00
Stypox 1b47a1a994
Fix switching to main player when MainActivity is closed 2020-11-08 10:00:28 +01:00
Stypox 00a178f7d3
Fix tapping on video thumbnail does nothing 2020-11-08 10:00:28 +01:00
Stypox 2a2c82e73b
More fixes with opening VideoDetailFragment 2020-11-08 10:00:28 +01:00
Stypox 1d42e45d78
Unify all ways of opening VideoDetailFragment 2020-11-08 10:00:27 +01:00
Tobias Groza f4435f9031
Merge pull request #4555 from Stypox/playqueue-crash
Fix NullPointerException in queue handling
2020-11-08 01:19:38 +01:00
Isira Seneviratne c745b845c5 Switch to the Java 8 Date/Time API. 2020-11-05 15:02:51 +05:30
TacoTheDank 31cffa68c5 Push conditionals inside branch expressions 2020-10-31 15:57:26 -04:00
Stypox e406b6f780
Fix NullPointerException in queue handling 2020-10-26 18:15:59 +01:00
bopol 2dad9666a9 polish strings, fix build error 2020-10-26 17:01:55 +01:00
vkay94 32a142bf79 Fix PlaylistAppendDialog: Renamed method and replaced with Runnable 2020-10-23 09:44:26 +02:00
vkay94 2680d41a3d Fix PlaylistAppendDialog showing when no local playlists exist 2020-10-23 09:44:26 +02:00
Tobias Groza 6fce06906d
Merge pull request #4354 from Stypox/restriction-strings
Improve age restriction and yt restricted content strings
2020-10-11 12:14:13 +02:00
Stypox 84694a8bbd
Improve age restriction and yt restricted content strings 2020-10-11 12:06:36 +02:00
opusforlife2 b3555385e6
Ask for confirmation before clearing queue...
Even when there is only one video in it.
2020-10-09 14:46:42 +00:00
Stypox dbb86d25e1
Fix video detail controls visibility set inconsistently 2020-10-02 16:03:43 +02:00
Avently 6665d630ec Added comments and improved the code 2020-09-30 00:49:34 +03:00
Avently c1d5a5cd98 Player will be rebound when needed, prev/next/queue buttons, preserving paused state
- each time something starts to play in any player VideoDetailFragment will be started (if not yet started) and mini player will show up. It makes possible to see a playing stream in mini player even if the stream was started without using fragment or after player service was closed somehow
- play/next/queue buttons will be updated in realtime when stream was added/removed from queue instead of waiting for a onPlay/onPause action to happen
- when popup or background players start the stream will start playing only if paused state wasn't requested. Which means, for example, if a user opens popup it will be started when START_PAUSED is false. If, for example, the stream was played in main player and then popup was started the stream will still be playing, but if it was paused it still be paused in popup (or background) in APPEND_ONLY mode (but will be playing on new queue initialization)
2020-09-29 06:22:53 +03:00
Avently 0370fa6c00 Merged 'dev' branch 2020-09-27 18:02:31 +03:00
Avently 609bf64856 Merged 'dev' branch 2020-09-27 15:04:20 +03:00
Avently d0fc9fda71 Fixed player's ZOOM mode for KitKat devices 2020-09-27 04:25:06 +03:00
Avently df9823988e Changes for tablets and device's orientation behavior
- the app will not rotate the screen to portrait after video completes, it will just exit from fullscreen mode
- ability to rotate the orientation via fullscreen button from landscape to portrait when device has locked orientation in landscape
- ability to enter/exit to/from fullscreen on tablets with unlocked global orientation in portrait mode
2020-09-27 04:11:38 +03:00