UZPlayer

open class UZPlayer : UIView
extension UZPlayer: UZPlayerControlViewDelegate
extension UZPlayer: AVPictureInPictureControllerDelegate

Undocumented

  • Undocumented

    Declaration

    Swift

    public static let ShowAirPlayDeviceListNotification: Notification.Name
  • Undocumented

    Declaration

    Swift

    open weak var delegate: UZPlayerDelegate?
  • Undocumented

    Declaration

    Swift

    public var backBlock: ((Bool) -> Void)?
  • Undocumented

    Declaration

    Swift

    public var videoChangedBlock: ((UZVideoItem) -> Void)?
  • Undocumented

    Declaration

    Swift

    public var fullscreenBlock: ((Bool) -> Void)?
  • Undocumented

    Declaration

    Swift

    public var buttonSelectionBlock: ((UIButton) -> Void)?
  • Undocumented

    Declaration

    Swift

    public var playTimeDidChange: ((TimeInterval, TimeInterval) -> Void)?
  • Undocumented

    Declaration

    Swift

    public var playStateDidChange: ((Bool) -> Void)?
  • Undocumented

    Declaration

    Swift

    public var videoGravity: AVLayerVideoGravity { get set }
  • Undocumented

    Declaration

    Swift

    public var aspectRatio: UZPlayerAspectRatio { get set }
  • Undocumented

    Declaration

    Swift

    public var isPlaying: Bool { get }
  • Undocumented

    Declaration

    Swift

    public var avPlayer: AVPlayer? { get }
  • Undocumented

    Declaration

    Swift

    public var subtitleOptions: [AVMediaSelectionOption]? { get }
  • Undocumented

    Declaration

    Swift

    public var audioOptions: [AVMediaSelectionOption]? { get }
  • Undocumented

    Declaration

    Swift

    public var playlist: [UZVideoItem]? { get set }
  • Undocumented

    Declaration

    Swift

    public var currentVideoIndex: Int { get set }
  • Undocumented

    Declaration

    Swift

    public internal(set) var currentVideo: UZVideoItem? { get set }
  • Undocumented

    Declaration

    Swift

    public internal(set) var currentLinkPlay: UZVideoLinkPlay?
  • Undocumented

    Declaration

    Swift

    public var themeConfig: UZPlayerConfig? { get set }
  • Undocumented

    Declaration

    Swift

    public var shouldAutoPlay: Bool
  • Undocumented

    Declaration

    Swift

    public var shouldShowsControlViewAfterStoppingPiP: Bool
  • Undocumented

    Declaration

    Swift

    public var autoTryNextDefinitionIfError: Bool
  • Undocumented

    Declaration

    Swift

    public var controlView: UZPlayerControlView!
  • Undocumented

    Declaration

    Swift

    public var liveEndedMessage: String
  • Undocumented

    Declaration

    Swift

    open var customControlView: UZPlayerControlView? { get set }
  • Undocumented

    Declaration

    Swift

    public var preferredForwardBufferDuration: TimeInterval { get set }
  • Undocumented

    Declaration

    Swift

    public internal(set) var resource: UZPlayerResource! { get set }
  • Undocumented

    Declaration

    Swift

    public internal(set) var currentDefinition: Int
  • Undocumented

    Declaration

    Swift

    public internal(set) var playerLayer: UZPlayerLayerView?
  • Undocumented

    Declaration

    Swift

    public internal(set) var totalDuration: TimeInterval
  • Undocumented

    Declaration

    Swift

    public internal(set) var currentPosition: TimeInterval
  • Undocumented

    Declaration

    Swift

    public internal(set) var isURLSet: Bool
  • Undocumented

    Declaration

    Swift

    public internal(set) var isSliderSliding: Bool
  • Undocumented

    Declaration

    Swift

    public internal(set) var isPauseByUser: Bool
  • Undocumented

    Declaration

    Swift

    public internal(set) var isPlayToTheEnd: Bool
  • Undocumented

    Declaration

    Swift

    public fileprivate(set) var isReplaying: Bool
  • Undocumented

    Declaration

    Swift

    public internal(set) var pictureInPictureController: AVPictureInPictureController? { get set }
  • Undocumented

    Declaration

    Swift

    public var autoPauseWhenInactive: Bool
  • Undocumented

    Declaration

    Swift

    public init()
  • Undocumented

    Declaration

    Swift

    public required init?(coder aDecoder: NSCoder)
  • Undocumented

    Declaration

    Swift

    public convenience init(customControlView: UZPlayerControlView?)
  • Play a video with given URL

    Declaration

    Swift

    open func loadVideo(url: URL, subtitleURLS: [URL]? = nil, isLive: Bool = false)

    Parameters

    url

    URL of linkplay

    subtitleURLs

    URLs of subtitle if any

    isLive

    set true if it is a live video

  • Play an UZVideoItem

    Declaration

    Swift

    open func loadVideo(_ video: UZVideoItem)

    Parameters

    video

    UZVideoItem

  • Undocumented

    Declaration

    Swift

    open func playIfApplicable()
  • Undocumented

    Declaration

    Swift

    open func play()
  • Stop and unload the player

    Declaration

    Swift

    open func stop()
  • Seek to 0.0 and replay the video

    Declaration

    Swift

    open func replay()
  • Pause

    Declaration

    Swift

    open func pause()
  • Seek to time

    Declaration

    Swift

    open func seek(to interval: TimeInterval, completion: (() -> Void)? = nil)

    Parameters

    to

    target time

  • Seek offset

    Declaration

    Swift

    open func seek(offset: TimeInterval, completion: (() -> Void)? = nil)

    Parameters

    offset

    offset from current time

  • Undocumented

    Declaration

    Swift

    open func switchVideoDefinition(_ linkplay: UZVideoLinkPlay)
  • Undocumented

    Declaration

    Swift

    public var isVisualizeInfoEnabled: Bool { get set }

