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

Mute audio/video when phone call received and picked #87

Closed
him2016 opened this issue May 14, 2020 · 8 comments
Closed

Mute audio/video when phone call received and picked #87

him2016 opened this issue May 14, 2020 · 8 comments
Assignees
Labels
enhancement New feature or request

Comments

@him2016
Copy link

him2016 commented May 14, 2020

I have been trying to integrate Twilio SDK in my app. I came across a scenario where I need to mute audio and stop video capture when phone call received. Does the SDK provide any callback and how do I handle it?

@Alton09 Alton09 self-assigned this May 14, 2020
@Alton09 Alton09 added the enhancement New feature or request label May 14, 2020
@Alton09
Copy link
Contributor

Alton09 commented May 14, 2020

Hi @him2016 ! Thanks for reaching out. This scenario is not handled by the SDK. However, we are planning to add this feature to the video app to help demonstrate how to handle this scenario in a production collaboration video app. It will essentially respond to system phone call events using the Android PhoneStateListener class. In the meantime, here is a thread on stackoverflow that demonstrates how to handle this.

@him2016
Copy link
Author

him2016 commented May 14, 2020

Thanks for the prompt reply. I will try this. Also if possible, can you let me know by when it will be demonstrated in the sample app..?

@Alton09
Copy link
Contributor

Alton09 commented May 14, 2020

Yes, I'll make sure to close this issue once it has been implemented in the app.

@him2016
Copy link
Author

him2016 commented May 15, 2020

ok thanks.. looking forward to it..

@VanKhulup
Copy link

VanKhulup commented Mar 18, 2021

Are there any updates on this question? What is the recommended way to handle this scenario on Twilio side? The only possible way I see is to implement custom AudioDevice from scratch and externally pause/resume it.

@Alton09
Copy link
Contributor

Alton09 commented Mar 23, 2021

Hi @VanKhulup . This one is still in our backlog for this app. However, it shouldn't be too bad to implement. Checkout this comment:

Hi @him2016 ! Thanks for reaching out. This scenario is not handled by the SDK. However, we are planning to add this feature to the video app to help demonstrate how to handle this scenario in a production collaboration video app. It will essentially respond to system phone call events using the Android PhoneStateListener class. In the meantime, here is a thread on stackoverflow that demonstrates how to handle this.

After receiving the phone call event from a broadcast receiver, you should then be able to mute the local audio and video tracks with logic like this...

We are open for any pull requests from the community if anyone gets to this before we do 😃

@Alton09
Copy link
Contributor

Alton09 commented May 11, 2021

Closing this issue as it will be covered in #212

@Alton09 Alton09 closed this as completed May 11, 2021
@KishanViramgama
Copy link

@Alton09 @him2016
Hello I'm trying to implement this functionality but it's not working only the video is paused but the audio is not paused/disabled if any other way then let me know about this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

4 participants