<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugs.webkit.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.4.1"
          urlbase="https://bugs.webkit.org/"
          
          maintainer="admin@webkit.org"
>

    <bug>
          <bug_id>158393</bug_id>
          
          <creation_ts>2016-06-04 23:47:24 -0700</creation_ts>
          <short_desc>getUserMedia() exposed, but not functional</short_desc>
          <delta_ts>2019-09-24 17:30:42 -0700</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WebKit</product>
          <component>Media</component>
          <version>Safari Technology Preview</version>
          <rep_platform>Mac</rep_platform>
          <op_sys>All</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords>InRadar</keywords>
          <priority>P2</priority>
          <bug_severity>Major</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Niels Leenheer (HTML5test)">info</reporter>
          <assigned_to name="Eric Carlson">eric.carlson</assigned_to>
          <cc>ap</cc>
    
    <cc>commit-queue</cc>
    
    <cc>daniele.tassone</cc>
    
    <cc>eric.carlson</cc>
    
    <cc>nekr.fabula</cc>
    
    <cc>simon.fraser</cc>
    
    <cc>webkit-bug-importer</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>1199346</commentid>
    <comment_count>0</comment_count>
    <who name="Niels Leenheer (HTML5test)">info</who>
    <bug_when>2016-06-04 23:47:24 -0700</bug_when>
    <thetext>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(&apos;success&apos;, arguments) }, function() { console.log(&apos;error&apos;, arguments) })

=&gt; error – Arguments [ Error: NotAllowedError: DOM Exception 35 ]


and:


!!navigator.getUserMedia

=&gt; 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&apos;m afraid I have to put this feature on a blacklist so that HTML5test.com won&apos;t show an inaccurate result.

The same thing applies to the prefixed webkitGetUserMedia function.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1199390</commentid>
    <comment_count>1</comment_count>
    <who name="Eric Carlson">eric.carlson</who>
    <bug_when>2016-06-05 10:42:49 -0700</bug_when>
    <thetext>(In reply to comment #0)
&gt; 
&gt; This is also a problem for HTML5test.com where Safari currently gets points
&gt; for supporting getUserMedia, without actually deserving so. I hope this is
&gt; an unfinished implementation that will be ready for the next release of
&gt; Safari, but if not, it should not be exposed publicly. Otherwise I&apos;m afraid
&gt; I have to put this feature on a blacklist so that HTML5test.com won&apos;t show
&gt; an inaccurate result.
&gt; 
&gt; The same thing applies to the prefixed webkitGetUserMedia function.

Are you testing with a WebKit nightly build, or with Safari Technology Preview?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1199395</commentid>
    <comment_count>2</comment_count>
    <who name="Niels Leenheer (HTML5test)">info</who>
    <bug_when>2016-06-05 11:04:31 -0700</bug_when>
    <thetext>Safari Technical Preview 5 (this issue has been present since Preview 1)</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1199396</commentid>
    <comment_count>3</comment_count>
    <who name="Niels Leenheer (HTML5test)">info</who>
    <bug_when>2016-06-05 11:08:55 -0700</bug_when>
    <thetext>Bug is also visible in WebKit Nightly r201698.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1199397</commentid>
    <comment_count>4</comment_count>
    <who name="Radar WebKit Bug Importer">webkit-bug-importer</who>
    <bug_when>2016-06-05 11:16:44 -0700</bug_when>
    <thetext>&lt;rdar://problem/26642259&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1206813</commentid>
    <comment_count>5</comment_count>
      <attachid>282457</attachid>
    <who name="Eric Carlson">eric.carlson</who>
    <bug_when>2016-06-30 12:38:56 -0700</bug_when>
    <thetext>Created attachment 282457
Proposed patch.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1206816</commentid>
    <comment_count>6</comment_count>
    <who name="WebKit Commit Bot">commit-queue</who>
    <bug_when>2016-06-30 12:40:53 -0700</bug_when>
    <thetext>Attachment 282457 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.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1206819</commentid>
    <comment_count>7</comment_count>
      <attachid>282457</attachid>
    <who name="Dean Jackson">dino</who>
    <bug_when>2016-06-30 12:57:23 -0700</bug_when>
    <thetext>Comment on attachment 282457
Proposed patch.

View in context: https://bugs.webkit.org/attachment.cgi?id=282457&amp;action=review

&gt; Source/WebCore/bindings/generic/RuntimeEnabledFeatures.cpp:72
&gt;  #if ENABLE(MEDIA_STREAM)

Maybe this should be #if ENABLE(MEDIA_STREAM) &amp;&amp; PLATFORM(COCOA) ?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1206820</commentid>
    <comment_count>8</comment_count>
      <attachid>282457</attachid>
    <who name="Dean Jackson">dino</who>
    <bug_when>2016-06-30 12:57:57 -0700</bug_when>
    <thetext>Comment on attachment 282457
Proposed patch.

View in context: https://bugs.webkit.org/attachment.cgi?id=282457&amp;action=review

&gt;&gt; Source/WebCore/bindings/generic/RuntimeEnabledFeatures.cpp:72
&gt;&gt;  #if ENABLE(MEDIA_STREAM)
&gt; 
&gt; Maybe this should be #if ENABLE(MEDIA_STREAM) &amp;&amp; PLATFORM(COCOA) ?

Oops. I meant !PLATFORM(COCOA) :)</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1206833</commentid>
    <comment_count>9</comment_count>
      <attachid>282460</attachid>
    <who name="Eric Carlson">eric.carlson</who>
    <bug_when>2016-06-30 13:39:14 -0700</bug_when>
    <thetext>Created attachment 282460
