1
我手動創建AVCaptureVideoPreviewLayer(一類的CALayer)一旦AVCaptureSession開始運行,並增加它的UIView如下:AVCaptureVideoPreviewLayer自轉
func captureSessionStartedRunning(session:AVCaptureSession?) {
if let captureSession = session {
if let previewLayer = AVCaptureVideoPreviewLayer.init(session: captureSession) {
previewLayer.frame = self.view.bounds
self.view.layer.addSublayer(previewLayer)
previewLayer.videoGravity = AVLayerVideoGravityResizeAspectFill
}
}
}
我沒有經歷過與自轉與大小級,那麼有人可以告訴我什麼是在這裏處理自轉的最簡單方法嗎?