Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] Microphone icon is persisted on browser's tab after an incoming call. #306

Open
3 of 4 tasks
nhatnguyennguyen opened this issue Dec 31, 2024 · 1 comment
Open
3 of 4 tasks
Labels
bug Something isn't working

Comments

@nhatnguyennguyen
Copy link

nhatnguyennguyen commented Dec 31, 2024

  • I have verified that the issue occurs with the latest twilio.js release and is not marked as a known issue in the CHANGELOG.md.
  • I reviewed the Common Issues and open GitHub issues and verified that this report represents a potentially new issue.
  • I verified that the Quickstart application works in my environment.
  • I am not sharing any Personally Identifiable Information (PII)
    or sensitive account information (API keys, credentials, etc.) when reporting this issue.

I have an incoming call, it worked successfully. But after the call is finished, I go back to the screen before, microphone icon still appear on the tab, there are no ways to hide it. I have tried with device and deviceAudio: destroy, disconnect, unregister, removeListeners but nothing worked

Code to reproduce the issue:

const useIncomingCall = () => {
  const [device, setDevice] = useState<Device>();
  const initCall = async ({ token }: IncomingCall) => {
    const device = new Device(token, {
      closeProtection: true
    });

    await device.register();

    device.on('incoming', (connection) => {
      connection.accept();
    });

    device.on('error', (error) => {
      console.error('Twilio Device error:', error);
    });
    setDevice(device);
  };

  useEffect(() => {
    return () => {
      device?.destroy();
    };
  }, [device]);

  return {
    initCall
  };
};

export default useIncomingCall;

Expected behavior:

Microphone icon on browser shouldn't show

Actual behavior:

Microphone icon still show even call device.destroy()

@nhatnguyennguyen nhatnguyennguyen added the bug Something isn't working label Dec 31, 2024
@nhatnguyennguyen nhatnguyennguyen changed the title [BUG] Microphone icon persist on browser tab after an incoming call. [BUG] Microphone icon is persisted on browser's tab after an incoming call. Dec 31, 2024
@kpchoy
Copy link
Collaborator

kpchoy commented Jan 11, 2025

Hello @nhatnguyennguyen, I was not able to reproduce this issue locally. Please take a look at our example here on how to handle incoming calls

You can also run the /twilio-voice-dialer component in our example repo: twilio-voice-js-reference-components

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants