본문으로 건너뛰기

최대 동영상 녹화 시간

최대 동영상 녹화 시간을 읽거나 설정합니다. SDK에서 사용하는 단위는 분입니다.

API 참고

프레임워크

AIBuds.xcframework

프로토콜

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?
    )
}
기호용도
maxVideoRecordDuration현재 최대 녹화 시간(분)입니다.
setMaxVideoRecordDuration최대 녹화 시간을 분 단위로 설정합니다.

사용 예제

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

현재 Demo는 1...120분 범위의 슬라이더를 사용합니다. 공개 SDK에는 모든 기기에 적용되는 범위가 정의되어 있지 않으므로 공식 지원 범위가 공개되기 전까지 이 값은 Demo의 구현 기준으로 사용하세요.