You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When the app is opened and Twilio device is initialized, ensure you haven't granted microphone permissions yet.
Then, grant permissions to microphone and only after call setInputDevice
this.twilioDevice=newDevice(token,options)// grant permissions to microphone in the browsertry{awaitthis.twilioDevice.audio.setInputDevice('default')}catch(e){console.log(e)}
Expected behavior:
It should succeed to set the input device since the permissions are already granted
Actual behavior:
It fails to set input device with the error: InvalidArgumentError: Device not found: default
Software versions:
Browser(s): Chrome Version 119.0.6045.199 (Official Build) (arm64)
@PriscilaAlves thanks for reaching out! This happens because the device ID that you're passing to setInputDevice is not detected. To properly update the internal list of device IDs, you need to grant permissions before initializing the device. For example:
@charliesantos Thanks for the response.
Although I know that would work as a workaround, I don't think it should be needed to instantiate the Twilio Device only after the permissions are set.
I think Twilio SDK should be listening to navigator.permissions state changes and update the availableInputDevices list when the access is granted
This is an example of the code that could live inside the audiohelper.js file:
or sensitive account information (API keys, credentials, etc.) when reporting this issue.
Code to reproduce the issue:
When the app is opened and Twilio device is initialized, ensure you haven't granted microphone permissions yet.
Then, grant permissions to microphone and only after call
setInputDevice
Expected behavior:
It should succeed to set the input device since the permissions are already granted
Actual behavior:
It fails to set input device with the error:
InvalidArgumentError: Device not found: default
Software versions:
The text was updated successfully, but these errors were encountered: