최대 동영상 녹화 시간
최대 동영상 녹화 시간을 읽거나 설정합니다. SDK에서 사용하는 단위는 분입니다.
API 참고
프레임워크
AIBuds.xcframework
프로토콜
- Swift
- Objective-C
/// The protocol for device API that supports camera.
protocol DeviceCameraAPI: DeviceAPI {
/// Maximum video recording duration (in minutes) allowed by the device.
var maxVideoRecordDuration: NSNumber? { get }
/// Sets the maximum video recording duration.
/// - Parameters:
/// - duration: The maximum recording duration in minutes.
/// - completion: A closure that is called when the operation completes.
/// - success: `true` if the operation was successful; otherwise `false`.
/// - error: An `NSError` object that describes the error that occurred, or `nil` if the operation was successful.
func setMaxVideoRecordDuration(
_ duration: Int,
completion: AIBudsCompletionHandler?
)
}/// The protocol for device API that supports camera.
@protocol AIBudsDeviceCameraAPI <AIBudsDeviceAPI>
/// Maximum video recording duration (in minutes) allowed by the device.
@property(nonatomic, readonly, strong) NSNumber *_Nullable maxVideoRecordDuration;
/// Sets the maximum video recording duration.
/// - Parameters:
/// - duration: The maximum recording duration in minutes.
/// - completion: A closure that is called when the operation completes.
/// - success: `true` if the operation was successful; otherwise `false`.
/// - error: An `NSError` object that describes the error that occurred, or `nil` if the
/// operation was successful.
- (void)setMaxVideoRecordDuration:(NSInteger)duration
completion:(AIBudsCompletionHandler _Nullable)completion;
@end| 기호 | 용도 |
|---|---|
maxVideoRecordDuration | 현재 최대 녹화 시간(분)입니다. |
setMaxVideoRecordDuration | 최대 녹화 시간을 분 단위로 설정합니다. |
사용 예제
- Swift
- Objective-C
guard let device = device as? DeviceCameraAPI else { return }
print(
"Current maximum: \(device.maxVideoRecordDuration?.intValue.description ?? "Unavailable") minutes"
)
device.setMaxVideoRecordDuration(30) { success, error in
if !success { print(error?.localizedDescription ?? "Update failed") }
}id<AIBudsDeviceCameraAPI> device = (id<AIBudsDeviceCameraAPI>)self.device;
if ([device conformsToProtocol:@protocol(AIBudsDeviceCameraAPI)]) {
NSLog(@"Current maximum: %@ minutes", device.maxVideoRecordDuration);
[device setMaxVideoRecordDuration:30
completion:^(BOOL success, NSError *_Nullable error) {
if (!success)
NSLog(@"Update failed: %@", error.localizedDescription);
}];
}현재 Demo는 1...120분 범위의 슬라이더를 사용합니다. 공개 SDK에는 모든 기기에 적용되는 범위가 정의되어 있지 않으므로 공식 지원 범위가 공개되기 전까지 이 값은 Demo의 구현 기준으로 사용하세요.