Hi, how can I solve this errors ? :
Cannot find type 'Video' in scope.
Cannot find '$selectedVideo' in scope.
Cannot find 'ErrorView' in scope.
import SwiftUI
import AVKit
struct ContentView: View {
@State private var selectedVideo: Video? // the error is here
var selectedVideo = video // the same error
var body:some View {
NavigationView {
.fullScreenCover(item: $selectedVideo) { // error
// On Dismiss Closure
} content: { item in
makeFullScreenVideoPlayer(for: item)
}
@ViewBuilder
func makeFullScreenVideoPlayer(for video: Video) -> some View {
// 1
if let url = video.videoURL {
// 2
let avPlayer = AVPlayer(url: url)
// 3
VideoPlayer(player: avPlayer)
// 4
.edgesIgnoringSafeArea(.all)
.onAppear {
// 5
avPlayer.play()
}
} else {
ErrorView() // error
}
}
```