JitsiMeetJS.createLocalTracks

Jitsi doesn’t use the deviceId passed into the options when creating local tracks.
These are the data used when creating the track

const options = {
[“video”, “audio”],
facingMode: ‘user’,
micDeviceId: “8a3c30ee53a6c77d8211650d0a4fd80fe2b13bf6c6fa78ff8fc41063173a3e3d”
}

JitsiMeetJS.createLocalTracks(options)

Then

JitsiMeetJS.getActiveAudioDevice().then((devices) => {
console.log('getActiveAudioDevice: ', devices)
// Output - {deviceId: “f54c6f7fea14771e1a2dc7a18cec6183aea0f96f3e957ee17846b60e36082469”, deviceLabel: “Built-in Audio Analog Stereo”}
})

The same thing also happens when I set the audio output device.

I would appreciate your help @damencho
Thank you!

Update:

Local audio track uses the deviceId passed from the options when creating local tracks but the getActiveAudioDevice function still returns a different deviceId.

if you didn’t try this, try to wrap your test code in createLocalTracks then scope.
because createLocalTracks is a promise function.(i mean asynchronous function)

JitsiMeetJS.createLocalTracks(options).then(_=>{

JitsiMeetJS.getActiveAudioDevice().then((devices) => {
console.log('getActiveAudioDevice: ', devices)
// Output - still same?

});

Hello, I’ve tried your suggestion but it still have the same output.

It was my bad, to tag someone else on this post. Won’t happen again. Thank you!

1 Like