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

This commit is contained in:
Anthony Minessale
2015-09-17 15:09:19 -05:00
parent 0c6db6af06
commit 052fed5fc3
3 changed files with 19 additions and 7 deletions

View File

@@ -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)
}
}
});
}

View File

@@ -2602,7 +2602,7 @@
$.verto.init = function(obj, runtime) {
$.FSRTC.checkPerms(function() {
checkDevices(runtime);
});
}, true, true);
}
$.verto.genUUID = function () {