Issue 9642 in dart: getUserMedia not working when served locally

28 views
Skip to first unread message

da...@googlecode.com

unread,
Apr 3, 2013, 4:27:47 PM4/3/13
to bu...@dartlang.org
Status: New
Owner: ----
Labels: Type-Defect Priority-Medium

New issue 9642 by j...@google.com: getUserMedia not working when served
locally
http://code.google.com/p/dart/issues/detail?id=9642

I'm running on a Pixel, with the Crouton chroot and dartium from the
special hackathon build. I ran `rm -rf ~/.config/chromium/`.

I have an HTML page that uses Dart, and I'm serving from:
file:///home/ldap/path/to/index.html

MediaStream.supported returns true, window.navigator.getUserMedia() works
(audio and video are false by default), but setting either or both
audio/video in getUserMedia to true throws an exception:
Uncaught Error: Instance of 'NavigatorUserMediaError' undefined:1
Exception: Instance of 'NavigatorUserMediaError'
Stack Trace: #0 _FutureImpl._scheduleUnhandledError.<anonymous
closure> (dart:async:391:9)
#1 Timer.run.<anonymous closure> (dart:async:2362:21)
#2 Timer.run.<anonymous closure> (dart:async:2370:13)
#3 Timer.Timer.<anonymous closure> (dart:async-patch:15:15)
#4 _timerFactoryClosure.<anonymous closure>.<anonymous closure>
(file:///path/to/build/dartium-lucid64-inc/build/src/dart/tools/dom/src/Timer.dart:22:13)
FIXME:1

Everything works as expected if I instead run an HTTP server on localhost
and use that HTML page instead: I get a prompt for camera use, allow it,
and the camera can be used.


There are three issues:
- No prompt for camera when serving locally.
- MediaStream.supported returns true.
- The exception thrown is cryptic.

--
You received this message because this project is configured to send all
issue notifications to this address.
You may adjust your notification preferences at:
https://code.google.com/hosting/settings

da...@googlecode.com

unread,
Apr 9, 2013, 5:18:19 AM4/9/13
to bu...@dartlang.org
Updates:
Status: Triaged
Labels: Area-HTML

Comment #1 on issue 9642 by sand...@google.com: getUserMedia not working
(No comment was entered for this change.)

da...@googlecode.com

unread,
Apr 9, 2013, 1:43:14 PM4/9/13
to bu...@dartlang.org
Updates:
Labels: Milestone-M5

Comment #2 on issue 9642 by bl...@google.com: getUserMedia not working when
served locally
http://code.google.com/p/dart/issues/detail?id=9642

Currently MediaStream.supported is checking for browser support but does
not validate things like protocol.

We're in the process of fixing up async error messages in general.

da...@googlecode.com

unread,
May 21, 2013, 11:30:46 PM5/21/13
to bu...@dartlang.org

Comment #3 on issue 9642 by uplight...@gmail.com: getUserMedia not working
Hi
I have "Instance of 'NavigatorUserMediaError' " when I choosing "Run in
Dartium" and launching in Chromium browser
But all works when "Run as JavaScript" and launching in Chrome

Script taken from example:

if(MediaStream.supported) {
window.navigator.getUserMedia(audio:false, video:
true).then((stream) {


var video = new VideoElement()
..autoplay = true
..src = Url.createObjectUrl(stream);
document.body.append(video);

})
.catchError((e){ print(e); });;

da...@googlecode.com

unread,
Aug 26, 2013, 4:57:47 PM8/26/13
to bu...@dartlang.org
Updates:
Labels: -Milestone-M6 Milestone-Later

Comment #5 on issue 9642 by efor...@google.com: getUserMedia not working
(No comment was entered for this change.)

da...@googlecode.com

unread,
Aug 26, 2013, 4:59:47 PM8/26/13
to bu...@dartlang.org
Updates:
Status: AsDesigned

Comment #6 on issue 9642 by efor...@google.com: getUserMedia not working
this is a browser security feature
Reply all
Reply to author
Forward
0 new messages