IVSPlayerLayer

Objective-C


@interface IVSPlayerLayer : CALayer

Swift

class IVSPlayerLayer : CALayer

Displays the visual content from IVSPlayer.

  • Creates an instance of IVSPlayerLayer for the provided player instance.

    Declaration

    Objective-C

    + (nonnull instancetype)playerLayerWithPlayer:(nullable IVSPlayer *)player;

    Swift

    convenience init(player: IVSPlayer?)

    Parameters

    player

    An instance of IVSPlayer to associate with this layer

  • An instance of IVSPlayer that displays its visual output in this layer.

    This property is key-value observable.

    Declaration

    Objective-C

    @property (nonatomic, nullable) IVSPlayer *player;

    Swift

    var player: IVSPlayer? { get set }
  • A string constant describing how video is displayed within the layer bounds.

    See the definitions of AVLayerVideoGravity in for detailed descriptions of the available options.

    This property is key-value observable.

    Declaration

    Objective-C

    @property (nonatomic, copy) AVLayerVideoGravity _Nonnull videoGravity;

    Swift

    var videoGravity: AVLayerVideoGravity { get set }
  • The current size and position of the video image as displayed within this layer’s bounds. A value of CGRectZero indicates that no video is displayed.

    This property is key-value observable.

    Declaration

    Objective-C

    @property (nonatomic, readonly) CGRect videoRect;

    Swift

    var videoRect: CGRect { get }
  • Returns the pixel buffer of the most recently displayed frame. Can be used even when the player is in the playing state, unlike the AVPlayerLayer method of the same name. When a new source is loaded, the frames held by this API will be discarded. Therefore, only frames from the currently loaded source can be returned by this API.

    Declaration

    Objective-C

    - (nullable CVPixelBufferRef)copyDisplayedPixelBuffer;

    Swift

    func displayedPixelBuffer() -> Unmanaged<CVPixelBuffer>?