Overview
The device APIs are all onSMeetingEngine, so you don’t need to handle the platform differences between iOS and macOS yourself:
Device capabilities don’t depend on meeting state: after logging in (even before entering a meeting), you can enumerate devices and listen for plug and unplug events, which makes it easy to build a “pre-meeting device check” page.
Enumerate devices
DeviceInfo contains deviceId, name, kind, and isDefault.
Watch out for platform differences:
- macOS: the audio lists include a virtual device that points to the system default input / output
- iOS audio input: returns the available audio input routes (Bluetooth, wired headset, built-in microphone, and so on)
- iOS audio output: the system doesn’t provide enumeration, so
kind: .audioOutputreturns an empty array on iOS—output control on iOS is a Boolean “speakerphone or not” switch; see below
Switch cameras
SMeetingError.deviceError. If the user picks a device in a dropdown before turning on the camera, we recommend storing the choice in your app state first and passing it in when you call requestOpenCamera(deviceId:).
Switch microphones
- Microphone on: switches the input device being captured
- Microphone off (iOS): preselects the audio input route, for example choosing Bluetooth headphones before entering the meeting
- Microphone off (macOS): the recording pipeline hasn’t started yet, so the call returns directly without doing anything or reporting an error
Audio output
The two platforms have different capability models on the output side, so the APIs are split as well.macOS: choose the output device
iOS: speakerphone switch
AVRoutePickerView; apps can’t specify them directly.
To set “use the speakerphone by default long-term,” or to read the actual current route and listen for route changes, use the APIs in Audio routing—setSpeakerOutputEnabled(_:) and setAudioRoute(_:) there are two ways of writing the same mechanism.
How it differs from “speaker mute”
These two things are orthogonal; don’t mix them up:Listen for device plug and unplug events
Device changes are reported throughSMeetingDelegate:
- In the callbacks, only refresh the device list state, and let the UI layer update the pickers from the new list automatically
- If the currently selected
deviceIdhas disappeared from the list, fall back to the default device
When a device in use is unplugged, the SDK falls back to an available device on its own, so you don’t need to build a whole fault-tolerance layer. You should still refresh the UI, though, so it doesn’t keep showing a device that no longer exists.