RESOLVED FIXED 158393
getUserMedia() exposed, but not functional
https://bugs.webkit.org/show_bug.cgi?id=158393
Summary getUserMedia() exposed, but not functional
Niels Leenheer (HTML5test)
Reported 2016-06-04 23:47:24 PDT
The getUserMedia() function is exposed, but when you try to use it, it just fails and calls the error callback. This breaks feature detection. navigator.getUserMedia({ video: true, audio: true }, function() { console.log('success', arguments) }, function() { console.log('error', arguments) }) => error – Arguments [ Error: NotAllowedError: DOM Exception 35 ] and: !!navigator.getUserMedia => true This is also a problem for HTML5test.com where Safari currently gets points for supporting getUserMedia, without actually deserving so. I hope this is an unfinished implementation that will be ready for the next release of Safari, but if not, it should not be exposed publicly. Otherwise I'm afraid I have to put this feature on a blacklist so that HTML5test.com won't show an inaccurate result. The same thing applies to the prefixed webkitGetUserMedia function.
Attachments
Proposed patch. (1.71 KB, patch)
2016-06-30 12:38 PDT, Eric Carlson
dino: review+
Patch for landing. (2.06 KB, patch)
2016-06-30 13:39 PDT, Eric Carlson
no flags
Eric Carlson
Comment 1 2016-06-05 10:42:49 PDT
(In reply to comment #0) > > This is also a problem for HTML5test.com where Safari currently gets points > for supporting getUserMedia, without actually deserving so. I hope this is > an unfinished implementation that will be ready for the next release of > Safari, but if not, it should not be exposed publicly. Otherwise I'm afraid > I have to put this feature on a blacklist so that HTML5test.com won't show > an inaccurate result. > > The same thing applies to the prefixed webkitGetUserMedia function. Are you testing with a WebKit nightly build, or with Safari Technology Preview?
Niels Leenheer (HTML5test)
Comment 2 2016-06-05 11:04:31 PDT
Safari Technical Preview 5 (this issue has been present since Preview 1)
Niels Leenheer (HTML5test)
Comment 3 2016-06-05 11:08:55 PDT
Bug is also visible in WebKit Nightly r201698.
Radar WebKit Bug Importer
Comment 4 2016-06-05 11:16:44 PDT
Eric Carlson
Comment 5 2016-06-30 12:38:56 PDT
Created attachment 282457 [details] Proposed patch.
WebKit Commit Bot
Comment 6 2016-06-30 12:40:53 PDT
Attachment 282457 [details] did not pass style-queue: ERROR: Source/WebCore/bindings/generic/RuntimeEnabledFeatures.cpp:41: preprocessor directives (e.g., #ifdef, #define, #import) should never be indented. [whitespace/indent] [4] ERROR: Source/WebCore/bindings/generic/RuntimeEnabledFeatures.cpp:43: preprocessor directives (e.g., #ifdef, #define, #import) should never be indented. [whitespace/indent] [4] Total errors found: 2 in 2 files If any of these errors are false positives, please file a bug against check-webkit-style.
Dean Jackson
Comment 7 2016-06-30 12:57:23 PDT
Comment on attachment 282457 [details] Proposed patch. View in context: https://bugs.webkit.org/attachment.cgi?id=282457&action=review > Source/WebCore/bindings/generic/RuntimeEnabledFeatures.cpp:72 > #if ENABLE(MEDIA_STREAM) Maybe this should be #if ENABLE(MEDIA_STREAM) && PLATFORM(COCOA) ?
Dean Jackson
Comment 8 2016-06-30 12:57:57 PDT
Comment on attachment 282457 [details] Proposed patch. View in context: https://bugs.webkit.org/attachment.cgi?id=282457&action=review >> Source/WebCore/bindings/generic/RuntimeEnabledFeatures.cpp:72 >> #if ENABLE(MEDIA_STREAM) > > Maybe this should be #if ENABLE(MEDIA_STREAM) && PLATFORM(COCOA) ? Oops. I meant !PLATFORM(COCOA) :)
Eric Carlson
Comment 9 2016-06-30 13:39:14 PDT
Created attachment 282460 [details] Patch for landing.
WebKit Commit Bot
Comment 10 2016-06-30 14:20:52 PDT
Comment on attachment 282460 [details] Patch for landing. Clearing flags on attachment: 282460 Committed r202704: <http://trac.webkit.org/changeset/202704>
Niels Leenheer (HTML5test)
Comment 11 2016-07-21 14:50:38 PDT
navigator.getUserMedia is no longer exposed in Safari Technology Preview 9. Not originally mentioned in this bug, but the new API for getUserMedia was also exposed in earlier versions. The patch that has landed did not fix that. In fact, navigator.mediaDevices.getUserMedia is still exposed in the latest Technology Preview. navigator.mediaDevices.getUserMedia({ audio: true, video: true }).catch(function(e) { console.log(e) }); => Error: NotAllowedError: DOM Exception 35
Alexey Proskuryakov
Comment 12 2019-09-24 17:30:42 PDT
> Committed r202704: <http://trac.webkit.org/changeset/202704> Moving to RESOLVED since this landed.
Note You need to log in before you can comment on or make changes to this bug.