]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
FS-11284: Fix legacy/broken video constraints for specifying a video deviceId
authorChad Phillips <chad@apartmentlines.com>
Thu, 26 Jul 2018 19:36:02 +0000 (14:36 -0500)
committerChad Phillips <chad@apartmentlines.com>
Thu, 26 Jul 2018 19:36:02 +0000 (14:36 -0500)
getMediaParams() was using a legacy version of the video constraint param to
specify a deviceId.

checkRes() was incorrectly setting video constraints such that it was not
properly testing specific video devices.

html5/verto/js/src/jquery.FSRTC.js

index c2ea803d0bc232478cc884ddf5eb0560a20714ba..5210db3081a4d9ded9b35d6147819db05e099c14 100644 (file)
                
                if (obj.options.useCamera !== "any") {
                    //video.optional.push({sourceId: obj.options.useCamera});
-                   video.deviceId = obj.options.useCamera;
+        video.deviceId = {
+          exact: obj.options.useCamera,
+        };
                }
 
                if (bestFrameRate) {
            return;
        }
 
-       var video = {
-            //mandatory: {},
-            //optional: []
-        }      
-       //FIXME
-       if (cam) {
-           //video.optional = [{sourceId: cam}];
-           video.deviceId = {exact: cam};
-       }
-       
        w = resList[resI][0];
        h = resList[resI][1];
        resI++;
 
-       video = {
+       var video = {
            width: {exact: w},
            height: {exact: h}
-           //"minWidth": w,
-           //"minHeight": h,
-           //"maxWidth": w,
-           //"maxHeight": h
        };
 
+  if (cam !== "any") {
+    video.deviceId = {
+      exact: cam,
+    };
+  }
+
        getUserMedia({
            constraints: {
                 audio: ttl++ == 0,