DeviceController

@objc
public protocol DeviceController

DeviceController keeps track of the devices being used for audio device (e.g. built-in speaker), video input (e.g. camera)). The list functions return MediaDevice objects. Changes in device availability are broadcast to any registered DeviceChangeObserver.

  • List available audio devices

    Declaration

    Swift

    func listAudioDevices() -> [MediaDevice]

    Return Value

    list of Media Devices

  • Choose audio devices

    Declaration

    Swift

    func chooseAudioDevice(mediaDevice: MediaDevice)

    Parameters

    mediaDevice

    the device used as audio route

  • Add device change observer

    Declaration

    Swift

    func addDeviceChangeObserver(observer: DeviceChangeObserver)

    Parameters

    observer

    the object that will receive notification

  • Remove device change observer

    Declaration

    Swift

    func removeDeviceChangeObserver(observer: DeviceChangeObserver)

    Parameters

    observer

    the object that will be removed

  • Switch between front/back camera. This will no-op if using a custom source, e.g. one passed in via startLocalVideo

    Declaration

    Swift

    func switchCamera()
  • Get the currently active camera, if any. This will return null if using a custom source, e.g. one passed in via AudioVideoControllerFacade.startLocalVideo

    Declaration

    Swift

    func getActiveCamera() -> MediaDevice?

    Return Value

    a media device or nil if no device is present

  • Get currently used audio device

    Declaration

    Swift

    func getActiveAudioDevice() -> MediaDevice?

    Return Value

    a media device or nil if no device is present