Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Works on Desktop, but not in Chrome on Android or Safari on iOS #97

Closed
mark0978 opened this issue Nov 30, 2019 · 4 comments · May be fixed by #98
Closed

Works on Desktop, but not in Chrome on Android or Safari on iOS #97

mark0978 opened this issue Nov 30, 2019 · 4 comments · May be fixed by #98

Comments

@mark0978
Copy link

More details can be found here, but the gist is in the title.

https://stackoverflow.com/questions/59113357/why-does-twilio-video-fail-on-chrome-and-safari-on-ipad-and-android

I'm using the JS quickstart for video that has the code located here https://github.com/twilio/video-quickstart-js . The rest of the app works, but trying to preview the video gives a failure on all the mobile platforms.

The example at https://mdn-samples.mozilla.org/s/webrtc-capturestill/ works as expected in Chrome on Android and Safari on iOS, so this looks like it has to be a Twilio bug.

The error is "Unable to access Camera and Microphone" which is coming from here:

// Preview LocalParticipant's Tracks.
document.getElementById('button-preview').onclick = function() {
  var localTracksPromise = previewTracks
    ? Promise.resolve(previewTracks)
    : Video.createLocalTracks();

  localTracksPromise.then(function(tracks) {
    window.previewTracks = previewTracks = tracks;
    var previewContainer = document.getElementById('local-media');
    if (!previewContainer.querySelector('video')) {
      attachTracks(tracks, previewContainer);
    }
  }, function(error) {
    console.error('Unable to access local media', error);
    log('Unable to access Camera and Microphone');
  });
};
@mark0978
Copy link
Author

Also tried it with "twilio-video": "2.0.0-beta15" and while it takes longer, it still fails. It never prompts for permission to use the camera either if that helps.

@makarandp0
Copy link
Contributor

Hello @mark0978, Thank you for writing about this issue.

These samples should work on mobile devices. They works fine on my iPad (13.1.3)
Couple of things to verify:

  1. How are you accessing the quick-start from mobile devices? Are you using it from http or https endpoint? media permissions do require secure endpoint.
  2. Please check if the camera / microphone permissions are not denied for the endpoint you are accessing from. Settings -> Safari -> Settings for WebSites ->Camera/Microphone

Also please checkout https://github.com/twilio/video-quickstart-js/blob/master/examples/mediadevices/src/helpers.js
This sample better demonstrates accessing media on mobile devices.

Let me know If this helps,
Thanks,
Makarand
JSDK Team

@mark0978 mark0978 mentioned this issue Dec 2, 2019
@amebrahimi
Copy link

@mark0978 Hello, Is your server on https or Http? if it is on Http this is the solution. https://stackoverflow.com/questions/34197653/getusermedia-in-chrome-47-without-using-https

@manjeshbhargav
Copy link
Collaborator

@mark0978 ,

I'm going to close this issue now. Please feel free to reopen if the above suggestions do not help you out or you need further clarifications.

Thanks,

Manjesh Malavalli
JSDK Team

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants