Browse Source

fix: let camera pick the best aspect ratio when applying sender video contraints

dev1
Jaya Allamsetty 5 years ago
parent
commit
4ce9b0c550
1 changed files with 2 additions and 5 deletions
  1. 2
    5
      modules/RTC/TraceablePeerConnection.js

+ 2
- 5
modules/RTC/TraceablePeerConnection.js View File

@@ -2181,15 +2181,12 @@ TraceablePeerConnection.prototype.setSenderVideoConstraint = function(frameHeigh
2181 2181
                 });
2182 2182
             });
2183 2183
     }
2184
-
2185
-    // Apply the height constraint on the local camera track
2186
-    const aspectRatio = (track.getSettings().width / track.getSettings().height).toPrecision(4);
2187
-
2188 2184
     logger.debug(`Setting max height of ${newHeight} on local video`);
2189 2185
 
2186
+    // Do not specify the aspect ratio, let camera pick
2187
+    // the best aspect ratio for the given height.
2190 2188
     return track.applyConstraints(
2191 2189
         {
2192
-            aspectRatio,
2193 2190
             height: {
2194 2191
                 ideal: newHeight
2195 2192
             }

Loading…
Cancel
Save