From 7ffb8d3f784a1f45cab5babf517ca5ed5a7c2a25 Mon Sep 17 00:00:00 2001 From: yumoqing Date: Sat, 4 Jul 2026 17:39:08 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20VideoPlayerView=20nested=20type=20access?= =?UTF-8?q?ing=20enclosing=20schema=20=E2=80=94=20pass=20controlsStyle=20a?= =?UTF-8?q?s=20param?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Sources/SwiftBricks/Controls/VideoPlayerControl.swift | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) 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 }