Skip to content

Core Camera Max Recording Duration

Mr.P edited this page Aug 29, 2026 · 2 revisions

Maximum Video Recording Duration

Read or set the maximum video recording duration. The SDK expresses the value in minutes.

API Reference

Framework

AIBuds.xcframework

Protocol

Swift

/// 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?
    )
}

Objective-C

/// 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
Symbol Purpose
maxVideoRecordDuration Current maximum duration in minutes.
setMaxVideoRecordDuration Set the maximum duration in minutes.

Usage Examples

Swift

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") }
}

Objective-C

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);
                           }];
}

The current Demo uses a 1...120 minute slider. The public SDK does not document a universal range, so treat those limits as a Demo convention pending a public capability.

AIBuds SDK iOS Wiki

Clone this wiki locally