はじめまして、プログラミング初心者のコージです。今回はデバイス選択通話機能を実装するうえで苦労したOverconstrainedError Deviceidの解決方法を忘備録として残しておきます。
苦労したとはいってもコードの改変はたった1行です笑
call.js
let audioId = $('#audioSource').val();
let videoId = $('#videoSource').val();
let constraints = {
audio: {deviceId: {exact: audioSource}}, <-ここの記述を変更
video: {deviceId: {exact: videoSource}}
call.js
let audioId = $('#audioSource').val();
let videoId = $('#videoSource').val();
let constraints = {
audio: {
deviceId: audioId <-exactを削除
},
video: {
deviceId: videoId <-exactを削除
}
まさかこれだけで3日苦しんだエラーが解決するとは、、、😭
Chromeでこの形式で指定できるようになったのはごく最近らしいです。上が以前の指定形式らしい。
古いから制約に引っ掛かるのかな?
全てのコードを見たい方はgithubのapp->javascriptからどうぞ
ビデオ通話機能を実装したwebアプリケーションのコード: circlefriends
以上
twitter: @siron_www 日常のこともつぶやいてるので友達感覚でフォローしてください😁