mirror of
https://github.com/signalwire/freeswitch.git
synced 2026-11-15 05:48:33 +00:00
FS-8087 #comment fix issue in camera selection on recovery, refactor to use localStorage, change res detection, reload on network change
This commit is contained in:
1 parent
5de2f7d7bd
commit
c1628690b6
4 files changed
+77
-42
No files matched your search
@@ -97,6 +97,7 @@ var iceTimer;
|
||||
|
||||
this.enabled = true;
|
||||
|
||||
|
||||
this.mediaData = {
|
||||
SDP: null,
|
||||
profile: {},
|
||||
@@ -352,10 +353,6 @@ var iceTimer;
|
||||
self.remoteSDP = params.sdp;
|
||||
console.debug("inbound sdp: ", params.sdp);
|
||||
|
||||
self.options.useCamera = params.useCamera || "any";
|
||||
self.options.useMic = params.useMic || "any";
|
||||
self.options.useSpeak = params.useSpeak || "any";
|
||||
|
||||
function onSuccess(stream) {
|
||||
self.localStream = stream;
|
||||
|
||||
@@ -1052,6 +1049,9 @@ var iceTimer;
|
||||
'validRes': $.FSRTC.validRes,
|
||||
'bestResSupported': $.FSRTC.bestResSupported()
|
||||
};
|
||||
|
||||
localStorage.setItem("res_" + cam, $.toJSON(res));
|
||||
|
||||
if (func) return func(res);
|
||||
return;
|
||||
}
|
||||
@@ -1096,6 +1096,14 @@ var iceTimer;
|
||||
|
||||
$.FSRTC.getValidRes = function (cam, func) {
|
||||
var used = [];
|
||||
var cached = localStorage.getItem("res_" + cam);
|
||||
|
||||
if (cached) {
|
||||
$.FSRTC.validRes = $.parseJSON(cached);
|
||||
console.log("CACHED RES FOR CAM " + cam, $.FSRTC.validRes);
|
||||
return func ? func() : null;
|
||||
}
|
||||
|
||||
|
||||
$.FSRTC.validRes = [];
|
||||
resI = 0;
|
||||
|
||||
Reference in new issue
Block a user