Firefoxのビデオチャットは正常ですが、Google Chromeではメディアデバイスが有効になっていません。 コード:Google Chrome twilioビデオチャットの問題
local.phpファイル
<div id="remote" style="display:inline-block;"></div>
<div id="local" style="display:inline-block;"></div>
<script src="https://media.twiliocdn.com/sdk/js/common/v0.1/twilio-common.min.js"></script>
<script src="https://media.twiliocdn.com/sdk/js/conversations/v0.13/twilio-conversations.min.js"></script>
<script src="inviteAccepted1.js"></script>
<script>
var accessToken = "Token from twilio";
var accessManager = Twilio.AccessManager(accessToken);
var client = Twilio.Conversations.Client(accessManager);
// Begin listening for invites to Twilio Video conversations.
client.listen().then(function() {
client.on('invite', function(invite) {
invite.accept().then(onInviteAccepted);
});
});
</script>
remote.php
<div id="remote" style="display:inline-block;"></div>
<div id="local" style="display:inline-block;"></div>
<script src="https://media.twiliocdn.com/sdk/js/common/v0.1/twilio-common.min.js"></script>
<script src="https://media.twiliocdn.com/sdk/js/conversations/v0.13/twilio-conversations.min.js"></script>
<script src="inviteAccepted1.js"></script>
<script>
var otheruser = "local username";
var accessToken = "Token from twilio";
var accessManager = new Twilio.AccessManager(accessToken);
var client = new Twilio.Conversations.Client(accessManager);
client.inviteToConversation(otheruser).then(onInviteAccepted);
</script>
inviteAccepted1.js
function conversationStarted(conversation) {
// Here is where you add your own custom functionality.
console.log('The conversation has started.');
}
function onInviteAccepted(conversation) {
conversation.localMedia.attach('#local');
conversation.on('participantConnected', function(participant) {
participant.media.attach('#remote');
conversationStarted(conversation);
});
}
に続きhttps://www.twilio.com/blog/2016/03/chrome-vs-firefox-webrtc-stats-api-with-twilio-video.html記事ですが会話です._対話が定義されていませんエラーです。