Version
Media3 main branch
More version details
No response
Devices that reproduce the issue
Mi 11x Android 12
Devices that do not reproduce the issue
No response
Reproducible in the demo app?
Yes
Reproduction steps
-
Set up an ExoPlayer instance with videoScalingMode = VIDEO_SCALING_MODE_SCALE_TO_FIT_WITH_CROPPING.
-
Set repeatMode = Player.REPEAT_MODE_ONE so the video loops.
-
Assign the player to a PlayerView with resizeMode = RESIZE_MODE_FILL.
-
Provide a standard MP4 video that is vertical (e.g., 9:16), but does not match the device’s screen aspect ratio.
-
Observe playback:
-
On the first loop, the video appears stretched or not cropped correctly.
-
On the second loop and onwards, the video suddenly displays properly (cropped as expected).
Note: My player supports both HLS and MP4, but this issue is being seen specifically with an MP4 file.
Expected result
The video should be cropped correctly (zoomed and centered) to fill the PlayerView from the very first loop, honoring both VIDEO_SCALING_MODE_SCALE_TO_FIT_WITH_CROPPING and RESIZE_MODE_FILL.
There should be no difference in video display between the first loop and subsequent loops.
Actual result
On the first loop, the video appears stretched, misaligned, or not cropped properly — as if the scaling or aspect ratio hasn’t been applied yet.
From the second loop onwards, the video suddenly displays correctly, cropped and zoomed as expected.
Example setup:
Inside a Jetpack Compose app, create an ExoPlayer instance using:
exoPlayer.videoScalingMode = C.VIDEO_SCALING_MODE_SCALE_TO_FIT_WITH_CROPPING
Set repeat mode:
exoPlayer.repeatMode = Player.REPEAT_MODE_ONE
Assign the player to a PlayerView inside an AndroidView, and set:
playerView.resizeMode = AspectRatioFrameLayout.RESIZE_MODE_FILL
Use an .mp4 source video that is vertical (e.g., 9:16), but does not match the device’s screen aspect ratio, such as 9:20.
Media
Not applicable
Bug Report
Version
Media3 main branch
More version details
No response
Devices that reproduce the issue
Mi 11x Android 12
Devices that do not reproduce the issue
No response
Reproducible in the demo app?
Yes
Reproduction steps
Set up an ExoPlayer instance with videoScalingMode = VIDEO_SCALING_MODE_SCALE_TO_FIT_WITH_CROPPING.
Set repeatMode = Player.REPEAT_MODE_ONE so the video loops.
Assign the player to a PlayerView with resizeMode = RESIZE_MODE_FILL.
Provide a standard MP4 video that is vertical (e.g., 9:16), but does not match the device’s screen aspect ratio.
Observe playback:
On the first loop, the video appears stretched or not cropped correctly.
On the second loop and onwards, the video suddenly displays properly (cropped as expected).
Note: My player supports both HLS and MP4, but this issue is being seen specifically with an MP4 file.
Expected result
The video should be cropped correctly (zoomed and centered) to fill the PlayerView from the very first loop, honoring both VIDEO_SCALING_MODE_SCALE_TO_FIT_WITH_CROPPING and RESIZE_MODE_FILL.
There should be no difference in video display between the first loop and subsequent loops.
Actual result
On the first loop, the video appears stretched, misaligned, or not cropped properly — as if the scaling or aspect ratio hasn’t been applied yet.
From the second loop onwards, the video suddenly displays correctly, cropped and zoomed as expected.
Example setup:
Inside a Jetpack Compose app, create an ExoPlayer instance using:
exoPlayer.videoScalingMode = C.VIDEO_SCALING_MODE_SCALE_TO_FIT_WITH_CROPPING
Set repeat mode:
exoPlayer.repeatMode = Player.REPEAT_MODE_ONE
Assign the player to a PlayerView inside an AndroidView, and set:
playerView.resizeMode = AspectRatioFrameLayout.RESIZE_MODE_FILL
Use an .mp4 source video that is vertical (e.g., 9:16), but does not match the device’s screen aspect ratio, such as 9:20.
Media
Not applicable
Bug Report
adb bugreportto android-media-github@google.com after filing this issue.