muaz-khan / WebRTC-Experiment

WebRTC, WebRTC and WebRTC. Everything here is all about WebRTC!!
https://www.webrtc-experiment.com/
MIT License
11.77k stars 3.95k forks source link

bluetooth headset on android #177

Open pastissolo opened 10 years ago

pastissolo commented 10 years ago

Hi. i am developing a video chat/conference application. it works fine on both desktop and android devices;

but when you are talking, chatting with your phone, you may want to be free in your movement, and use a classic wired headset can be annoying.

i am trying to get a bluetooth headset working on some devices, but it seems there's no chance.

Have you guys any ideas about solving that??

i know this question is not strictly code related, but indeed it can be, maybe it's just about setting the right bitrate of the external device etc...

migueltarga commented 10 years ago

Use MediaStreamTrack.getSources to list all Audio and Video devices, and use it on getUserMedia :

navigator.getUserMedia({ audio: { optional: [{sourceId: audioSource}] }, video: true },successCallback, errorCallback);

muaz-khan commented 10 years ago

Make sure that chrome/firefox on Android is capable to capture bluetooth headset. Maybe bluetooth support is disabled and you need to enable via chrome://flags or about:config.

Then you should use remote debugging and load a page with following script:

// for Firefox Beta on Android
navigator.mozGetUserMedia({audio: true}, function() {
     alert('success');
}, function(error) {
     alert( JSON.stringify(error, null, '\t') );
});

Firefox allows you choose devices via <select> boxes; you can select bluetooth headset and continue.

pastissolo commented 10 years ago

i already use getSources,
i can switch from the front to the back camera of my phone, but it seems it cannot see the bluetooth device that works perfectly on phone calls.

i did not find any bluetooth option on the flags menu of chrome, just the MediaStreamTrack.getSources function, but it is enabled

muaz-khan commented 10 years ago

@pastissolo, please look at: https://code.google.com/p/webrtc/issues/detail?id=739 Seems bluetooth isn't supported in chromium yet. Please verify from Google WebRTC team.

You should try chrome.bluetooth chrome extension API on desktop and test on chrome dev channels.

muaz-khan commented 10 years ago

@pastissolo Just for confirmation, in M33 milestone, only device enumeration API has been supported for Android.. Bluetooth support is work-in progress.