Pip

  • Undocumented

    Declaration

    Swift

    open func togglePiP()

Events

Livestream

  • Undocumented

    Declaration

    Swift

    @objc
    open func loadLiveViews()
  • Undocumented

    Declaration

    Swift

    open func loadLiveStatus(after interval: TimeInterval = 0)
  • Undocumented

    Declaration

    Swift

    open func showLiveEndedMessage()
  • Seek to current time of live video

    Declaration

    Swift

    open func seekToLive()
  • Undocumented

    Declaration

    Swift

    public func getCurrentLatency() -> TimeInterval
  • Undocumented

    Declaration

    Swift

    open func nextVideo()
  • Undocumented

    Declaration

    Swift

    open func previousVideo()

Select media

  • Select subtitle track

    Declaration

    Swift

    open func selectSubtitle(index: Int?)

    Parameters

    index

    index of subtitle track, nil for turning off, -1 for default track

  • Select audio track

    Declaration

    Swift

    open func selectAudio(index: Int?)

    Parameters

    index

    index of audio track, nil for turning off, -1 for default audio track

  • Select media selection option

    Declaration

    Swift

    open func selectMediaOption(option: AVMediaCharacteristic, index: Int?)

    Parameters

    index

    index of media selection, nil for turning off, -1 for default option

KVO

  • Undocumented

    Declaration

    Swift

    override open func observeValue(forKeyPath keyPath: String?, of object: Any?, change: [NSKeyValueChangeKey : Any]?, context: UnsafeMutableRawPointer?)

Listener

  • Set video resource

    Declaration

    Swift

    open func setResource(resource: UZPlayerResource, definitionIndex: Int = 0)

    Parameters

    resource

    media resource

    definitionIndex

    starting definition index, default start with the first definition

Setup

  • Undocumented

    Declaration

    Swift

    override open func layoutSubviews()

Google cast

Show popup

UZPlayerControlViewDelegate

UZPlayerLayerViewDelegate

AVPictureInPictureControllerDelegate