diff --git a/Sources/SwiftBricks/Controls/VideoPlayerControl.swift b/Sources/SwiftBricks/Controls/VideoPlayerControl.swift index 9552b27..33b1bc9 100644 --- a/Sources/SwiftBricks/Controls/VideoPlayerControl.swift +++ b/Sources/SwiftBricks/Controls/VideoPlayerControl.swift @@ -50,17 +50,19 @@ struct VideoPlayerControl: View { #if os(macOS) private var macOSPlayerView: some View { - VideoPlayerView(player: player) + let style: AVPlayerViewControlsStyle = schema.options.controls == false ? .none : .default + return VideoPlayerView(player: player, controlsStyle: style) .frame(maxWidth: .infinity, maxHeight: .infinity) } private struct VideoPlayerView: NSViewRepresentable { let player: AVPlayer? + let controlsStyle: AVPlayerViewControlsStyle func makeNSView(context: Context) -> NSView { let view = AVPlayerView() view.player = player - view.controlsStyle = schema.options.controls == false ? .none : .default + view.controlsStyle = controlsStyle return view }