If you need a similar solution that will not globally change the behavior, you can use the SwiftUIIntrospect library.
import SwiftUIIntrospect
struct SomeVideoPlayer: View {
/// ...
var body: some View {
VideoPlayer(player: player)
.introspect(.videoPlayer, on: .iOS(.v18)) { vc in
vc.showsPlaybackControls = false
vc.allowsPictureInPicturePlayback = false
vc.allowsVideoFrameAnalysis = false
}
}
}
Topic:
UI Frameworks
SubTopic:
SwiftUI
Tags: