javascript - When mobile is rotated, width and height are swapped in get User Media Api JavaScript
问题描述
I´m using the camera git getUserMedia(), but I have a big issue, because, I just set the video and height to 1280 and 720:
videoConstraints.width = { min: 1280, ideal: 1280, max: 1280};
videoConstraints.height = { min: 720, ideal: 720, max: 720};
It works perfect in a computer, and in a phone too, but the width and height are swapped on mobile, I have to use the mobile on landscape mode, in portrait mode the height is 1280 and width 720, and when is in landscape is height 720 and width 1280 (as I want), so i was looking for information for this, but i really does not found a really solution.
Reference to get user media API: https://developer.mozilla.org/es/docs/Web/API/MediaDevices/getUserMedia
Reference to video constraints: https://developer.mozilla.org/en-US/docs/Web/API/MediaStreamConstraints/video
解决方案
所以,然后面对这个问题我没有发现问题,我所做的是使用媒体查询为样式移动制作自定义样式。
推荐阅读
- http - ApacheBench 仅使用“-race”标志从 Go 服务器获取“对等连接重置”
- sql - 用缺少的列值填充 postgres 表行
- javascript - 验证 Token JWT 是否有效
- python - Dask Dataframe - 每行多行
- java - Java:在 bash/命令行中从多个文件和包创建可执行文件
- python - 在 django 2.0.5 的 urls.py 中使用 path() 的问题
- android - 使用 Ionic Native BLE 向 BLE 外围设备发出写入值
- jenkins - Jenkins 插件“基于角色的策略”
- r - 结合第二个列表中的列表和元素,同时在 R 中保持名称
- python-3.x - 将多列融合到日期时间索引中