VideoRenderView

public class VideoRenderView : UIView

A UIView subclass that displays the video content of an AVPlayer object associated with a HighlightVideoPlayer.

This view contains AVPlayerLayer that is connected to the video player. To initialize the view, you need to provide a HighlightVideoPlayer object or you can set it later with the player property.

Note

uses AVSynchronizedLayer to sync video and animation that is used to follow the player
  • The video player that is used to play the video.

    Declaration

    Swift

    public var player: HighlightVideoPlayer? { get set }
  • Undocumented

    Declaration

    Swift

    public override init(frame: CGRect)
  • Initialize the view with the given player.

    Declaration

    Swift

    public convenience init(player: HighlightVideoPlayer)
  • Undocumented

    Declaration

    Swift

    public required init?(coder: NSCoder)
  • Undocumented

    Declaration

    Swift

    public override func layoutSubviews()
  • Sets up a sync layer that will sync video and animation that is used to follow the player

    Call this method when HighlightVideoPlayer starts to play the video. Can be connected to onPlayerItemChange callback of HighlightVideoPlayer.

     player?.onPlayerItemChange = { _, item, obj in
         if let item = item, let obj = obj {
               videoView.setupSyncLayer(item: item, highlight: obj)
           }
       }
    

    Declaration

    Swift

    public func setupSyncLayer(item: AVPlayerItem, highlight obj: HighlightObject)