Skip to content
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

Shouldn't it supposed to handle phones without picture-in-picture mode support? #3746

Closed
3 tasks done
r1klz opened this issue May 10, 2023 · 16 comments · Fixed by #3795
Closed
3 tasks done

Shouldn't it supposed to handle phones without picture-in-picture mode support? #3746

r1klz opened this issue May 10, 2023 · 16 comments · Fixed by #3795
Labels
bug Something isn't working

Comments

@r1klz
Copy link

r1klz commented May 10, 2023

Steps to reproduce

  1. Watch any video;
  2. Try to pause;
  3. Crash.

Expected behavior

Should not crash. This is happening after 0.14.0 update, where the option to disable "PiP" was removed.

Actual behavior

Crashing right after pausing the video.

LibreTube version

0.14.1

Android version

8.1.0

Other details

java.lang.IllegalStateException: setPictureInPictureParams: Device doesn't support picture-in-picture mode. at android.os.Parcel.readException(Parcel.java:2021) at android.os.Parcel.readException(Parcel.java:1959) at android.app.IActivityManager$Stub$Proxy.setPictureInPictureParams(IActivityManager.java:9479) at android.app.Activity.setPictureInPictureParams(Activity.java:2134) at com.github.libretube.compat.PictureInPictureCompat$$ExternalSyntheticApiModelOutline0.m(R8$$SyntheticClass:1) at com.github.libretube.ui.fragments.PlayerFragment$initializePlayerView$2.onIsPlayingChanged(PlayerFragment.kt:71) at com.google.android.exoplayer2.ExoPlayerImpl$$ExternalSyntheticLambda10.invoke(R8$$SyntheticClass:11) at com.google.android.exoplayer2.util.ListenerSet$$ExternalSyntheticLambda1.run(R8$$SyntheticClass:40) at com.google.android.exoplayer2.util.ListenerSet.flushEvents(ListenerSet.java:58) at com.google.android.exoplayer2.ExoPlayerImpl.updatePlaybackInfo(ExoPlayerImpl.java:899) at com.google.android.exoplayer2.ExoPlayerImpl.updatePlayWhenReady(ExoPlayerImpl.java:72) at com.google.android.exoplayer2.ExoPlayerImpl.setPlayWhenReady(ExoPlayerImpl.java:20) at com.google.android.exoplayer2.BasePlayer.pause(BasePlayer.java:5) at com.github.libretube.ui.fragments.PlayerFragment$$ExternalSyntheticLambda9.onClick(R8$$SyntheticClass:79) at android.view.View.performClick(View.java:6314) at android.view.View$PerformClick.run(View.java:24793) at android.os.Handler.handleCallback(Handler.java:790) at android.os.Handler.dispatchMessage(Handler.java:99) at android.os.Looper.loop(Looper.java:164) at android.app.ActivityThread.main(ActivityThread.java:6543) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:440) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:810)

Acknowledgements

  • I have searched the existing issues and this is a new ticket, NOT a duplicate or related to another open issue.
  • I have written a short but informative title.
  • I will fill out all of the requested information in this form.
@r1klz r1klz added the bug Something isn't working label May 10, 2023
@r1klz r1klz changed the title Shouldn't it supposed to handle phones without picture-in-picture mode? Shouldn't it supposed to handle phones without picture-in-picture mode support? May 10, 2023
@akano12
Copy link
Collaborator

akano12 commented May 10, 2023

Device doesn't support picture-in-picture mode

@r1klz
Copy link
Author

r1klz commented May 10, 2023

Device doesn't support picture-in-picture mode

Yes, I saw that. Tried to explain it on "Expected behavior" section; where I couldn't find the option to enable/disable this in the Settings.

In addition... I just figured out that trying to seek the video through the "bottom bar" also crashes the application with the same error.

@r1klz r1klz closed this as completed May 10, 2023
@akano12
Copy link
Collaborator

akano12 commented May 10, 2023

Device doesn't support picture-in-picture mode

