我使用WebRtc创建一个点对点连接来共享视频和音频。我想使用replaykit录制屏幕和Microphone.if我开始录制后,对等连接已经建立,这意味着两个可以共享视频和音频从每个other.in在这种情况下,repalykit无法录制屏幕和麦克风和previewController是black.if我开始录制之前已建立连接replaykit作品well.if我选择只记录屏幕或不添加RTCAudioTrack,它一直在工作。
那么如何在webrtc中使用replaykit呢?
您可以开始使用apprtc-ios进行测试
发布于 2017-08-29 16:03:50
一旦呼叫开始,设备扬声器、麦克风和摄像头流就会添加到对等连接中,并且不能用于应用程序中的其他输出。遵循iOS 11中引入的新API。
/*! @abstract Starts screen and audio capture and continually calls the
supplied handler with the current sampleBuffer and bufferType and passed it
back to the application. Note that before recording actually starts, the
user may be prompted with UI to confirm recording.
@result handler Called continually with sampleBuffers and the bufferType.
Will be passed an optional NSError in the RPRecordingErrorDomain domain if
there was an issue starting the capture.
*/
- (void)startCaptureWithHandler:(nullable void(^)(CMSampleBufferRef
sampleBuffer, RPSampleBufferType bufferType, NSError * _Nullable
error))captureHandler completionHandler:(nullable void(^)(NSError *
_Nullable error))completionHandler API_AVAILABLE(ios(11.0), tvos(11.0));此接口用于捕获扬声器、麦克风和视频样本缓冲区,您可以使用AVFoundation中的AVAssetWriter将其写入文件。
https://stackoverflow.com/questions/45919346
复制相似问题