我有此配置文件:
_sampleBufferLayer = [[AVSampleBufferDisplayLayer alloc] init];
_sampleBufferLayer.videoGravity = AVLayerVideoGravityResizeAspect;
[videoArea.layer addSublayer:_sampleBufferLayer];
和
- (IBAction)changeAspectRatio:(UIButton *)sender {
NSLog(@"Ratio Button tapped;");
_sampleBufferLayer.videoGravity = AVLayerVideoGravityResizeAspectFill;
[videoArea layoutIfNeeded];
[videoArea setNeedsLayout];
}
它应该立即更改视频重力,但它什么也没做。有帮助吗?