Yes, I saw that. Tried to explain it on "Expected behavior" section; where I couldn't find the option to enable/disable this in the Settings.

In addition

Did you figure it out? All good now?

@r1klz
Copy link
Author

r1klz commented May 10, 2023

Did you figure it out? All good now?

Nope. It was a missclick, lmao. My bad closing the issue. 😔

@r1klz r1klz reopened this May 10, 2023
@r1klz
Copy link
Author

r1klz commented May 10, 2023

Screenshot_20230510-160903
That's strange. My phone shows that it have this option but I don't know if it really works (I never tried to use it).
And also, it is disabled in app settings. 🤷

@akano12
Copy link
Collaborator

akano12 commented May 10, 2023

Screenshot_20230510-160903
That's strange. My phone shows that it have this option but I don't know if it really works (I never tried to use it).
And also, it is disabled in app settings. 🤷

Enable it then try to reproduce

@r1klz
Copy link
Author

r1klz commented May 10, 2023

It was enabled before. Anyway, I tried to enable it again but without success.

@n1snt
Copy link

n1snt commented May 13, 2023

@r1klz are you still facing this issue?

@r1klz
Copy link
Author

r1klz commented May 14, 2023

Hi @n1snt! Unfortunatelly I am. Even in the lastest versions --- LibreTube Debug --- this "bug" still occurs... it must be my phone thing. 😕

@n1snt
Copy link

n1snt commented May 14, 2023

@r1klz have you enabled something like Screen Reader?
I have heard of people having PiP issues after enabling Screen Reader.
Enabling features in accessibility mode also causes PiP issues on Samsung devices.
(It's a bug with some Samsung devices)
If that's disabled how much ram is on your device?

@n1snt
Copy link

n1snt commented May 14, 2023

On the code side, we need to check if it's a Samsung device & accessibility service is enabled before calling enterPictureInPictureMode().
Source:
https://stackoverflow.com/questions/55288858/error-device-doesnt-support-picture-in-picture-mode-entering-pip-picture-in

OR

If the issue is low device ram then we would need to go according to this:
https://developer.android.com/develop/ui/views/picture-in-picture#best

I would create a PR for this as soon as I get some time.

@r1klz
Copy link
Author

r1klz commented May 14, 2023

Hey! I didn't see that you answered me so fast, ty.
I searched for "Screen Reader" but I didn't find it, it's in the accessibility settings, isn't it? Well, it looks like I don't use it because it's all disabled there.

About my device, yeah, it is a Samsung Galaxy J4 Core with 1GB of RAM! (my bad not saying it) and probably it is the really issue. And unfortunatelly I'm unable to buy another one yet.

But like I said before, in version 0.13.1, I didn't have this problem because there was an option in the app settings that I could disable PiP. It seems that they repaginated PiP mode in the next version (0.14.0) "reusing PictureInPictureCompat method", maybe was it (?)

Again, thank you @n1snt, you are awesome!

@n1snt
Copy link

n1snt commented May 15, 2023

No worries.
Let me have a look at the codebase.
I'll try to add some error handling to fix the issue.

@Bnyro
Copy link
Member

Bnyro commented May 18, 2023

@r1klz Please test it again with the latest debug builds! (see https://github.com/libre-tube/NightlyBuilds)

@r1klz
Copy link
Author

r1klz commented May 19, 2023

@r1klz Please test it again with the latest debug builds! (see https://github.com/libre-tube/NightlyBuilds)

Tested and working perfectly as it should be!!
Even some other issues I was having with the player, are gone!

Thank you for the amazing work you do in this lovely app and the love to solve this type of problems. When I have conditions, I will try to make a donation! 💗

@r1klz r1klz closed this as completed May 19, 2023
@Bnyro
Copy link
Member

Bnyro commented May 19, 2023

I'm happy it's working for you now!
The project doesn't take donations, however any kind of contribution (helping answering issues, testing pull requests, helping with community support and social media accounts) is very appreciated!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants