我添加了来自 cdn "// media.twiliocdn.com/sdk/js/video/releases/1.14.1/twilio-video.min.js" 的 twilio 视频 js 文件
我试图添加 adepter.js 但似乎同样的错误。
Twilio.Video.createLocalTracks({
audio: true,
video: { width: 300 }
}).then(function(localTracks) {
return Twilio.Video.connect('{!! $accessToken !!}', {
name: '{{ $roomName }}',
tracks: localTracks,
video: { width: 300 }
});
}).then(function(room) {
console.log('Successfully joined a Room: ', room.name);
room.participants.forEach(participantConnected);
var previewContainer = document.getElementById(room.localParticipant.sid);
if (!previewContainer || !previewContainer.querySelector('video')) {
participantConnected(room.localParticipant);
}
room.on('participantConnected', function(participant) {
console.log("Joining: '" + participant.identity + "'");
participantConnected(participant);
});
room.on('participantDisconnected', function(participant) {
console.log(participant);
console.log("Disconnected: '" + participant.identity + "'");
participantDisconnected(participant,room);
});
});
总是得到:- 调用 getUserMedia 失败:DOMException