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:
Infrastructure management for several high-traffic PHP applicationssubmitted by /u/themsaid [link] [comments]… Read More
Can we implement tap and pay with NFC in apple without using Apple Pay?I want to implement tap and pay with an IOS device...But couldn't-find any good resources for doing this... There is plenty of resources for Android b… Read More
Convert Numbers to Words in Laravel with SpellNumberSpellNumber is a package to convert words in Laravel easily using the PHP INTL extension. The post Convert Numbers to Words in Laravel with SpellNu… Read More
dynamically open dropdown in vuehow do i open up a dynamically created dropdown using native vue and javascript? {{item}} under my methods i have tried these to no avail:… Read More
Bolt is a Laravel Form Builder for the TALL StackBolt is a Laravel form builder for your users, made with Filament and the TALL stack. It enables your users to create custom forms with many configura… Read More
0 comments:
Post a Comment
Thanks