-
-
Notifications
You must be signed in to change notification settings - Fork 3.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Added a play next button to the long press menu #6872
Conversation
…ew long press dialog entry, new dialog functions, new strings
to make long press entry more descriptive Co-authored-by: opusforlife2 <53176348+opusforlife2@users.noreply.github.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for adding this requested feature :-)
Sorry for the many things I asked you to do, feel free to ask for help or delegate something to me if you can't figure it out ;-)
app/src/main/java/org/schabi/newpipe/util/NavigationHelper.java
Outdated
Show resolved
Hide resolved
app/src/main/java/org/schabi/newpipe/util/NavigationHelper.java
Outdated
Show resolved
Hide resolved
app/src/main/java/org/schabi/newpipe/util/StreamDialogEntry.java
Outdated
Show resolved
Hide resolved
Co-authored-by: Stypox <stypox@pm.me>
My pleasure! |
A few bugs found.
|
Interesting and major findings (kind of weird as well) I'll look into it after i've implemented the requested changes.
Thank you very much for testing.
|
just s suggestion... could we call it "enqueue next"... also more consistent. this is what VLC uses if I remember correctly. |
@MD77MD mmmh yeah, I agree with you |
Hmmm. If there is only the current video in the queue, Enqueue and Enqueue Next will have the same function. Should the button check for >1 items in the queue before showing? |
Co-authored-by: Stypox <stypox@pm.me>
…d 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 redundant methods
removed redundant methods
…nqueueOn*Player methods
I cant seem to replicate these anymore, would it be possible for you to check again @SameenAhnaf ? |
I do have to note a new bug tho: I think it might not be referenced in the code which generates the dialog inside of playlist, dont know yet where to check though |
b8ebda7 fixes this hopefully |
Co-authored-by: Stypox <stypox@pm.me>
Co-authored-by: Stypox <stypox@pm.me>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry for keeping asking for changes, I hope this is the last one. Just to be sure, please make sure that the if (player is open)
before enqueueing is removed everywhere, and that the play next action is available in every long press menu of each fragment. Thank you :-)
app/src/main/java/org/schabi/newpipe/fragments/detail/VideoDetailFragment.java
Outdated
Show resolved
Hide resolved
…er is open. Dont generally default to background play.
I've checked the fragments mentioned in this comment and I could not find a dialog which doesnt include a play next action. |
app/src/main/java/org/schabi/newpipe/util/NavigationHelper.java
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you!
my pleasure. |
@@ -82,7 +84,6 @@ private NavigationHelper() { | |||
intent.putExtra(Player.PLAY_QUEUE_KEY, cacheKey); | |||
} | |||
} | |||
intent.putExtra(Player.RESUME_PLAYBACK, resumePlayback); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
NewPipe stopped resuming playback for all streams. This PR seems to be the cause of this.
Can you please explain, why the resumePlayback
parameter has been removed from all methods? It was not true
everywhere before. What was the reason to make it true
all the time?
Also, why has this line been removed? Shouldn't it be
intent.putExtra(Player.RESUME_PLAYBACK, true);
if resumePlayback
was always true
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does it work if you readd that line?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
From #7268:
Pressing the "background" button while a video is playing does not resume the stream, but still starts at the beginning.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, resumePlayback
should always be true
like you said, I don't know why I didn't notice it was removed altoghether. But now I was asking whether by readding the line you commented on (and replacing resumePlayback with true) fixes the issue.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll try to find out how to fix it now
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I analyzed things a little bit, here is what I saw:
- the only places where
resumePlayback
wasfalse
for enqueue actions were the ones I pointed out in the.
review comments - enqueueuing can currently happen in two ways
- when no video is already playing. In this case having
resumePlayback=true
makes sure the video is resumed, otherwise it isn't. Before this PR the only situation when it can happen that a video is enqueued when none were already playing andresumePlayback
isfalse
, is when the user long-presses the background or popup buttons in the video detail fragments (the first two.
review comments; the third one can never be triggered when no video is already playing since theenqueue
option would not be shown in the stream dialog menu in that case). - when something is already playing. In this case the
resumePlayback
value is simply ignored and the stream will start from the beginning when its turn will come. So havingresumePlayback=false
in the stream dialog menu (the last.
review comment) does not make a difference to having it set totrue
. - => I think we can safely set
resumePlayback=false
for every enqueue action, since it only really makes a difference when there is no player running and long-pressing the control buttons in video detail fragment, playlist & channel. This way a user could start a video withresumePlayback=true
by normal-pressing the background/popup button, and withresumePlayback=false
by long-pressing the background/popup button. And in my opinion it makes sense not to resume playback when enqueueing.
- when no video is already playing. In this case having
- this PR accidentally sets
resumePlayback=true
for every single action (being it enqueue or not). This is an error, mostly caused by not noticing that:- there were places where the enqueue action had
resumePlayback=false
- the
playOnMainPlayer
,playOnPopupPlayer
andplayOnBackgroundPlayer
functions also usedgetPlayerIntent
. After removing theresumePlayback
parameter fromgetPlayerIntent
Android Studio didn't give any error on those functions, since there was another overload ofgetPlayerIntent
with parameters(Context, Class, PlayQueue, boolean)
, but the last parameter wasplayWhenReady
instead ofresumePlayback
!
- there were places where the enqueue action had
I will soon create a PR reinstantiating resumePlayback
as it was before, except setting it to false
in all enqueue
actions as I explained above. Is this ok @TobiGr @Redirion ?
@@ -1096,8 +1097,8 @@ private void openPopupPlayer(final boolean append) { | |||
toggleFullscreenIfInFullscreenMode(); | |||
|
|||
final PlayQueue queue = setupPlayQueueForIntent(append); | |||
if (append) { | |||
NavigationHelper.enqueueOnPopupPlayer(activity, queue, false); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
.
@@ -1155,7 +1156,7 @@ private void openNormalBackgroundPlayer(final boolean append) { | |||
|
|||
final PlayQueue queue = setupPlayQueueForIntent(append); | |||
if (append) { | |||
NavigationHelper.enqueueOnBackgroundPlayer(activity, queue, false); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
.
if (type == AUDIO) { | ||
NavigationHelper.enqueueOnBackgroundPlayer(fragment.getContext(), | ||
new SinglePlayQueue(item), false); | ||
} else if (type == POPUP) { | ||
NavigationHelper.enqueueOnPopupPlayer(fragment.getContext(), | ||
new SinglePlayQueue(item), false); | ||
} else /* type == VIDEO */ { | ||
NavigationHelper.enqueueOnVideoPlayer(fragment.getContext(), | ||
new SinglePlayQueue(item), false); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
.
@Stypox That depends on how long you need to create the PR. If you can do it today, please do it. Otherwise I suggest to revert this PR and re-do it. We need to publish a fix quickly. |
I don't think I'll make it in time for today; tomorrow I will have time for sure though Edit: maybe I found some time |
It seems to be solved, still here's the specific commit where I deprecated the needed function and my comment on it for future reference. |
What is it?
Description of the changes in your PR
Adds a play next button in the long press menu of a video, as asked for in #4136.
Before/After Screenshots/Screen Record
Fixes the following issue(s)
APK testing
The APK can be found by going to the "Checks" tab below the title. On the left pane, click on "CI", scroll down to "artifacts" and click "app" to download the zip file which contains the debug APK of this PR.
Due diligence
Critique / Todo