Skip to content

Commit

Permalink
Merge pull request #12 from Lenhador/IOS-9727
Browse files Browse the repository at this point in the history
Allow client to provide their own metadata
  • Loading branch information
Lenhador authored Mar 1, 2021
2 parents 265cf47 + a3a7a27 commit d19b465
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
3 changes: 3 additions & 0 deletions Library/Sources/SCAssetExportSession.h
Original file line number Diff line number Diff line change
Expand Up @@ -108,4 +108,7 @@
*/
- (void)exportAsynchronouslyWithCompletionHandler:(void(^__nullable)(void))completionHandler;

- (void)exportAsynchronouslyWithCompletionHandler:(void(^__nullable)(void))completionHandler
metadata:(NSArray<AVMutableMetadataItem *> *__nonnull)metadata;

@end
8 changes: 7 additions & 1 deletion Library/Sources/SCAssetExportSession.m
Original file line number Diff line number Diff line change
Expand Up @@ -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<AVMutableMetadataItem *> *)metadata {
_cancelled = NO;
_nextAllowedVideoFrame = kCMTimeZero;
NSError *error = nil;
Expand All @@ -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);

Expand Down

0 comments on commit d19b465

Please sign in to comment.