Video Gravity 视频播放时的拉伸方式

Video Gravity 视频播放时的拉伸方式



Video Gravity 视频播放时的拉伸方式

Video Gravity 视频播放时的拉伸方式

AVLayerVideoGravityResize,       // 非均匀模式。两个维度完全填充至整个视图区域

AVLayerVideoGravityResizeAspect,  // 等比例填充,直到一个维度到达区域边界

AVLayerVideoGravityResizeAspectFill, // 等比例填充,直到填充满整个视图区域,其中一个维度的部分区域会被裁剪


aspect ratio 纵横比,屏幕高宽比; 宽高比


AVLayerVideoGravityResize

Specifies that the video should be stretched to fill the layers bounds.

Available in iOS 4.0 and later.

Declared in AVAnimation.h.


AVLayerVideoGravityResizeAspect

Specifies that the player should preserve the videos aspect ratio and fit the video within the layers bounds.

Available in iOS 4.0 and later.

Declared in AVAnimation.h.


AVLayerVideoGravityResizeAspectFill

Specifies that the player should preserve the videos aspect ratio and fill the layers bounds.

Available in iOS 4.0 and later.

Declared in AVAnimation.h.