Open robertmuth opened 5 years ago
We are missing a couple APIs from MediaDevices
, getUserMedia
and getDisplayMedia
. Otherwise I think we are good with Navigator.mediaDevices
.
Thanks Nate! Just a note: Navigator.getUserMedia is deprecated, which is probably why the warning mentioned in the original comment was displayed.
https://developer.mozilla.org/en-US/docs/Web/API/Navigator/getUserMedia
Re: missing APIs, MediaDevices.getUserMedia
was suppressed in the last IDL roll: https://github.com/dart-lang/sdk/blob/master/tools/dom/idl/dart/dart.idl#L320. I talked to @terrylucas and it seems like it was suppressed due to lack of support for Promise
, which has been fixed, so hopefully the fix might be to just remove that and see what the scripts generate.
As for getDisplayMedia
, it wasn't introduced in Chrome until version 72, and our IDLs are from 63.
Nice to see some activity on this bug - I had sort of given up on dart for html. Is there a timeframe for upgrading the idl ? Chrome 63 was released end of 2017.
Unfortunately, due to how much work it will take, there isn't a plan currently for upgrading/rolling the IDL. Sorry about that. We want to migrate to a different model using the generated DOM in TypeScript instead, but that's still in a preliminary stage.
There are a few other long-standing bugs that might also be fixable without rolling the IDLs:
gamepad bindings https://github.com/dart-lang/sdk/issues/33148
midi bindings https://github.com/dart-lang/sdk/issues/33248
speech synthesis bindings https://github.com/dart-lang/sdk/issues/33178
Last time I tried (6-12 month ago) I could not get services workers to run either but I have not confirmed this lately.
Thanks for sharing! We're looking to triage these and other outstanding HTML bugs so we can address them soon.
I've run into this issue because Safari, which I think added support for this only somewhat recently, has implemented navigator.mediaDevices.getUserMedia, but not navigator.getUserMedia. I'm having a tough time figuring out how to add support for this through Dart's JS interop.
@srujzs
Any update? This bug is soon celebrating its 18 months anniversary.
No, not yet, sorry. I've been focusing largely on the null safety release; we haven't gotten the opportunity to sit down and triage/tackle some of these bugs. Since this looks like a simple un-suppressing, I'll take a stab at it and report back soon.
MediaDevices.getUserMedia
has been landed. @robertmuth, is there anything left in this issue that hasn't been addressed/discussed?
seems like MediaDevices.getUserMedia ignores constraints at all, as well as MediaStreamTrack.applyConstraints, used to write interop to test, and with interop it's working as well, but not with provided dart:html method :(
Yep, looks like something wrong with convertDartToNative_Dictionary, because I've forked the engine, changed this method to convertDartToNative_SerializedScriptValue and tried to run with this changes, and now everything works like a charm, and there is a lot of places using convertDartToNative_Dictionary that's mean we have a lot of places with the issues at the moment :(
seems like MediaDevices.getUserMedia ignores constraints at all
Hmm, I don't believe I'm seeing this locally. Changing the constraints between {'audio': true}
and {'video': true}
triggers Chrome to ask for microphone or camera access, respectively. Can you file a separate issue and provide a small repro for the issue you are seeing? Thanks!
there is already opened separated issue #43802 and yes, its happening and really critical because it's not possible to switch or specify camera and turn on/off torch from which I've noticed the issue and already fixed locally
add its deviceId to the MediaConstraints object that eventually gets passed into getUserMedia()
Are you sure this is a dart problem? If I'm switching {'audio': true}
and {'video': true}
and back, my user already knows the confirm
answer
dart --version Dart VM version: 2.2.0-dev.0.0 (Unknown timestamp) on "linux_x64"
Old transpiled code is now broken and re-transpiling with the new sdk does not fix the problem.
I see the following warning: navigator.mozGetUserMedia has been replaced by navigator.mediaDevices.getUserMedia
but I think the real issue is that videoElem.mozSrcObject = stream; needs to change to videoElem.srcObject = stream;
https://github.com/ChronosTeam/ChronosGL has several reproducers in example/camera*