Playback controls in swiftui
17:27 27 Jan 2021

Attempting to use AVKit's AVPlayer to play a video without playback controls:

private let player = AVPlayer(url: URL(fileURLWithPath: Bundle.main.path(forResource: "videoToPlay", ofType: "mp4")!))
player.showsPlaybackControls = false

The above results in an error message that declarations must be separated by ';'. I've also tried:

VideoPlayer(player: player)
    .onAppear {
        player.showsPlaybackControls = false
    }

Which results in a different error.

Any advice on hiding playback controls with swiftui?

ios swift swiftui