I'm learning to build tvOs Applications but unfortunately, my fullscreen player is not working. I'm building a simple app that launches a full-screen video when the user taps a button. But I'm getting this error.
Error
2021-09-29 01:27:20.962684+0530 CustomViewFun[4432:181636] [plugin]
AddInstanceForFactory: No factory registered for id <CFUUID 0x60000365d520> F8BB1C28-
BAE8-11D6-9C31-00039315CD46
2021-09-29 01:27:23.009069+0530 CustomViewFun[4432:181779] []
nw_protocol_get_quic_image_block_invoke dlopen libquic failed:
dlopen(/usr/lib/libquic.dylib, 0x0005): tried:
'/Users/username/Library/Developer/Xcode/DerivedData/CustomViewFun-
ajfybetvgzvjdrepropppgxffjvs/Build/Products/Debug-appletvsimulator/libquic.dylib' (no
such file), '
/Applications/Xcode.app/Contents/Developer/Platforms/AppleTVOS.platform/Library/Developer/CoreSimulator/Profiles/Runtimes/tvOS.simruntime/Contents/Resources/RuntimeRoot/usr/lib/system/introspection/libquic.dylib' (no such file), '/Applications/Xcode.app/Contents/Developer/Platforms/AppleTVOS.platform/Library/Developer/CoreSimulator/Profiles/Runtimes/tvOS.simruntime/Contents/Resources/RuntimeRoot/usr/lib/libquic.dylib' (no such file), '/usr/lib/libquic.dylib' (no such file)
2021-09-29 01:27:27.600430+0530 CustomViewFun[4432:181885] [aqme] MEMixerChannel.cpp:868 MEMixerChannel::EnableProcessor: failed to open processor type 0x705f6571
This is my code
import UIKit
import AVKit
import AVFoundation
class ViewController: UIViewController {
let avPlayerViewController = AVPlayerViewController()
var avPlayer : AVPlayer?
override func viewDidLoad() {
super.viewDidLoad()
// Do any additional setup after loading the view.
let movieURL:URL? = URL(string: "http://techslides.com/demos/sample-videos/small.mp4")
//Optional Binding
if let url = movieURL {
self.avPlayer = AVPlayer(url: url)
self.avPlayerViewController.player = avPlayer
}
}
@IBAction func playButtonTapped(_ sender: Any) {
//Press To play video
self.present(self.avPlayerViewController, animated: true) {
self.avPlayerViewController.player?.play()
}
}
}
I have tried to resolve it by myself by changing NSURL to URL because AVplayer requires URL instead of NSURL.