mirror of
https://github.com/yattee/yattee.git
synced 2024-11-13 01:28:22 +00:00
26 lines
522 B
Swift
26 lines
522 B
Swift
import AVKit
|
|
import Foundation
|
|
import SwiftUI
|
|
|
|
struct PlayerView: View {
|
|
@ObservedObject private var provider: VideoDetailsProvider
|
|
|
|
init(id: String) {
|
|
provider = VideoDetailsProvider(id)
|
|
}
|
|
|
|
var body: some View {
|
|
ZStack {
|
|
if let video = provider.video {
|
|
PlayerViewController(video: video)
|
|
.edgesIgnoringSafeArea(.all)
|
|
}
|
|
}
|
|
.task {
|
|
async {
|
|
provider.load()
|
|
}
|
|
}
|
|
}
|
|
}
|