javascript - iOS 11 getUserMedia not working? -


apple released statement getusermedia functional on ios 11. after installing ios 11 beta version 5, message website requests access camera , microphone, seems line:

video.src = window.url.createobjecturl(stream); 

or:

video.srcobject = stream; 

does not work. no errors, no exceptions, no picture phone's camera.

here's full script:

$(function () {      video = document.getelementbyid('vid');       navigator.getusermedia = navigator.getusermedia ||                               navigator.webkitgetusermedia ||                               navigator.mozgetusermedia;       navigator.getusermedia(      {          audio: true,          video: { facingmode: "user" }      }, function (stream) {          video.srcobject = stream;          //video.src = window.url.createobjecturl(stream);      },      function (err) {                     alert(err.name);      }); }); 

html:

<video id="vid" muted autoplay></video> 

has got working? ideas appreciated.

solved using following:

$(function () {     video = document.getelementbyid('vid');     video.style.width = document.width + 'px';     video.style.height = document.height + 'px';     video.setattribute('autoplay', '');     video.setattribute('muted', '');     video.setattribute('playsinline', '');      var facingmode = "user";     var constraints = {          audio: false,          video: {              facingmode: facingmode          }     }      navigator.mediadevices.getusermedia(constraints).then(function success(stream) {         video.srcobject = stream;     }); }); 

Comments

Popular posts from this blog

PHP and MySQL WP -

android - InAppBilling registering BroadcastReceiver in AndroidManifest -

go - golang pprof for c library code -