1
0
mirror of https://github.com/yattee/yattee.git synced 2024-12-15 06:40:32 +05:30
yattee/Apple TV/PlayerView.swift

26 lines
522 B
Swift
Raw Normal View History

2021-06-11 04:20:10 +05:30
import AVKit
import Foundation
import SwiftUI
struct PlayerView: View {
2021-06-11 05:35:59 +05:30
@ObservedObject private var provider: VideoDetailsProvider
init(id: String) {
provider = VideoDetailsProvider(id)
}
2021-06-11 04:20:10 +05:30
var body: some View {
ZStack {
if let video = provider.video {
2021-06-14 23:35:02 +05:30
PlayerViewController(video: video)
.edgesIgnoringSafeArea(.all)
2021-06-11 04:20:10 +05:30
}
}
.task {
async {
provider.load()
}
}
}
}