I got the error on my visionOS app saying that my view doesn't conform to UIViewControllerRepresentable. I tried this code in another visionOS project and it works. Is there anything I can dp?
import SwiftUI
import AVKit
import UIKit
struct PlayerView: UIViewControllerRepresentable {
typealias UIViewControllerType = AVPlayerViewController
var url: String = "
https://devstreaming-cdn.apple.com/videos/streaming/examples/bipbop_adv_example_hevc/master.m3u8"
/>
func makeUIViewController(context: Context) -> AVPlayerViewController {
let controller = AVPlayerViewController()
// controller.navigationItem.hidesBackButton = true
// controller.showsPlaybackControls = false
controller.player = AVPlayer(url: URL(string: url)!)
controller.player?.playImmediately(atRate: 1.0)
return controller
}
func updateUIViewController(_ uiViewController: AVPlayerViewController, context: Context) {
}
class Coordinator: NSObject, AVPlayerViewControllerDelegate {
}
func makeCoordinator() -> Coordinator {
Coordinator()
}
}
a prompt answer.....
How do iI fix the error with UIViewControllerRepresentable?
Programing Coderfunda
July 02, 2024
No comments
Related Posts:
Moonshine is an Open-source Admin Panel for Laravelsubmitted by /u/High_Sleep3694 [link] [comments]… Read More
from xgboost import XGBClassifier & import xgboost as xgbI have already installed xgboost (using pip on anaconda),and import xgboost as xgb is fine.However when I am using from xgboost import XGBClassifier ,… Read More
How to fitler on text array column with supabase-jsI have a table i Supabase which looks like this: I want to use supabase-js client library to filter on phone_numbers (which is a text array). If I… Read More
Optimize Your Eloquent Queries with AI--- The Laravel Slower package is designed for Laravel developers who want to enhance the performance of their applications. This package identifi… Read More
Announcing WireUseI've created a package that I hope will be useful to others using Laravel and Livewire. It's still in early development, so I'd like to gather some fe… Read More
0 comments:
Post a Comment
Thanks