PlayerView

@objc
public class PlayerView : UIView

A simple UIView subclass that is backed by an AVPlayerLayer layer.

  • Undocumented

    Declaration

    Swift

    override public static var layerClass: AnyClass { get }
  • adds the player view as a subview to the container view and sets up constraints

    Declaration

    Swift

    @objc
    public func add(toContainer container: UIView)
  • creates a new PlayerView instance and connects it to the player

    Important

    make sure to keep strong reference for the player view instance (either from adding as subview or property), otherwise it will be deallocated as the framework holds a weak reference to it

    Declaration

    Swift

    @objc
    public static func createPlayerView(forPlayer player: Player) -> PlayerView