測試,設備揚聲器,麥克風和攝像頭流添加到對等連接,它將不適用於在應用其它輸出。繼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的文件。