Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
488 views
in Technique[技术] by (71.8m points)

javascript - Twilio视频在Android上的Chrome浏览器和iOS上的Safari浏览器中失败,可在台式机上使用(Twilio video fails in Chrome on Android and Safari on iOS, works on desktop)

The support matrix seems to say it should be supported:

(支持矩阵似乎说应该得到支持:)

支持矩阵图形 https://www.twilio.com/docs/video/javascript#supported-browsers

(https://www.twilio.com/docs/video/javascript#supported-browsers)

I can't find that it is NOT supported, but what works on my desktop is not working on any of 3 mobile devices.

(我找不到它不受支持的功能,但是在我的台式机上运行的内容在任何3种移动设备上均无效。)

I'm using the JS quickstart for video that has the code located here https://github.com/twilio/video-quickstart-js .

(我正在为视频使用JS快速入门,其代码位于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.

(https://mdn-samples.mozilla.org/s/webrtc-capturestill/上的示例可以在Android上的Chrome浏览器和iOS上的Safari上正常运行,因此,看起来好像是Twilio错误。)

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');
  });
};
  ask by boatcoder translate from so

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)
等待大神答复

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...