androidx / androidx/media

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

Open
#1,864 0 comments 0 reactions 1 assignee View on GitHub

Nobody has claimed this yet.

enhancement needs triage
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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.