ringtoneDevices properties of
Twilio.Device.audio are instances of
AudioOutputCollection . These
AudioOutputCollections represent active audio devices, and can be updated to redirect speaker and ringtone sounds to different devices in realtime.
The following is a list of methods available on
Set containing MediaDeviceInfo objects representing the active devices in the collection.
Replace the active devices in the collection by passing one or more device IDs. Returns a Promise, which is fulfilled if the device(s) were set successfully and rejected if:
Test the active devices by playing a sound through them. Optionally, a URL can be passed to play a custom test sound. Returns a Promise, which is fulfilled if the devices were set successfully and rejected if:
Audio selection requires the setSinkId functionality which, at the time of writing, is only supported in Chrome 49.0 and above; as Firefox and Edge add support for these APIs, twilio.js will be able to automatically make use of them.
If unsupported, the
get method will return an empty
Set , whereas the
test methods will return a rejected Promise.