Files
TIMSDK/iOS/TUIKit/TUIChat/UI/Base/Camera/TUICaptureVideoPreviewView.m
T

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