Subject: [rtcweb] determining mic/webcam availability on page load

From: Daniel Pocock <[email-masked]>
Date: Sun, 22 Sep 2013 20:16:39 +0200

Hi,

I'm not sure if this has been discussed before, but I think it would be
very useful for some applications to determine what hardware is
available very early, well before trying to do things like SIP
registration or making a call.

However, if I use the code below, the result is that the user is
prompted twice for permissions, once during the initial hardware
detection and later when they try to make or receive a call.

Regards,

Daniel

navigator.webkitGetUserMedia(

 {audio: true, video: true},

  function (stream) {
          var has_audio = false;
          var has_video = false;
	  if(stream.getAudioTracks().length > 0)
		  has_audio = true;
	  if(stream.getVideoTracks().length > 0)
		  has_video = true;
	  console.log("closing unused stream");
	  stream.stop();
	  delete stream;
          checksDone(has_audio, has_video);
  },

  function(err) {
	  console.log(err.name + ": " + err.message);
          checksDone(false, false);
  }

);

---

From: Harald Alvestrand <[email-masked]>
Date: Mon, 23 Sep 2013 07:07:18 +0200

> detection and later when they try to make or receive a call.

This is an API issue, so it should go to [email-masked]

But it's a solved issue in the spec, even though the implementations may 
be lagging: Use the getSourceInfos call to probe, not the getUserMedia call.

http://dev.w3.org/2011/webrtc/editor/getusermedia.html#methods-1
> _______________________________________________
> rtcweb mailing list
> [email-masked]
> https://www.ietf.org/mailman/listinfo/rtcweb

---

From: Stefan Håkansson LK <[email-masked]>
Date: Mon, 23 Sep 2013 05:46:16 +0000

> This is an API issue, so it should go to [email-masked]

As this deals with access to input devices, I think the correct place is 
actually [email-masked]