... following Apple's example. Going off of this tutorial:
https://developer.apple.com/documentation/avfoundation/media_playback_and_selection/creating_a_basic_video_player_macos
I have dragged into the storyboard the AVKit Player View, and here is my ViewController code:
here is what the console is outputting when I run this, any idea why this no longer works?
2020-11-01 20:28:31.491145-0800 Player01[13477:15207676] [plugin] AddInstanceForFactory: No factory registered for id <CFUUID 0x60000025c420> F8BB1C28-BAE8-11D6-9C31-00039315CD46
2020-11-01 20:28:31.494171-0800 Player01[13477:15207338] CDN - client insert callback function client = 0 type = 17 function = 0x7fff3a9f3246 localolny = false
2020-11-01 20:28:31.494205-0800 Player01[13477:15207338] CDN - client setupremoteport
2020-11-01 20:28:31.494227-0800 Player01[13477:15207338] CDN - Bootstrap Port: 1799
2020-11-01 20:28:31.494332-0800 Player01[13477:15207338] CDN - Remote Port: 36867 (com.apple.CoreDisplay.Notification)
2020-11-01 20:28:31.494366-0800 Player01[13477:15207338] CDN - client setuplocalport
2020-11-01 20:28:31.494385-0800 Player01[13477:15207338] CDN - Local Port: 28419
2020-11-01 20:28:31.524528-0800 Player01[13477:15207676] HALCShellDriverPlugIn::Open: Can't get a pointer to the Open routine
2020-11-01 20:28:31.539261-0800 Player01[13477:15207338] Metal API Validation Enabled
2020-11-01 20:28:31.692487-0800 Player01[13477:15207700] startConfigurationWithCompletionHandler: Failed to get remote object proxy: Error Domain=NSCocoaErrorDomain Code=4097 "connection to service on pid 0 named com.apple.rtcreportingd" UserInfo={NSDebugDescription=connection to service on pid 0 named com.apple.rtcreportingd}
2020-11-01 20:28:31.692614-0800 Player01[13477:15207700] startConfigurationWithCompletionHandler: Failed to get remote object proxy: Error Domain=NSCocoaErrorDomain Code=4097 "connection to service on pid 0 named com.apple.rtcreportingd" UserInfo={NSDebugDescription=connection to service on pid 0 named com.apple.rtcreportingd}
2020-11-01 20:28:31.712175-0800 Player01[13477:15207701] dnssdclientstub ConnectToServer: connect() failed path:/var/run/mDNSResponder Socket:11 Err:-1 Errno:1 Operation not permitted
2020-11-01 20:28:31.712371-0800 Player01[13477:15207701] [] nwresolvercreatednsservicelocked [C1] DNSServiceCreateDelegateConnection failed: ServiceNotRunning(-65563)
2020-11-01 20:28:31.712656-0800 Player01[13477:15207701] Connection 1: received failure notification
2020-11-01 20:28:31.716191-0800 Player01[13477:15207701] Connection 1: failed to connect 10:-72000, reason -1
2020-11-01 20:28:31.716310-0800 Player01[13477:15207701] Connection 1: encountered error(10:-72000)
2020-11-01 20:28:31.716980-0800 Player01[13477:15207700] Task <4869798A-2285-4453-8ED6-D7F3DA7E2758>.<1> HTTP load failed, 0/0 bytes (error code: -1003 [10:-72000])
2020-11-01 20:28:31.718743-0800 Player01[13477:15207718] Task <4869798A-2285-4453-8ED6-D7F3DA7E2758>.<1> finished with error [-1003] Error Domain=NSURLErrorDomain Code=-1003 "A server with the specified hostname could not be found." UserInfo={kCFStreamErrorCodeKey=-72000, NSUnderlyingError=0x600000cbf6f0 {Error Domain=kCFErrorDomainCFNetwork Code=-1003 "(null)" UserInfo={kCFStreamErrorCodeKey=-72000, kCFStreamErrorDomainKey=10}}, NSURLErrorFailingURLSessionTaskErrorKey=LocalDataTask <4869798A-2285-4453-8ED6-D7F3DA7E2758>.<1>, _NSURLErrorRelatedURLSessionTaskErrorKey=(
"LocalDataTask <4869798A-2285-4453-8ED6-D7F3DA7E2758>.<1>"
), NSLocalizedDescription=A server with the specified hostname could not be found., NSErrorFailingURLStringKey=https://devstreaming-cdn.apple.com/videos/streaming/examples/img_bipbop_adv_example_ts/master.m3u8, NSErrorFailingURLKey=https://devstreaming-cdn.apple.com/videos/streaming/examples/img_bipbop_adv_example_ts/master.m3u8, _kCFStreamErrorDomainKey=10}
2020-11-01 20:28:31.719376-0800 Player01[13477:15207676] sendMessageWithDictionary: Failed to get remote object proxy: Error Domain=NSCocoaErrorDomain Code=4097 "connection to service on pid 0 named com.apple.rtcreportingd" UserInfo={NSDebugDescription=connection to service on pid 0 named com.apple.rtcreportingd}
https://developer.apple.com/documentation/avfoundation/media_playback_and_selection/creating_a_basic_video_player_macos
I have dragged into the storyboard the AVKit Player View, and here is my ViewController code:
Code Block import Cocoa import AVKit import AVFoundation class ViewController: NSViewController { @IBOutlet weak var playerView: AVPlayerView! override func viewDidLoad() { super.viewDidLoad() guard let url = URL(string: "linkWasHere") else { return //could not post actual link due to this forum's security issues, see link above for actual link. ??? } let player = AVPlayer(url: url) playerView.player = player } }
here is what the console is outputting when I run this, any idea why this no longer works?
2020-11-01 20:28:31.491145-0800 Player01[13477:15207676] [plugin] AddInstanceForFactory: No factory registered for id <CFUUID 0x60000025c420> F8BB1C28-BAE8-11D6-9C31-00039315CD46
2020-11-01 20:28:31.494171-0800 Player01[13477:15207338] CDN - client insert callback function client = 0 type = 17 function = 0x7fff3a9f3246 localolny = false
2020-11-01 20:28:31.494205-0800 Player01[13477:15207338] CDN - client setupremoteport
2020-11-01 20:28:31.494227-0800 Player01[13477:15207338] CDN - Bootstrap Port: 1799
2020-11-01 20:28:31.494332-0800 Player01[13477:15207338] CDN - Remote Port: 36867 (com.apple.CoreDisplay.Notification)
2020-11-01 20:28:31.494366-0800 Player01[13477:15207338] CDN - client setuplocalport
2020-11-01 20:28:31.494385-0800 Player01[13477:15207338] CDN - Local Port: 28419
2020-11-01 20:28:31.524528-0800 Player01[13477:15207676] HALCShellDriverPlugIn::Open: Can't get a pointer to the Open routine
2020-11-01 20:28:31.539261-0800 Player01[13477:15207338] Metal API Validation Enabled
2020-11-01 20:28:31.692487-0800 Player01[13477:15207700] startConfigurationWithCompletionHandler: Failed to get remote object proxy: Error Domain=NSCocoaErrorDomain Code=4097 "connection to service on pid 0 named com.apple.rtcreportingd" UserInfo={NSDebugDescription=connection to service on pid 0 named com.apple.rtcreportingd}
2020-11-01 20:28:31.692614-0800 Player01[13477:15207700] startConfigurationWithCompletionHandler: Failed to get remote object proxy: Error Domain=NSCocoaErrorDomain Code=4097 "connection to service on pid 0 named com.apple.rtcreportingd" UserInfo={NSDebugDescription=connection to service on pid 0 named com.apple.rtcreportingd}
2020-11-01 20:28:31.712175-0800 Player01[13477:15207701] dnssdclientstub ConnectToServer: connect() failed path:/var/run/mDNSResponder Socket:11 Err:-1 Errno:1 Operation not permitted
2020-11-01 20:28:31.712371-0800 Player01[13477:15207701] [] nwresolvercreatednsservicelocked [C1] DNSServiceCreateDelegateConnection failed: ServiceNotRunning(-65563)
2020-11-01 20:28:31.712656-0800 Player01[13477:15207701] Connection 1: received failure notification
2020-11-01 20:28:31.716191-0800 Player01[13477:15207701] Connection 1: failed to connect 10:-72000, reason -1
2020-11-01 20:28:31.716310-0800 Player01[13477:15207701] Connection 1: encountered error(10:-72000)
2020-11-01 20:28:31.716980-0800 Player01[13477:15207700] Task <4869798A-2285-4453-8ED6-D7F3DA7E2758>.<1> HTTP load failed, 0/0 bytes (error code: -1003 [10:-72000])
2020-11-01 20:28:31.718743-0800 Player01[13477:15207718] Task <4869798A-2285-4453-8ED6-D7F3DA7E2758>.<1> finished with error [-1003] Error Domain=NSURLErrorDomain Code=-1003 "A server with the specified hostname could not be found." UserInfo={kCFStreamErrorCodeKey=-72000, NSUnderlyingError=0x600000cbf6f0 {Error Domain=kCFErrorDomainCFNetwork Code=-1003 "(null)" UserInfo={kCFStreamErrorCodeKey=-72000, kCFStreamErrorDomainKey=10}}, NSURLErrorFailingURLSessionTaskErrorKey=LocalDataTask <4869798A-2285-4453-8ED6-D7F3DA7E2758>.<1>, _NSURLErrorRelatedURLSessionTaskErrorKey=(
"LocalDataTask <4869798A-2285-4453-8ED6-D7F3DA7E2758>.<1>"
), NSLocalizedDescription=A server with the specified hostname could not be found., NSErrorFailingURLStringKey=https://devstreaming-cdn.apple.com/videos/streaming/examples/img_bipbop_adv_example_ts/master.m3u8, NSErrorFailingURLKey=https://devstreaming-cdn.apple.com/videos/streaming/examples/img_bipbop_adv_example_ts/master.m3u8, _kCFStreamErrorDomainKey=10}
2020-11-01 20:28:31.719376-0800 Player01[13477:15207676] sendMessageWithDictionary: Failed to get remote object proxy: Error Domain=NSCocoaErrorDomain Code=4097 "connection to service on pid 0 named com.apple.rtcreportingd" UserInfo={NSDebugDescription=connection to service on pid 0 named com.apple.rtcreportingd}