Video Room Device Selection

205 views
Skip to first unread message

Duncan Barnes

unread,
May 2, 2021, 12:21:34 PM5/2/21
to meetecho-janus
I'm struggling to get device selection for a video room working reliably. I've gone back to basics, using the video room demo code, with the following changes:
  • Added the below lines at the start of the publishOwnFeed function
var mediaobj = { audioRecv: false, videoRecv: false, audioSend: useAudio, videoSend: true };
var vdev = (getQueryStringValue("vdev") !== "" ? getQueryStringValue("vdev") : null);
var adev = (getQueryStringValue("adev") !== "" ? getQueryStringValue("adev") : null);
if(vdev != null){
       console.log('Choosing Video Device: ' + vdev);
       mediaobj.video = { deviceId: { exact: vdev } };
}
  • Changing the media argument in createOffer a few lines down for the mediaobj object created above.
From previous experiments in this same code file, I have retrieved a list of device ID's using the Janus.listDevices method as in the demo change devices code which I have then tried providing to these two GET variables. 

If I leave them unset, the default camera and mic gets selected, everything works fine. If I set the id's (one or both), whether its to the default camera and mic or other devices, the feed starts, and I can subscribe to it but after 5-10 seconds, the video on the subscriber starts to disappear intermittently and then within 30 seconds is gone altogether, leaving the 'No remote video available' message on screen.

Just wondering what I might be doing wrong here, I do get a Remote track muted message in the subscriber console, followed by a Removing remote track message. Should I be using the string name of the device rather than a number, e.g.: 'OBS Virtual Camera' rather than 84bcd5094a7cfaf334cef3efa8b163bbf5b980cda12209ec293e17e5ffacf994.

Many thanks!

Duncan Barnes

unread,
May 3, 2021, 9:08:23 AM5/3/21
to meetecho-janus
Same behaviour if I specify a stream in createoffer instead of media. On the receiving/subscribing side I get the below set of events in Chrome console before it finally dies. I've not had any real luck in tracking this down, just know that if I specify the source it starts and then dies.

Screenshot 2021-05-03 at 14.05.24.png

Duncan Barnes

unread,
May 4, 2021, 6:25:56 PM5/4/21
to meetecho-janus
The problem goes away when simulcast is disabled, but it would be great to try and understand where to start looking for why this is happening etc?

Many thanks!

Reply all
Reply to author
Forward
0 new messages