diff --git a/Library/Sources/SCAssetExportSession.h b/Library/Sources/SCAssetExportSession.h index 432b82c8..fd9e313c 100644 --- a/Library/Sources/SCAssetExportSession.h +++ b/Library/Sources/SCAssetExportSession.h @@ -108,4 +108,7 @@ */ - (void)exportAsynchronouslyWithCompletionHandler:(void(^__nullable)(void))completionHandler; +- (void)exportAsynchronouslyWithCompletionHandler:(void(^__nullable)(void))completionHandler + metadata:(NSArray *__nonnull)metadata; + @end diff --git a/Library/Sources/SCAssetExportSession.m b/Library/Sources/SCAssetExportSession.m index 014c6cbb..719a0d43 100644 --- a/Library/Sources/SCAssetExportSession.m +++ b/Library/Sources/SCAssetExportSession.m @@ -658,6 +658,12 @@ - (void)_setupVideoUsingTracks:(NSArray *)videoTracks { } - (void)exportAsynchronouslyWithCompletionHandler:(void (^)(void))completionHandler { + [self exportAsynchronouslyWithCompletionHandler:completionHandler + metadata:[SCRecorderTools assetWriterMetadata]]; +} + +- (void)exportAsynchronouslyWithCompletionHandler:(void (^)(void))completionHandler + metadata:(NSArray *)metadata { _cancelled = NO; _nextAllowedVideoFrame = kCMTimeZero; NSError *error = nil; @@ -666,7 +672,7 @@ - (void)exportAsynchronouslyWithCompletionHandler:(void (^)(void))completionHand _writer = [AVAssetWriter assetWriterWithURL:self.outputUrl fileType:self.outputFileType error:&error]; _writer.shouldOptimizeForNetworkUse = _shouldOptimizeForNetworkUse; - _writer.metadata = [SCRecorderTools assetWriterMetadata]; + _writer.metadata = metadata; EnsureSuccess(error, completionHandler);