Ana içeriğe geç

Maksimum Video Kayıt Süresi

Maksimum video kayıt süresini okuyun veya ayarlayın. SDK bu değeri dakika cinsinden ifade eder.

API Referansı

Framework

AIBuds.xcframework

Protokol

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?
    )
}
SembolAmaç
maxVideoRecordDurationDakika cinsinden güncel maksimum süre.
setMaxVideoRecordDurationMaksimum süreyi dakika cinsinden ayarlar.

Kullanım Örnekleri

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

Güncel Demo 1...120 dakikalık kaydırıcı kullanır. Genel SDK evrensel bir aralık belgelemediğinden, genel bir yetenek tanımlanana kadar bu sınırları Demo yaklaşımı olarak değerlendirin.