IVSMultiSourceDevice

Objective-C

@protocol IVSMultiSourceDevice <IVSDevice>

Swift

protocol IVSMultiSourceDevice : IVSDevice

Represents an input device such as a camera or microphone with multiple underlying input sources.

  • List available underlying input sources for the device.

    @discussion

    The return order of these input sources is predictable. They are sorted by, in priority order:

    • position (based on rawValue of the IVSDevicePosition enum in ascending order)
    • isDefault (YES will appear before NO)
    • friendlyName (sorted alphabetically in ascending order)

    Declaration

    Objective-C

    - (nonnull NSArray<IVSDeviceDescriptor *> *)listAvailableInputSources;

    Swift

    func listAvailableInputSources() -> [IVSDeviceDescriptor]
  • Sets the preferred input source.

    The preferred input source of a camera device will always take effect if no error occurs. The preferred input source of a microphone device may take effect if the system allows it and no error occurs.

    Declaration

    Objective-C

    - (void)setPreferredInputSource:(nonnull IVSDeviceDescriptor *)inputSource
                         onComplete:(NS_SWIFT_UI_ACTOR void (^_Nullable)(
                                        NSError *_Nullable))onComplete;

    Swift

    func preferInputSource(_ inputSource: IVSDeviceDescriptor) async throws

    Parameters

    inputSource

    The preferred input source.

    onComplete

    A callback that that contains any error that occurred while updating the preferred input source. Invoked when the operation has completed. Always invoked on the main queue.