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

Video is interrupted on orientation change #5754

Closed
3 tasks done
imwints opened this issue Mar 17, 2024 · 7 comments
Closed
3 tasks done

Video is interrupted on orientation change #5754

imwints opened this issue Mar 17, 2024 · 7 comments
Labels
bug Something isn't working

Comments

@imwints
Copy link
Contributor

imwints commented Mar 17, 2024

Steps to reproduce

  • Enable auto-rotate in app and for device
  • Start video
  • Rotate device

Expected behavior

Video should play seamlessly

Actual behavior

Video is interrupted quickly

LibreTube version

Nightly

Android version

14

Other details

This is a followup of #5727. I observed this before the fixing commit as well, so this shouldn't be a regression.

I'm sadly not at home and don't have a machine with Android Studio at hand, otherwise I would debug this properly. A quick search on the internet spits out this reddit post but the manifest declares the orientation config. So my guess it that it's an issue in this app and how it handles orientation changes.

Maybe you know if this is fixable at all?

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.
@imwints imwints added the bug Something isn't working label Mar 17, 2024
@Bnyro
Copy link
Member

Bnyro commented Mar 17, 2024

Duplicate of #5538.

Unfortunately, there's no better way to achieve this. I've already tried to make the transition as seamless as possible in #5635, but that's the best we can get.

When rotating the phone, we need to use a different player layout - hence we must recreate the current layout to load the landscape version when you started in portrait mode and vice versa.

That just takes some time - as things must get rendered first.

@Bnyro Bnyro closed this as not planned Won't fix, can't repro, duplicate, stale Mar 17, 2024
@imwints
Copy link
Contributor Author

imwints commented Mar 17, 2024

Loading into fullscreen from portrait mode doesn't have this issue. Do you think it would work if the landscape mode would be disabled for small screens and rotating would launch fullscreen mode? I find landscape mode useless on my phone anyway.

@Bnyro
Copy link
Member

Bnyro commented Mar 17, 2024

Loading into fullscreen from portrait mode doesn't have this issue. Do you think it would work if the landscape mode would be disabled for small screens and rotating would launch fullscreen mode? I find landscape mode useless on my phone anyway.

That's already possible:

Settings -> General -> Disable auto rotation

Settings -> Player -> Enable Auto fullscreen

@imwints
Copy link
Contributor Author

imwints commented Mar 17, 2024

Ah alright, I was thinking that this would launch every new Video in fullscreen

@Pittvandewitt
Copy link
Contributor

Duplicate of #5538.

Unfortunately, there's no better way to achieve this. I've already tried to make the transition as seamless as possible in #5635, but that's the best we can get.

When rotating the phone, we need to use a different player layout - hence we must recreate the current layout to load the landscape version when you started in portrait mode and vice versa.

That just takes some time - as things must get rendered first.

Buffering again doesn't happen if the exoplayer object is persisted upon orientation change, which is not the case yet. Moving it to the ViewModel and managing the object from there should fix it I think.

@Bnyro
Copy link
Member

Bnyro commented Jul 12, 2024

exoplayer object is persisted upon orientation change, which is not the case yet.

That's false, it's already the case. Feel free to make a PR if you think you can improve things though.

@Pittvandewitt
Copy link
Contributor

That's false, it's already the case. Feel free to make a PR if you think you can improve things though.

Here's what I mean.
By not using the exoplayer in fragment, but in the viewmodel, the media will keep playing without interrupts on orientation change. It's a quick draft and I have tested nothing but the orientation change in PlayerFragment.

Shared_exoplayer.patch

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

No branches or pull requests

3 participants