yattee/macOS/AppleAVPlayerView.swift

17 lines
395 B
Swift
Raw Normal View History

2022-02-27 20:31:17 +00:00
import Defaults
import SwiftUI
2022-08-18 22:40:46 +00:00
struct AppleAVPlayerView: NSViewRepresentable {
2022-02-27 20:31:17 +00:00
@EnvironmentObject<PlayerModel> private var player
2022-08-18 22:40:46 +00:00
func makeNSView(context _: Context) -> some NSView {
let playerLayerView = PlayerLayerView(frame: .zero)
2022-02-27 20:31:17 +00:00
2022-08-18 22:40:46 +00:00
playerLayerView.player = player
2022-02-27 20:31:17 +00:00
2022-08-18 22:40:46 +00:00
return playerLayerView
2022-02-27 20:31:17 +00:00
}
2022-08-18 22:40:46 +00:00
func updateNSView(_: NSViewType, context _: Context) {}
2022-02-27 20:31:17 +00:00
}