提交 052fed5f authored 作者: Anthony Minessale's avatar Anthony Minessale

FS-8181 #resolve [Verto check for camera perms fails init when no camera is present]

上级 0c6db6af
......@@ -1089,14 +1089,25 @@
checkRes(cam, func);
}
$.FSRTC.checkPerms = function (runtime) {
$.FSRTC.checkPerms = function (runtime, check_audio, check_video) {
getUserMedia({
constraints: {
audio: true,
video: true,
audio: check_audio,
video: check_video,
},
onsuccess: function(e) {e.stop(); console.info("media perm init complete"); if (runtime) {setTimeout(runtime, 100, true)}},
onerror: function(e) {console.error("media perm init error"); if (runtime) {runtime(false)}}
onerror: function(e) {
if (check_video && check_audio) {
console.error("error, retesting with audio params only");
return $.FSRTC.checkPerms(runtime, check_audio, false);
}
console.error("media perm init error");
if (runtime) {
runtime(false)
}
}
});
}
......
......@@ -2602,7 +2602,7 @@
$.verto.init = function(obj, runtime) {
$.FSRTC.checkPerms(function() {
checkDevices(runtime);
});
}, true, true);
}
$.verto.genUUID = function () {
......
This diff was suppressed by a .gitattributes entry.
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论