提交
This commit is contained in:
44
TUIKit/TUIChat/CommonUI/Album/MultimediaRecorder.m
Normal file
44
TUIKit/TUIChat/CommonUI/Album/MultimediaRecorder.m
Normal file
@@ -0,0 +1,44 @@
|
||||
//
|
||||
// VideoRecorder.m
|
||||
// TUIChat
|
||||
//
|
||||
// Created by yiliangwang on 2024/10/30.
|
||||
// Copyright © 2024 Tencent. All rights reserved.
|
||||
//
|
||||
|
||||
#import "MultimediaRecorder.h"
|
||||
|
||||
@interface MultimediaRecorder ()
|
||||
|
||||
@end
|
||||
|
||||
@implementation MultimediaRecorder
|
||||
|
||||
+ (instancetype)sharedInstance {
|
||||
static MultimediaRecorder *sharedInstance = nil;
|
||||
static dispatch_once_t onceToken;
|
||||
dispatch_once(&onceToken, ^{
|
||||
sharedInstance = [[self alloc] init];
|
||||
});
|
||||
return sharedInstance;
|
||||
}
|
||||
|
||||
+ (void)registerAdvancedVideoRecorder:(id<IMultimediaRecorder>)videoRecorder {
|
||||
[MultimediaRecorder sharedInstance].advancedVideoRecorder = videoRecorder;
|
||||
}
|
||||
|
||||
- (void)recordVideoWithCaller:(UIViewController *)caller
|
||||
successBlock:(VideoRecorderSuccessBlock)successBlock
|
||||
failureBlock:(VideoRecorderFailureBlock)failureBlock {
|
||||
id<IMultimediaRecorder> videoRecorder = nil;
|
||||
if ([MultimediaRecorder sharedInstance].advancedVideoRecorder) {
|
||||
videoRecorder = [MultimediaRecorder sharedInstance].advancedVideoRecorder;
|
||||
}
|
||||
|
||||
if (videoRecorder && [videoRecorder respondsToSelector:@selector
|
||||
(recordVideoWithCaller:successBlock:failureBlock:)]) {
|
||||
[videoRecorder recordVideoWithCaller:caller successBlock:successBlock failureBlock:failureBlock];
|
||||
}
|
||||
}
|
||||
|
||||
@end
|
||||
Reference in New Issue
Block a user