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

Request: when using VIDEO_SCALING_MODE_SCALE_TO_FIT_WITH_CROPPING, also offer a way to pan #1864

Open
AndroidDeveloperLB opened this issue Nov 7, 2024 · 0 comments

Comments

@AndroidDeveloperLB
Copy link

AndroidDeveloperLB commented Nov 7, 2024

[REQUIRED] Use case description

I wanted to add panning of video playback inside a live wallpaper, so that when the user scrolls horizontally/vertically (using onOffsetsChanged) in case the video doesn't fit perfectly in the resolution of the device, it will move so that you could see the rest of the video content.
This repository has just that, of playing video using ExoPlayer into a live wallpaper:

https://github.com/linlukes/VideoLiveWallpaper

Proposed solution

Maybe have a function "setPanningInPercentage(xPercentage:Double, yPercentage:Double)", where 0.5 is the center for both.
Can also be done in other units.
I think it might be nice to have Matrix being offered as well. If this is possible, please let me know how to use it in this scenario, of what should be the values being used.

Alternatives considered

I thought that maybe for this specific case, I could use setImageOutput of ExoPlayer, and each time I get a Bitmap, I could use the Canvas of the live wallpaper and move it accordingly, but I think this is too CPU intensive, making the playing not smooth at all.

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

No branches or pull requests

3 participants