如何保持图像尺寸'在previewLayer中类似于iPhone上的相机应用程序?
目前我的AVCaptureVideoPreviewLayer正在将捕捉会话中的帧呈现为预览图层的矩形大小。我的预览图层尺寸非常小,所以我想保持与iPhone相机应用程序相同的比例尺,并查看在预览图层范围内可以看到图像的任何部分 - 实际上与构建的图像尺寸相同在相机应用程序,但具有较小的视野。
我已经尝试将预览图层的内容设置为.resizeAspectFill,但它仍然只适合视频输出到帧。我也试图改变videoScaleAndCropFactor和AVCaptureDevice的videoZoomFactor但没有成功。
var rgx = /\b(\w{6})(?=","RfKey":)/g;
var str = `{"RfReceived":{"Sync":9480,"Low":310,"High":950,"Data":"A8OP2B","RfKey":"None"}},{"RfReceived":{"Sync":8080,"Low":102,"High":1200,"Data":"PFN07U","RfKey":"None"}},{"RfReceived":{"Sync":7580,"Low":471,"High":360,"Data":"XU89OM","RfKey":"None"}}`;
var res = str.match(rgx);
console.log(res);