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

Chrome 80 Android - default audio is coming out of earpiece. #386

Closed
wardhanster opened this issue Feb 10, 2020 · 6 comments
Closed

Chrome 80 Android - default audio is coming out of earpiece. #386

wardhanster opened this issue Feb 10, 2020 · 6 comments
Labels

Comments

@wardhanster
Copy link

Describe the bug
On some devices on chrome 80 android, the default audio output is coming out of the earpiece.

Expected behavior
The default output should always happen via Speaker.

Wrong current behavior
On Chrome <80 its is working as expected. Tested on Samsung Note 8
For Pixel 3A: it is working for both versions of chrome.

OpenVidu deployment info

Client device info (if applicable)
Describe the client device(s) or platform(s) where you are able to replicate the error. For example:

  • Chrome 80.0.03987.87 Android 10

I tried to change the output target using sinkId api - but aparantly it is not available

@pabloFuente
Copy link
Member

Well, if setSinkId Web API is not working, then I'm afraid there's little you (or us) can do. This seems to be a problem for some browsers running in some specific devices/OSs, but technologically I'm pretty sure we don't have control over the default audio output used by the browser.

I'll take a look when I have some time, but I'm not sure we'll have any Android device behaving like this. We don't own a Note 8 phone, I'm afraid.

Regards.

@wardhanster
Copy link
Author

@pabloFuente setSinkId was not working out for my setup.
I was able to solve it by forcing the audioSource to use the speakerphone
I also had to do a background check if the user is on desktop or mobile
and once the mobile is detected I had to force audioSource to speakerphone.

What puzzles me is the speakerphone is marked as an Input for navigator.mediaDevices.enumerateDevices((d)=>{console.log(d)}).
I also verified similar behaviour on https://whereby.com/

devices.filter(i => i.label.toLowerCase() === 'speakerphone')[0].deviceId;

I hope that helps when you circle back to this.

@pabloFuente
Copy link
Member

So, you passed audioSource: SPEAKERPHONEID as a property to OpenVidu.initPublisher method? (being SPEAKERPHONEID the deviceId of the speakerphone Media Device).

If that's so, I just can say that Chrome should do better. Glad you found out a solution.

@wardhanster
Copy link
Author

@pabloFuente yep that's exactly what I did
I hope this helps someone
I'll close this ticket for now

@CoreyCole
Copy link

CoreyCole commented Apr 1, 2020

@pabloFuente do you know how I could do this workaround in Chrome on android with a generic media stream (not using OpenVidu). I'm trying to play an incoming webrtc media stream through the speakerphone output. I have the ID of the speakerphone input device, but don't know where to set it for the output. Thanks :)

EDIT: found a workaround. It didn't need the speakerphone output deviceId. I simply needed to make an HTMLAudioElement and set the stream there. Sorry for the unnecessary notification!

const audio = new Audio();
audio.srcObject = this.webrtcDestinationNode.stream;
audio.play();

@richard-dch
Copy link

richard-dch commented Dec 3, 2021

@wardhanster
Is the device.label speakerphone something unique to android devices, I tested on Iphone and was not able to enumerate any devices with that label.


@pabloFuente
is there an angular solution for setting the default speaker as loudspeaker on iOS ?

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

No branches or pull requests

4 participants