2017-08-28 110 views
1

我使用WebRtc創建點對點連接以共享視頻和音頻。我想使用replaykit錄製Screen & Microphone.if我開始錄製後,對等連接已建立,這意味着兩個可以共享來自對方的視頻和音頻。在這種情況下,repalykit無法錄製屏幕&麥克風和previewController是黑色如果我在連接建立之前開始記錄replaykit的工作很好。如果我只選擇記錄屏幕或不加RTCAudioTrack,它一直工作。
那麼如何通過webrtc使用replaykit?
你可以開始通話一開始apprtc-ios使用webrtc時,ReplayKit不起作用

回答

0

測試,設備揚聲器,麥克風和攝像頭流添加到對等連接,它將不適用於在應用其它輸出。繼iOS的11

/*! @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)); 

此API用於捕捉揚聲器,麥克風和視頻樣本緩衝區引入了新的API,你可以能夠將它們寫入使用AVAssetWriter從AVFoundation的文件。

相關問題