-
-
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
Fix opening VideoDetailFragment and much more #4562
Conversation
So far seems it seems good. I didn´t encounter any problems with the playback. I will test it thoroughly tommorow. |
I don't think so. newQueue != null && playQueue != null
!Objects.equals(newQueue.getItem(), playQueue.getItem()) What's the reason for them to exist? They will not fix the issue with preloading of background & popup because the fix would be to apply disabled preloading for Why did you delete lines after https://github.com/TeamNewPipe/NewPipe/blob/dev/app/src/main/java/org/schabi/newpipe/fragments/detail/VideoDetailFragment.java#L858 ? They were here for a reason. If you found another way to do the same thing, then ok. You made here many good things (based on description). It's hard to see all new code on a phone but fixes and features you introduced is very important! |
Ok. Some things I found:
|
The "popup player stopping after viewing video details" problem does not happen with this apk from what I tested. |
I have not encountered #4432 after a couple hours of queuing and such. Seems fixed for me. |
Yay! So many good changes! Gonna test now. |
Does this not include the decryption retry code? I got that error just now. |
@opusforlife2 This branch is not based on the latest dev. that fix is not included |
Can confirm it fixes #4403. 👍 |
this is great if share to player, but please make it that it sould enqueue when sharing to pup-up or background player.... or a separate enqueue option.. the reason:
|
@MD77MD As I explained, this is not true, since now if there is a video already playing the "Show info" button is shown, and from video details you can just long press on background or popup |
@avently About the preloading part, I then am not sure I understand when preloading should be disabled. From what I understood so far: when the current stream is being dismissed in favour of a new one, then preloading can be disabled for that track since it is soon going to be replaced. Therefore, when switching queues, we should make sure the newly selected video is different from the current one, otherwise preloading would be disabled forever. Ok, maybe if the video is the same and the timestamp differs we could disable preloading, but that's just a special case, so I wouldn't add complexity for that for now.
Do you mean that by removing my conditions for preloading it creates the explained issues, or that my code creates those?
If you are talking about "Situation when user switches from players to main player. All needed data is here, we can start watching" then yeah, I am handling the switching players case directly here |
1fe3e98
to
76c7595
Compare
Another apk with the same changes but with updated extractor: app-debug.zip |
@Stypox here I provided steps for reproduce problems. You said that you made another way for switching players so that way should be used in order to switch to main player from BackgroundActivity like in my reproducible example. Because now you're not switching players when moving to video details from backgroundactivity. About preloading part: Did you checked with logs, for example, that your code for preloading really getting called and not just skipped when one stream changes to another? |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
@avently @TobiGr @opusforlife2 @B0pol I added more changes, and fixed the issue reported by avently:
|
Changes sound good, the code for new commit looks good too. I always like optimizations:) |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
@Stypox 2 of the 3 linked issues are reported to be fixed. What else needs to be tested, exactly? |
I guess a last round of tests about the things I changed would be enough, just to be sure the new behaviour is not broken. Other than that, yeah, I think this is ready |
@Stypox But... but the stuff you've changed is all programming jargon. :( That's why I don't know what to test. |
@opusforlife2 just opening the video detail fragment under many different conditions is enough |
@vkay94 there is nothing to be sorry about, accidental problems always happen ;-) |
Yeah, I know, but I through I checked it carefully :) @Stypox Can you add the fix with this PR? Simply replace both methods with each other ;) |
@vkay94 is this ok? |
Fixed. |
… on the main player when sharing something to NewPipe
1caf816
to
617ee0a
Compare
I rebased and tested the rebased version all day with multiple situations and everything worked flawlessly: app-debug.zip The only issue I found, that is present even in NewPipe 0.20.2, and is thus not caused by this PR, is:
Since the above issue is not caused by this PR I will take care of fixing it in a future one, so I think this can be merged @TobiGr |
Then please open a new issue |
@B0pol I was going to ;-) |
#4678. my issue :video names on Youtube are Chinese,but on NewPipe they became english titles,maybe it's because of the community contributions 。🤔 |
@jay00128 please open an issue in english about what you are experiencing and follow the template |
From TeamNewPipe#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.
What is it?
Description of the changes in your PR
openVideoDetailFragment()
which sends the new data directly to the fragment manager,openVideoDetail()
which sends anIntent
received byMainActivity
which in turn callsopenVideoDetailFragment()
.openVideoDetailFragment()
have changed:autoPlay
is not there anymore, andswitchingPlayers
was added to be able to always determine correctly if the function was called as a way to switch players.autoPlay
is now calculated based on the user's preference, onswitchingPlayers
and on whether there is already a background/popup player running. For more info see these lines. This makes it far more clear when the mini player will start playing (I think some situations were handled correcly only by accident before)equals()
was implemented forPlayQueueItem
s, so that (only) the url is compared when checking them.@Nullable
and@NotNull
to some variables inVideoDetailFragment
, allowing me to enforce or remove some null checks. Renamename
totitle
for consistency.static
qualifier fromcurrentInfo
andplayQueue
inVideoDetailFragment
: they were never accessed as static members, and having them static caused random problems while replacing theVideoDetailFragment
with a new instance of itself.MainActivity
when sharing something to NewPipe and pressing on "Show info". This was introduced in 67d2b91 by @yausername while handling urls in comments, but at that point there was no unified player, so probably without that it didn't work. But now everything works good even by keeping the currentMainActivity
instance, and this yields many improvements: opening urls in descriptions in NewPipe now does not erase backstack, nor does clickingOpen details
on queue items, and probably something else. :-DautoPlay
would befalse
.VideoDetailFragment
can fetch data itself without issues.START_PAUSED
withPLAY_WHEN_READY
for better consistency (i.e. not inverting twice).BackgroundPlayerActivity
toServicePlayerActivity
, thus removing a useless abstract function.RouterActivity
getPlayerIntent()
functions inNavigationHelper
and removed unused navigation functions.reportingReactor
was used to capture and log broadcast events in debug builds. This can be undone if unwanted.autoplay_through_intent_key
(left there by accident after 2907, probably)openDownloadDialog
, inopenDownloads
, inPlayerHelper
and moreFixes the following issue(s)
Fixes #4541
Fixes #4432
Fixes #4403
Fixes #4687
Fixes #4712
APK testing
Since this PR changes the logic of many things, the more people can test, the better.
@opusforlife2 @Jean757 @shadow00 @nbmrjuhneibkr could you test if the new share behaviour suits you, i.e. #4403?
@Anotherlife @pew-pew could you test if there are no more issues with playback breaking after opening details, i.e. #4541?
@aand18 @Medard22 @UserX404 @ventilaar @floral-qua-floral @Idiotten could you test if this solves #4432, i.e. background playback stopping at random after some (constant) time?
app-debug.zip
Due diligence