-
Notifications
You must be signed in to change notification settings - Fork 23
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
Media Device API #24
Comments
Let separate promises (#10) and this issue. I agree that we need to decide the exact API for "get media devices". The W3 spec has changed a lot along the time, but still Chrome is the only browser implementing it, and it implements an old version of the spec... So this is very hard.
May you detail it a bit more? If you mean "getUserMedia constraints", then yes, that is a paint and I'm pretty sure that the current Chrome implementation is not based on the latest spec. |
Not really. FF >= 40 (haven't tested previous versions) already have the new The syntax to select what device one wants seems to be different: (old)
(new)
(I haven't tested the new constraints mode yet though) |
Despite the
Apart from this, it should be noted the Now, the question is, whether or not a shim should also normalize the device info object. If normalized, one would need a helper function to create an appropriate (browser-specific) constraint object, as @saghul pointed out the constraint syntax has been changed, too. As the application probably wants to add more constraint attributes (e.g. constraints regarding video dimensions) the helper function would also need to deal with this and the whole constraint may get rather complex. I think it is better to let the application do the normalization to keep the complexity of rtcninja as low as possible. Following this, I think rtcninja should shim enumerateDevices separately from getMediaDevices. Regarding Promises I think rtcninja should provide "promise-neutral" interface for now to support legacy applications. Thus wrapper for the new interfaces like |
Thanks for the input. This will be done once a globla refactor is done in the lib.
That is not the idea. Instead rtcninja will just offer the newest API to the app, while it will be ready to handle older API browser implementations. I strongly think that is the way to go. |
Ok. If |
rtcninja will provide |
…ng discussion on issue eface2face#24
Ahoi!
(Somewhat related to #10)
I've been trying to do something which sounds simple like selecting the audio / video device I want to use before calling
getUserMedia
. I didn't know I was in for that much nonsense.AFAIS there are at least a couple of ways browsers do it,
navigator.mediaDevices.enumerateDevices
being the new and shinny preferred way.rtcninja provides
getMediaDevices
, which is a wrapper around,MediaStreamTrack.getSources
, alas this doesn't work on Firefox nor on Chrome >= 47 (current Canary).The problem is that depending on how the devices are enumerated the constraints need to be specified differently, so rtcninja would also need to accommodate for that.
This is something I can probably work on and provide a patch, but there are a couple of things that need clarifying first:
navigator.mediaDevices
, or just provide a customgetMediaDevices
API function?Maybe this is a good start to implement the promise based API?
The text was updated successfully, but these errors were encountered: