]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
FS-10139: [verto.js] $.FSRTC.bestResSupported() returns true for any res #resolve
authorBrian West <brian@freeswitch.org>
Thu, 16 Mar 2017 15:37:31 +0000 (10:37 -0500)
committerMike Jerris <mike@jerris.com>
Mon, 20 Mar 2017 21:48:22 +0000 (16:48 -0500)
Conflicts:
html5/verto/video_demo/js/verto-min.js

html5/verto/js/src/jquery.FSRTC.js
html5/verto/video_demo/js/verto-min.js

index 15264c0dfb895a554c157b4b0eb116f6c0da2bc5..a094f9ace58570c9f0083ab6a15964dba7428554 100644 (file)
        resI++;
 
        video = {
-           width: w,
-           height: h
+           width: {exact: w},
+           height: {exact: h}
            //"minWidth": w,
            //"minHeight": h,
            //"maxWidth": w,
index 3ad08550a378a48a1d1ae3eed8ea8155b3d21b16..9de468c09b22d8b57a84e221a76ef4690d70d32f 100644 (file)
@@ -88,7 +88,7 @@ return[w,h];}
 var resList=[[160,120],[320,180],[320,240],[640,360],[640,480],[1280,720],[1920,1080]];var resI=0;var ttl=0;var checkRes=function(cam,func){if(resI>=resList.length){var res={'validRes':$.FSRTC.validRes,'bestResSupported':$.FSRTC.bestResSupported()};localStorage.setItem("res_"+cam,$.toJSON(res));if(func)return func(res);return;}
 var video={}
 if(cam){video.deviceId={exact:cam};}
-w=resList[resI][0];h=resList[resI][1];resI++;video={width:w,height:h};getUserMedia({constraints:{audio:ttl++==0,video:video},onsuccess:function(e){e.getTracks().forEach(function(track){track.stop();});console.info(w+"x"+h+" supported.");$.FSRTC.validRes.push([w,h]);checkRes(cam,func);},onerror:function(e){console.warn(w+"x"+h+" not supported.");checkRes(cam,func);}});}
+w=resList[resI][0];h=resList[resI][1];resI++;video={width:{exact:w},height:{exact:h}};getUserMedia({constraints:{audio:ttl++==0,video:video},onsuccess:function(e){e.getTracks().forEach(function(track){track.stop();});console.info(w+"x"+h+" supported.");$.FSRTC.validRes.push([w,h]);checkRes(cam,func);},onerror:function(e){console.warn(w+"x"+h+" not supported.");checkRes(cam,func);}});}
 $.FSRTC.getValidRes=function(cam,func){var used=[];var cached=localStorage.getItem("res_"+cam);if(cached){var cache=$.parseJSON(cached);if(cache){$.FSRTC.validRes=cache.validRes;console.log("CACHED RES FOR CAM "+cam,cache);}else{console.error("INVALID CACHE");}
 return func?func(cache):null;}
 $.FSRTC.validRes=[];resI=0;checkRes(cam,func);}