Resume MPV rendering when expanded player view re-appears

On iPad, expanding the player after collapsing left the MPV display link
paused, showing only a static frame. MiniPlayerView pauses rendering when
its video preview hides during expand, and PlayerService.playerSheetDidAppear
is gated behind background playback so it can't reliably resume.

Call resumeRendering() from MPVVideoView.onAppear so the expanded view
always restarts the display link.
This commit is contained in:
Arkadiusz Fal
2026-05-10 17:23:56 +02:00
parent c71332f69f
commit 92d0b3215b

View File

@@ -143,6 +143,13 @@ struct MPVVideoView: View {
applies: appliesAspectRatio
))
.onAppear {
#if os(iOS)
// Resume the MPV display link when the expanded video view appears.
// MiniPlayerView pauses rendering when its video preview hides during expand;
// PlayerService.playerSheetDidAppear is gated behind background playback, so it
// can't be relied on to resume.
backend.resumeRendering()
#endif
// Start debug updates if overlay is already visible when view appears
if playerState.showDebugOverlay {
startDebugUpdates()