<?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>188360</bug_id>
          
          <creation_ts>2018-08-06 14:34:08 -0700</creation_ts>
          <short_desc>mediaDevices in WKWebview is undefined</short_desc>
          <delta_ts>2021-12-09 02:50:20 -0800</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WebKit</product>
          <component>WebRTC</component>
          <version>Other</version>
          <rep_platform>iPhone / iPad</rep_platform>
          <op_sys>Other</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>CONFIGURATION CHANGED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords>InRadar</keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Mike Hartington">mikehartington</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>alejandro.silva</cc>
    
    <cc>beidson</cc>
    
    <cc>bernie</cc>
    
    <cc>bill</cc>
    
    <cc>bugmail</cc>
    
    <cc>daginge</cc>
    
    <cc>eelco</cc>
    
    <cc>elitree</cc>
    
    <cc>eric.carlson</cc>
    
    <cc>feross</cc>
    
    <cc>flagworlds1</cc>
    
    <cc>jer.noble</cc>
    
    <cc>juliosincesar</cc>
    
    <cc>marcel</cc>
    
    <cc>molnar.timi7</cc>
    
    <cc>ramanaedwin</cc>
    
    <cc>shahraship</cc>
    
    <cc>silviapfeiffer1</cc>
    
    <cc>stefan</cc>
    
    <cc>tomac</cc>
    
    <cc>vitalyd87</cc>
    
    <cc>webkit-bug-importer</cc>
    
    <cc>webkit</cc>
    
    <cc>will.morgan</cc>
    
    <cc>wvsmlmdiaaxvhkrqov</cc>
    
    <cc>youennf</cc>
    
    <cc>znelson</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>1448249</commentid>
    <comment_count>0</comment_count>
    <who name="Mike Hartington">mikehartington</who>
    <bug_when>2018-08-06 14:34:08 -0700</bug_when>
    <thetext>Inside of WKWebview, mediaDevices and getUserMedia are not implemented, but are there in Webkit/Safari.


var videoTag = document.querySelector(&apos;video&apos;);
var getVideoStream = function() {
  navigator.mediaDevices
    .getUserMedia({ video: true })
    .then(streamRes =&gt; (videoTag.srcObject = streamRes));
};</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1582818</commentid>
    <comment_count>1</comment_count>
    <who name="jcesarmobile">juliosincesar</who>
    <bug_when>2019-10-23 08:36:59 -0700</bug_when>
    <thetext>Any plans on adding this? WKWebView apps are very limited without this kind of features that are already in Safari.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1582841</commentid>
    <comment_count>2</comment_count>
    <who name="Radar WebKit Bug Importer">webkit-bug-importer</who>
    <bug_when>2019-10-23 09:26:43 -0700</bug_when>
    <thetext>&lt;rdar://problem/56541639&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1620086</commentid>
    <comment_count>3</comment_count>
    <who name="Jerome @ Neareo">flagworlds1</who>
    <bug_when>2020-02-17 23:57:34 -0800</bug_when>
    <thetext>We have a html-based chatbot platform that requires a QR scanner. We urgently need WebRTC (getUserMedia) to work in apps using WKWebView.

I&apos;ve seen that SFSafariViewController is now working with iOS 13. Any plans to support getUserMedia in WKWebView ?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1623452</commentid>
    <comment_count>4</comment_count>
    <who name="Alejandro Silva">alejandro.silva</who>
    <bug_when>2020-02-27 07:00:11 -0800</bug_when>
    <thetext>Hi! I&apos;ve read something about getting released in iOS 13.4. Can you deny/confirm it? Thank you so much!</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1650074</commentid>
    <comment_count>5</comment_count>
    <who name="krak1">wvsmlmdiaaxvhkrqov</who>
    <bug_when>2020-05-07 06:53:45 -0700</bug_when>
    <thetext>I really don&apos;t like you apple. You don&apos;t deserve the number of customers you have. Fix it quickly!</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1651206</commentid>
    <comment_count>6</comment_count>
    <who name="zn">znelson</who>
    <bug_when>2020-05-11 01:24:32 -0700</bug_when>
    <thetext>I can’t even describe how infuriating it is that getUserMedia and thus WebRTC isn’t supported. So many things are much easier to implement in JavaScript when it comes to WebRTC instead of jumping through a million hoops in Obj-C and the garbage environment that is iOS native. Apple is ridiculous.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1651259</commentid>
    <comment_count>7</comment_count>
    <who name="Mike Hartington">mikehartington</who>
    <bug_when>2020-05-11 06:41:26 -0700</bug_when>
    <thetext>Let&apos;s keep comments professional and civil folks.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1674565</commentid>
    <comment_count>8</comment_count>
    <who name="Dag-Inge Aas">daginge</who>
    <bug_when>2020-07-24 01:44:27 -0700</bug_when>
    <thetext>With the advent of new default browsers in iOS 14, this will become a bigger UX problem for WebRTC services. I have tested iOS 14 Developer Beta 3, and neither Chrome nor Firefox can complete a simple getUserMedia call (fails with TypeError in samples).

Since users now can select these browsers as default, WebRTC services must implement specific UX to teach users how to copy the link, change to Safari, and open it in Safari for WebRTC to work.

Having support for getUserMedia/WebRTC in WKWebView is now critical for WebRTC as a whole on iOS. Users won&apos;t be able to understand why their default browser does not support WebRTC.

Are there any details to share on the timeline for support, or are there talks with browser vendors to avoid this problem? What should us application developers do?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1674862</commentid>
    <comment_count>9</comment_count>
    <who name="">molnar.timi7</who>
    <bug_when>2020-07-24 15:18:13 -0700</bug_when>
    <thetext>Finally there is a solution! Check this comment: https://bugs.webkit.org/show_bug.cgi?id=183201#c31

There is a brand new WebRTC library for WKWebView, and it works like a charm! https://github.com/OpenTelecom/WKWebViewRTC</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1675924</commentid>
    <comment_count>10</comment_count>
    <who name="Silvia Pfeiffer">silviapfeiffer1</who>
    <bug_when>2020-07-29 00:36:57 -0700</bug_when>
    <thetext>It would be really good to have WKWebView support getUserMedia for pwa - is getUserMedia functionality planned to be available for WKWebView?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1822033</commentid>
    <comment_count>11</comment_count>
    <who name="Vitalii">vitalyd87</who>
    <bug_when>2021-12-09 01:52:57 -0800</bug_when>
    <thetext>In Info.plist add:
`Privacy - Camera Usage Description`
https://developer.apple.com/documentation/avfoundation/cameras_and_media_capture/requesting_authorization_for_media_capture_on_ios

And in order video element could play from your camera:
```
let webConfiguration = WKWebViewConfiguration()
webConfiguration.allowsInlineMediaPlayback = true
```

How to play: https://developer.mozilla.org/en-US/docs/Web/API/MediaDevices/getUserMedia</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1822047</commentid>
    <comment_count>12</comment_count>
    <who name="youenn fablet">youennf</who>
    <bug_when>2021-12-09 02:50:20 -0800</bug_when>
    <thetext>Marking as configuration changed now that getUserMedia is exposed in WKWebView.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>