ResizeMode Enumeration

public enum ResizeMode : Equatable

Describes how video content is scaled to fit the player bounds.

This is a semantic, engine-agnostic abstraction over AVLayerVideoGravity.

  • fit

    Preserve the video’s aspect ratio and fit it within the bounds, adding black bars (letterbox/pillarbox) where the aspect ratios differ. Maps to AVLayerVideoGravity.resizeAspect.

    Declaration

    Swift

    case fit
  • Preserve the video’s aspect ratio and fill the bounds, cropping the overflowing edges. Maps to AVLayerVideoGravity.resizeAspectFill.

    Declaration

    Swift

    case fill
  • Stretch the video to fill the bounds, ignoring the aspect ratio. Maps to AVLayerVideoGravity.resize.

    Declaration

    Swift

    case stretch

ResizeMode

  • The AVLayerVideoGravity this resize mode corresponds to.

    Declaration

    Swift

    var videoGravity: AVLayerVideoGravity { get }
  • Creates a ResizeMode from an AVLayerVideoGravity. Any unrecognised gravity falls back to fit.

    Declaration

    Swift

    init(videoGravity: AVLayerVideoGravity)