8

我有一个非常简单的 MacOS 应用程序,我试图在 MacOS 上使用 AVPlayerView/AVPlayer 从远程 url 播放一个小的 mp4。

我经常收到有关连接到服务 com.apple.rtcreportingd 的错误。这是我收到的错误的完整日志:

2019-05-19 12:06:47.286932-0700 MyApp[5849:39995] 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}
2019-05-19 12:06:47.287081-0700 MyApp[5849:39995] 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}
2019-05-19 12:06:47.392044-0700 MyApp[5849:40033] [BoringSSL] nw_protocol_boringssl_get_output_frames(1301) [C2.1:2][0x10141c0a0] get output frames failed, state 8196
2019-05-19 12:06:47.392105-0700 MyApp[5849:40033] [BoringSSL] nw_protocol_boringssl_get_output_frames(1301) [C2.1:2][0x10141c0a0] get output frames failed, state 8196
2019-05-19 12:06:47.392269-0700 MyApp[5849:40033] TIC Read Status [2:0x0]: 1:57
2019-05-19 12:06:47.392285-0700 MyApp[5849:40033] TIC Read Status [2:0x0]: 1:57
2019-05-19 12:06:47.622099-0700 MyApp[5849:39997] sendMessageWithDictionary: 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}
2019-05-19 12:06:47.639382-0700 MyApp[5849:39997] sendMessageWithDictionary: 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}
2019-05-19 12:06:48.123992-0700 MyApp[5849:40031] sendMessageWithDictionary: 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}
2019-05-19 12:06:48.129544-0700 MyApp[5849:40029] sendMessageWithDictionary: 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}

播放似乎工作正常,但我仍然想知道如何让它停止。它隐藏了我正在打印的任何其他调试消息。

设置 AVPlayer 的代码非常简单。我有一个 NSCollectionViewItem,里面有一个 AVPlayerView。然后,我.player使用以下方式在视图上设置属性:

if let previewUrl = URL(string: "https://url-to-an-mp4") {
    playerView?.player = AVPlayer(url: previewUrl)
}

我广泛搜索,那里没有太多关于 rtcreportingd 的信息。

4

1 回答 1

2

在 Xcode 中,打开:产品>方案>编辑方案

环境变量下设置OS_ACTIVITY_MODEdisable

于 2021-11-15T09:09:00.290 回答