瀏覽代碼

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

dev1
Jaya Allamsetty 5 年之前
父節點
當前提交
4ce9b0c550
共有 1 個文件被更改,包括 2 次插入5 次删除
  1. 2
    5
      modules/RTC/TraceablePeerConnection.js

+ 2
- 5
modules/RTC/TraceablePeerConnection.js 查看文件

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
     logger.debug(`Setting max height of ${newHeight} on local video`);
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
     return track.applyConstraints(
2188
     return track.applyConstraints(
2191
         {
2189
         {
2192
-            aspectRatio,
2193
             height: {
2190
             height: {
2194
                 ideal: newHeight
2191
                 ideal: newHeight
2195
             }
2192
             }

Loading…
取消
儲存