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

Migrate to media3 and Immersive mode for video playback #11936

Merged
merged 21 commits into from
Dec 29, 2023

Conversation

parneet-guraya
Copy link
Contributor

Closes: #11829

What this PR includes?

  • Changes from migration script (for migrating from exoplayer2 to media3).
  • Remove the old way to watch video full screen with creating a new dialog (which is breaking in new media3 API)
  • New functionality to go full screen(immersive mode) when playing video.
  • Tests written, or not not needed

Before

Before.mp4

After

After.mp4

@parneet-guraya
Copy link
Contributor Author

parneet-guraya commented Sep 2, 2023

Hi,
Please let me know how the Immersive Mode is doing and If it needs some improvement (transition wise), I sure can look into it and maybe take inspiration from Google Drive, Whatsapp etc. (Since it wasn't the scope of the PR, I didn't do it here)

Let me know what do you think and if it needs some polishing.

Thanks!

@parneet-guraya parneet-guraya changed the title Migrate to media3 Migrate to media3 and Immersive mode for video playback Sep 3, 2023
@parneet-guraya parneet-guraya force-pushed the migrate-to-media3 branch 2 times, most recently from 8b964b1 to de32b9c Compare September 4, 2023 10:47
@ZetaTom
Copy link
Collaborator

ZetaTom commented Sep 5, 2023

Works as expected on my end.

One minor observation: when in light mode and playing a video file, the background and action bar remain white, which looks a bit odd. I'm not sure how, or even if, this was handled before...

@parneet-guraya
Copy link
Contributor Author

parneet-guraya commented Sep 5, 2023

@ZetaTom Yes, the white background does not look nice.So, I think I will change the background color to black (for video only) so it shows black background instead of white.

However the action bar has the same white color as it is in the current nextcloud app, so you are correct it's not handled.

We can render the Preview Media(for both audio and video) Fragment as it gets rendered in dark mode? If yes, let me know I can try that and create a new PR (not adding here since that will populate the PR with too much different changes which should be standalone)

This is how Google Drive's media playback UI looks like (in light mode)

Record_2023-09-05-22-52-13.mp4

For both video and audio playbacks it has default dark UI (for both light and dark mode)

@parneet-guraya
Copy link
Contributor Author

This is how it looks with background black (only done for videos)

Record_2023-09-06-01-06-17.mp4

@AndyScherzinger
Copy link
Member

@parneet-guraya thanks a lot for working on this migration. Can you please address the newly introduced lint errors? See https://www.kaminsky.me/nc-dev/android-lint/5531.html

Thanks in advance, highly appreciate your contributions 🤩

@parneet-guraya
Copy link
Contributor Author

parneet-guraya commented Sep 5, 2023

Hi, @AndyScherzinger, I'm happy to contribute 😄
You can see here about the lint errors.

If you don't require strict binary compatibility, these errors can be safely suppressed with an @OptIn annotation.

I'm not really sure about what binary compatibility they are referring to tell me if that is something concerning otherwise we can use the annotation as mentioned, although I did use the annotation I think I didn't do properly in a file that's why lint error, I fixed it and pushing again to see if the lint error goes.

@parneet-guraya
Copy link
Contributor Author

parneet-guraya commented Sep 17, 2023

Found out the status bar color is not applied when handling display cutout in the FileDisplayActivity. Handling for display cutout is only applied in activities but we're have media playback inside a fragment.So, that's the reason for handling display cutout in the launching activity but then status bar color does not apply. Looking into it, so marking it as draft and removing review requests.

Signed-off-by: parneet-guraya <[email protected]>
which used to  make the user open drawer
from the left
(drawer is no longer available from the fragment so it's unusable).

Signed-off-by: parneet-guraya <[email protected]>
Signed-off-by: parneet-guraya <[email protected]>
Signed-off-by: parneet-guraya <[email protected]>
Signed-off-by: parneet-guraya <[email protected]>
Signed-off-by: parneet-guraya <[email protected]>
Signed-off-by: parneet-guraya <[email protected]>
Signed-off-by: parneet-guraya <[email protected]>
Signed-off-by: parneet-guraya <[email protected]>
Signed-off-by: parneet-guraya <[email protected]>
@parneet-guraya
Copy link
Contributor Author

@alperozturk96 Done 👍

Signed-off-by: parneet-guraya <[email protected]>
Signed-off-by: alperozturk <[email protected]>
Copy link

Codacy

Lint

TypemasterPR
Warnings6969
Errors33

SpotBugs

CategoryBaseNew
Bad practice2626
Correctness6969
Dodgy code353353
Experimental22
Internationalization99
Malicious code vulnerability22
Multithreaded correctness99
Performance5454
Security1818
Total542542

Copy link

APK file: https://www.kaminsky.me/nc-dev/android-artifacts/11936.apk

qrcode

To test this change/fix you can simply download above APK file and install and test it in parallel to your existing Nextcloud app.

Copy link
Collaborator

@JonasMayerDev JonasMayerDev left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Works as expected for me :)

@alperozturk96 alperozturk96 merged commit 76369d4 into master Dec 29, 2023
20 checks passed
@delete-merged-branch delete-merged-branch bot deleted the migrate-to-media3 branch December 29, 2023 08:01
Copy link

github-actions bot commented Apr 3, 2024

Hello there,
Thank you so much for taking the time and effort to create a pull request to our Nextcloud project.

We hope that the review process is going smooth and is helpful for you. We want to ensure your pull request is reviewed to your satisfaction. If you have a moment, our community management team would very much appreciate your feedback on your experience with this PR review process.

Your feedback is valuable to us as we continuously strive to improve our community developer experience. Please take a moment to complete our short survey by clicking on the following link: https://cloud.nextcloud.com/apps/forms/s/i9Ago4EQRZ7TWxjfmeEpPkf6

Thank you for contributing to Nextcloud and we hope to hear from you soon!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Question: About handling media view. Migrate exoplayer to AndroidX Media3
5 participants