Skip to content

Latest commit

 

History

History
64 lines (48 loc) · 2.86 KB

COMMON_ISSUES.md

File metadata and controls

64 lines (48 loc) · 2.86 KB

Common Issues

Having an issue with twilio.js? Review this list of common issues to determine whether or not your issue is known or a workaround is available. Please also take a look at the CHANGELOG.md to see if your issue is known for a particular release. If your issue hasn't been reported, consider submitting a new issue.

Working around the browsers' autoplay policy

Chrome, Firefox and Safari enforce the autoplay policy, which blocks automatically playing audio if the user has not interacted with your application (ex: clicking a button to log in). You can find more details about the autoplay policies here:

One of the most troublesome side effects this behavior can cause for your application is missed calls. If the autoplay policy blocks the incoming call sound from playing in the browser, a user expecting a call may miss it because the sound won't play.

We recommend ensuring that your end user must interact with the page before setting up the Device. If the user is not logged in, asking them to log in on the same page will qualify. If the user is already logged in, we recommend adding a button to indicate that they are ready to receive calls. For example:

  document.getElementById('ready_button').addEventListener('click', () => {
    device = new Twilio.Device(token);
  });

Missing Input or Output Device Labels

In standard browsers, after making a getUserMedia request, the window will populate the labels for all available input and output devices. Some browsers are slowly catching up but not yet fully implemented, and won't supply labels for input or output devices.

Audio Stream Not Closing After Hanging Up Call

When calling Device.audio.setInputDevice(), the input device will not be unset until Device.audio.unsetInputDevice() is called. This means that if .setInputDevice() is called during a call, and the call is hung up, the microphone will continue capturing until .unsetInputDevice() is called.

Aggressive Browser Extensions and Plugins

Some browser extensions and plugins will disable WebRTC APIs, causing twilio-voice.js to fail. Examples of such plugins include

  • uBlockOrigin-Extra
  • WebRTC Leak Prevent
  • Easy WebRTC Block

These are unsupported and likely to break twilio-voice.js. If you are having trouble with twilio-voice.js, ensure these are not running.