From 911b03d877d8f3f72f43bae3514477f82f26b3bd Mon Sep 17 00:00:00 2001 From: Arkadiusz Fal Date: Sun, 3 Apr 2022 15:26:33 +0200 Subject: [PATCH] Try to patch #78 Issue appears when app switches layout from tab to sidebar navigation --- Shared/Player/VideoPlayerView.swift | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/Shared/Player/VideoPlayerView.swift b/Shared/Player/VideoPlayerView.swift index 64913846..81207764 100644 --- a/Shared/Player/VideoPlayerView.swift +++ b/Shared/Player/VideoPlayerView.swift @@ -227,6 +227,19 @@ struct VideoPlayerView: View { PlayerControls(player: player) } + #if os(iOS) + .onAppear { + // ugly patch for #78 + guard player.activeBackend == .mpv else { + return + } + + player.activeBackend = .appleAVPlayer + DispatchQueue.main.asyncAfter(deadline: .now() + 0.1) { + player.activeBackend = .mpv + } + } + #endif } var fullScreenLayout: Bool {