Patch for landing.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1206854</commentid>
    <comment_count>10</comment_count>
      <attachid>282460</attachid>
    <who name="WebKit Commit Bot">commit-queue</who>
    <bug_when>2016-06-30 14:20:52 -0700</bug_when>
    <thetext>Comment on attachment 282460
Patch for landing.

Clearing flags on attachment: 282460

Committed r202704: &lt;http://trac.webkit.org/changeset/202704&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1213344</commentid>
    <comment_count>11</comment_count>
    <who name="Niels Leenheer (HTML5test)">info</who>
    <bug_when>2016-07-21 14:50:38 -0700</bug_when>
    <thetext>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) });

=&gt; Error: NotAllowedError: DOM Exception 35</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1573917</commentid>
    <comment_count>12</comment_count>
    <who name="Alexey Proskuryakov">ap</who>
    <bug_when>2019-09-24 17:30:42 -0700</bug_when>
    <thetext>&gt; Committed r202704: &lt;http://trac.webkit.org/changeset/202704&gt;

Moving to RESOLVED since this landed.</thetext>
  </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="1"
              isprivate="0"
          >
            <attachid>282457</attachid>
            <date>2016-06-30 12:38:56 -0700</date>
            <delta_ts>2016-06-30 13:24:02 -0700</delta_ts>
            <desc>Proposed patch.</desc>
            <filename>disable_patch_1.txt</filename>
            <type>text/plain</type>
            <size>1756</size>
            <attacher name="Eric Carlson">eric.carlson</attacher>
            
              <data encoding="base64">SW5kZXg6IFNvdXJjZS9XZWJDb3JlL0NoYW5nZUxvZwo9PT09PT09PT09PT09PT09PT09PT09PT09
PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09Ci0tLSBTb3VyY2UvV2Vi
Q29yZS9DaGFuZ2VMb2cJKHJldmlzaW9uIDIwMjY5MykKKysrIFNvdXJjZS9XZWJDb3JlL0NoYW5n
ZUxvZwkod29ya2luZyBjb3B5KQpAQCAtMSwzICsxLDE4IEBACisyMDE2LTA2LTMwICBFcmljIENh
cmxzb24gIDxlcmljLmNhcmxzb25AYXBwbGUuY29tPgorCisgICAgICAgIGdldFVzZXJNZWRpYSgp
IGV4cG9zZWQsIGJ1dCBub3QgZnVuY3Rpb25hbAorICAgICAgICBodHRwczovL2J1Z3Mud2Via2l0
Lm9yZy9zaG93X2J1Zy5jZ2k/aWQ9MTU4MzkzCisgICAgICAgIDxyZGFyOi8vcHJvYmxlbS8yNjY0
MjI1OT4KKworICAgICAgICBSZXZpZXdlZCBieSBOT0JPRFkgKE9PUFMhKS4KKyAgICAgICAgCisg
ICAgICAgIFNldCBkZWZhdWx0IHZhbHVlIG9mIHRoZSBNZWRpYSBTdHJlYW0gcnVudGltZSBmbGFn
IHRvIGZhbHNlIG9uIE1hYyBPUyBYIGFuZCBpT1MgdW50aWwgdGhlCisgICAgICAgIGJyb3dzZXIg
c3VwcG9ydCBpcyBpbiBwbGFjZS4KKworICAgICAgICAqIGJpbmRpbmdzL2dlbmVyaWMvUnVudGlt
ZUVuYWJsZWRGZWF0dXJlcy5jcHA6CisgICAgICAgIChXZWJDb3JlOjpSdW50aW1lRW5hYmxlZEZl
YXR1cmVzOjpSdW50aW1lRW5hYmxlZEZlYXR1cmVzKTogRGlzYWJsZSBtZWRpYSBzdHJlYW0gYnkg
ZGVmYXVsdAorICAgICAgICBvbiBNYWMgT1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ogI2lmIEVOQUJMRShNRURJQV9TVFJF
QU0pCi0gICAgLCBtX2lzTWVkaWFTdHJlYW1FbmFibGVkKHRydWUpCisgICAgLCBtX2lzTWVkaWFT
dHJlYW1FbmFibGVkKE1FRElBX1NUUkVBTV9FTkFCTEVEKQogI2VuZGlmCiAjaWYgRU5BQkxFKFdF
Ql9SVEMpCiAgICAgLCBtX2lzUGVlckNvbm5lY3Rpb25FbmFibGVkKHRydWUpCg==
</data>
<flag name="review"
          id="306263"
          type_id="1"
          status="+"
          setter="dino"
    />
          </attachment>
          <attachment
              isobsolete="0"
              ispatch="1"
              isprivate="0"
          >
            <attachid>282460</attachid>
            <date>2016-06-30 13:39:14 -0700</date>
            <delta_ts>2016-06-30 14:20:52 -0700</delta_ts>
            <desc>Patch for landing.</desc>
            <filename>disable_patch_2.txt</filename>
            <type>text/plain</type>
            <size>2106</size>
            <attacher name="Eric Carlson">eric.carlson</attacher>
            
              <data encoding="base64">SW5kZXg6IFNvdXJjZS9XZWJDb3JlL0NoYW5nZUxvZwo9PT09PT09PT09PT09PT09PT09PT09PT09
PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09Ci0tLSBTb3VyY2UvV2Vi
Q29yZS9DaGFuZ2VMb2cJKHJldmlzaW9uIDIwMjY5MykKKysrIFNvdXJjZS9XZWJDb3JlL0NoYW5n
ZUxvZwkod29ya2luZyBjb3B5KQpAQCAtMSwzICsxLDE5IEBACisyMDE2LTA2LTMwICBFcmljIENh
cmxzb24gIDxlcmljLmNhcmxzb25AYXBwbGUuY29tPgorCisgICAgICAgIGdldFVzZXJNZWRpYSgp
IGV4cG9zZWQsIGJ1dCBub3QgZnVuY3Rpb25hbAorICAgICAgICBodHRwczovL2J1Z3Mud2Via2l0
Lm9yZy9zaG93X2J1Zy5jZ2k/aWQ9MTU4MzkzCisgICAgICAgIDxyZGFyOi8vcHJvYmxlbS8yNjY0
MjI1OT4KKworICAgICAgICBSZXZpZXdlZCBieSBEZWFuIE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ShXRUJfUlRDKQogICAgIGJvb2wgbV9pc1BlZXJDb25uZWN0aW9uRW5hYmxlZDsK
</data>

          </attachment>
      

    </bug>

</bugzilla>