mirror of
https://github.com/TencentCloud/TIMSDK.git
synced 2026-10-28 05:06:48 +08:00
34 lines
899 B
Objective-C
34 lines
899 B
Objective-C
|
|
#import "TUICaptureVideoPreviewView.h"
|
|
|
|
@implementation TUICaptureVideoPreviewView
|
|
|
|
- (instancetype)initWithFrame:(CGRect)frame
|
|
{
|
|
self = [super initWithFrame:frame];
|
|
if (self) {
|
|
[(AVCaptureVideoPreviewLayer *)self.layer setVideoGravity:AVLayerVideoGravityResizeAspectFill];
|
|
}
|
|
return self;
|
|
}
|
|
|
|
- (AVCaptureSession*)captureSessionsion {
|
|
return [(AVCaptureVideoPreviewLayer*)self.layer session];
|
|
}
|
|
|
|
- (void)setCaptureSessionsion:(AVCaptureSession *)session {
|
|
[(AVCaptureVideoPreviewLayer*)self.layer setSession:session];
|
|
}
|
|
|
|
- (CGPoint)captureDevicePointForPoint:(CGPoint)point {
|
|
AVCaptureVideoPreviewLayer *layer = (AVCaptureVideoPreviewLayer *)self.layer;
|
|
return [layer captureDevicePointOfInterestForPoint:point];
|
|
}
|
|
|
|
// 使该view的layer方法返回AVCaptureVideoPreviewLayer对象
|
|
+ (Class)layerClass {
|
|
return [AVCaptureVideoPreviewLayer class];
|
|
}
|
|
|
|
@end
|