0

I have AVKit implemented, the url I am calling the video from is from my website to uses https. When I run the app through Xcode everything works fine, but when I archive the app for release it will not show the Video. I have NSAppTransportSecurity, NSExceptionDomains, and NSIncludesSubdomains implemented. This is error I am getting,

startConfigurationWithCompletionHandler: Failed to get remote object proxy: Error Domain=NSCocoaErrorDomain Code=4097 "connection to service named com.apple.rtcreportingd" UserInfo={NSDebugDescription=connection to service named com.apple.rtcreportingd}.

I am running Xcode 10.2 Swift 5 I had The url's in a Constants file force unwrapped, I have since placed them in my makeView using a guard statement. I have a Custom Cell with the video player inside the cell.

I have search high and low, Apple says to implement the plist code and configure as such and I have.

I tried to use a different url, so I used Apples AVKit Example with the same results.

Everything I have read says the plist needs the AppTransportSecurity code which I have already implemented and still am not able to connect to the video when the app is archived and ready for release.

//plist sourceCode

<key>NSAppTransportSecurity</key>
<dict>
    <key>NSExceptionDomains</key>
    <dict>
        <key>example.com</key>
        <dict>
            <key>NSIncludesSubdomains</key>
            <true/>
            <key>NSThirdPartyExceptionAllowsInsecureHTTPLoads</key>
            <false/>
        </dict>
    </dict>
</dict>

//TableViewDataSource

func tableView(_ tableView: NSTableView, viewFor tableColumn:    NSTableColumn?, row: Int) -> NSView? {

     guard let videoOne = URL(string: "https://example.com/video.mov") else {return nil}

    let cell = tableView.makeView(withIdentifier: NSUserInterfaceItemIdentifier(rawValue: "videoCell"), owner: nil) as? VideoCell
    switch row {
    case 0:

        cell?.titleLabel.stringValue = "title 1"
        cell?.playerView.player = AVPlayer(url: videoOne)
        return cell
   default:
      break

When app has been archived for distribution the video should play.

Bhavesh Nayi
  • 705
  • 4
  • 15
Cartisim
  • 116
  • 10
  • Hi @Cartisim, In Info.plist, doesn't see "Allow Arbitrary Loads" under App transport Security... – Ahtazaz May 03 '19 at 05:45
  • Is that needed even with https calls? @Mr.Ahtazaz – Cartisim May 03 '19 at 14:00
  • Yes yes. Whenever you want to interact with HTTP calls, you must have to include this... – Ahtazaz May 03 '19 at 15:49
  • Ok thanks, I added yes to high arbitrary loads and arbitrary loads in web content and it still doesn’t work. Also it throws the same error. @Mr.Ahtazaz – Cartisim May 03 '19 at 21:39
  • Still not worked? – Ahtazaz May 04 '19 at 04:10
  • Still doesn’t work @Mr.Ahtazaz – Cartisim May 04 '19 at 04:12
  • It works fine without doing ARCHIVED? And when you try to ARCHIVED for distribution then it causes the issue. I'm I right? – Ahtazaz May 04 '19 at 04:14
  • It will definitely work and will solve your problem https://stackoverflow.com/questions/44785787/how-to-embed-and-stream-a-video-from-the-web-within-an-xcode-macos-cocoa-applica – Ahtazaz May 04 '19 at 04:40
  • That use case is a little different. I have my AVPlayer in a custom tableview Cell. Does this make a difference? @Mr.Ahtazaz – Cartisim May 04 '19 at 14:55
  • No, same use case. If you still didn't solve your problem. Create a sample project of your PROBLEM and send it to me. I will solve your problem. Thanks – Ahtazaz May 04 '19 at 16:02
  • @Mr.Ahtazaz Thank you I really appreciate it. https://github.com/Cartisim/AVTest – Cartisim May 05 '19 at 02:39

0 Answers0