fix(trailer): resolve iOS popup dimensions and polyfill native playback controls#1278
Open
luqmanfadlli wants to merge 7 commits into
Open
fix(trailer): resolve iOS popup dimensions and polyfill native playback controls#1278luqmanfadlli wants to merge 7 commits into
luqmanfadlli wants to merge 7 commits into
Conversation
The previous popup layout only applied fillMaxWidth() to PlatformPlayerSurface, which could leave the underlying native UIView with zero-height bounds on iOS. As a result, the MPV bridge queued the trailer load but never issued the loadfile command because the player view was not ready. This changes ensure the trailer popup player surface fills its 16:9 container on iOS and Android.
MPV lacks a built-in native playback controller on iOS. Previously, passing `useNativeController = true` like being used in `TrailerPlayerPopup.kt` resulted in a bare video surface with no user interaction. This commit injects a custom Compose touch overlay (play/pause control) directly into `PlayerEngine.ios.kt` when native controls are requested. By isolating this polyfill to the iOS source set, we prevent touch event interception issues on Android, ensuring ExoPlayer's robust native UI remains fully functional and unobstructed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
The in-app trailer popup was suffering from two major issues on iOS:
UIKitViewControllerrequires strict bounding boxes from Compose to render correctly. By usingModifier.fillMaxWidth()insideTrailerPlayerPopup.kt, the player surface failed to properly inherit the height from its 16:9 parent Box, causing rendering anomalies.useNativeController = trueleft the iOS player completely unresponsive to touch inputs, trapping the user in an un-pausable video playback.PR type
Why
The changes in
TrailerPlayerPopup.ktis needed to make the trailer popup usable on iOS. Without it, the player surface collapses visually. As for changes inPlayerEngine.ios.ktneeded to the user a button to pause/un-pause playback because MPV does not ship with built-in native playback controls like Android's ExoPlayer.Issue or approval
Fixes #1277
UI / behavior impact
Policy check
CONTRIBUTING.md.Scope boundaries
Intentionally did not modify the shared
PlatformPlayerSurfacesignature or add new properties. The UI polyfill is strictly scoped to the iOS source set (PlayerEngine.ios.kt) to guarantee zero impact on Android, ensuring ExoPlayer's robust native UI remains completely unobstructed.Testing
Tested trailer popup playback on iPhone, iPad, and Android.
Before this change:
After this change:
Screenshots / Video
Not a UI change
Breaking changes
None
Linked issues
Fixes #1277