Request: when using VIDEO_SCALING_MODE_SCALE_TO_FIT_WITH_CROPPING, also offer a way to pan
Nobody has claimed this yet.
- Dominant language
- Java
- Stars
- 3k
- Forks
- 955
- Avg merge
- 12d 14h
- Merged PRs (30d)
- 2
Description
[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.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.