Skip to main content

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?
    )
}
SymbolPurpose
maxVideoRecordDurationCurrent maximum duration in minutes.
setMaxVideoRecordDurationSet 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") }
}

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.