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:
How to remove specific characters from select column in SnowflakeI have loaded data into table using copy into from stage file(CSV). +--------------------------------------------------------------------+--------+ | … Read More
Is there any way to observe all data attributes in a custom component?I'm trying to use vanilla javascript to build a custom component which observes changes in all data attributes, e.g.: class MyComponent extends HTMLEl… Read More
Generate PDFs in Laravel from Blade Views--- The Laravel PDF package by Spatie provides a simple way to create PDFs in Laravel Apps. It uses Blade views to render HTML and create a PDF fr… Read More
DataSnap - how to change SELECT query to show different data?In DataSnap, I have a server and client. In the client, I use this code to show data in a TDBGrid: ClientDataSet1.CommandText := 'SELECT * from table_… Read More
Advanced Laravel RepositoryHello friends, I wanted to introduce you to a package I recently wrote. This package is to facilitate and speed up the development of Laravel … Read More
0 comments:
Post a Comment
Thanks