Safari WebRTC support in IOS 11

Viewed 1498

We have an application developed using WebRTC in iOS 11, and it says it supports WebRTC but the application is not working in Safari on iOS 11. Is there anything required to do from our end to support this on the Safari browser? Do we have to make any changes in the script? Please help.

2 Answers

Did you got the last adapter.js that assume the browser compatibility ?

Regards

Here is a sample code that worked for me

// create video element first 
var video = document.createElement('video');
video.style.width = document.width + 'px';
video.style.height = document.height + 'px';
video.setAttribute('autoplay', '');
video.setAttribute('muted', '');
video.setAttribute('playsinline', '');
document.body.appendChild(video);

 //setup your constraints 
  constraints = {
     audio: false,
     video: {
       facingMode: front
      }
   }

  //ask navigator to allow access 
 navigator.mediaDevices.getUserMedia(constraints).then(function 
 success(stream) {
   video.srcObject = stream; 
 });
});
Related