UZPlayer
open class UZPlayer: UIView, UZPlayerLayerViewDelegate, UZPlayerControlViewDelegate
Undocumented
-
Undocumented
Declaration
Swift
open weak var delegate: UZPlayerDelegate?
-
Undocumented
Declaration
Swift
open var backBlock:((Bool) -> Void)?
-
Undocumented
Declaration
Swift
open var videoChangedBlock:((UZVideoItem) -> Void)?
-
Undocumented
Declaration
Swift
open var fullscreenBlock:((Bool) -> Void)?
-
Undocumented
Declaration
Swift
open var buttonSelectionBlock:((UIButton) -> Void)?
-
Undocumented
Declaration
Swift
open var playTimeDidChange:((TimeInterval, TimeInterval) -> Void)?
-
Undocumented
Declaration
Swift
open var playStateDidChange:((Bool) -> Void)?
-
Undocumented
Declaration
Swift
open var videoGravity = AVLayerVideoGravity.resizeAspect
-
Undocumented
Declaration
Swift
open var aspectRatio:UZPlayerAspectRatio = .default
-
Undocumented
Declaration
Swift
open var isPlaying: Bool
-
Undocumented
Declaration
Swift
open var avPlayer: AVPlayer?
-
Undocumented
Declaration
Swift
open var subtitleOptions: [AVMediaSelectionOption]?
-
Undocumented
Declaration
Swift
open var audioOptions: [AVMediaSelectionOption]?
-
Undocumented
Declaration
Swift
open var playlist: [UZVideoItem]? = nil
-
Undocumented
Declaration
Swift
public var currentVideoIndex: Int
-
Undocumented
Declaration
Swift
public fileprivate(set) var currentVideo: UZVideoItem?
-
Undocumented
Declaration
Swift
public fileprivate(set) var currentLinkPlay: UZVideoLinkPlay?
-
Undocumented
Declaration
Swift
public var themeConfig: UZThemeConfig? = nil
-
Undocumented
Declaration
Swift
open var shouldAutoPlay = true
-
Undocumented
Declaration
Swift
open var shouldShowsControlViewAfterStoppingPiP = true
-
Undocumented
Declaration
Swift
open var autoTryNextDefinitionIfError = true
-
Undocumented
Declaration
Swift
open var controlView: UZPlayerControlView!
-
Undocumented
Declaration
Swift
public fileprivate(set) var resource: UZPlayerResource!
-
Undocumented
Declaration
Swift
public fileprivate(set) var currentDefinition = 0
-
Undocumented
Declaration
Swift
public fileprivate(set) var playerLayer: UZPlayerLayerView?
-
Undocumented
Declaration
Swift
open var customControlView: UZPlayerControlView?
-
Undocumented
Declaration
Swift
public fileprivate(set) var totalDuration : TimeInterval = 0
-
Undocumented
Declaration
Swift
public fileprivate(set) var currentPosition : TimeInterval = 0
-
Undocumented
Declaration
Swift
public fileprivate(set) var isURLSet = false
-
Undocumented
Declaration
Swift
public fileprivate(set) var isSliderSliding = false
-
Undocumented
Declaration
Swift
public fileprivate(set) var isPauseByUser = false
-
Undocumented
Declaration
Swift
public fileprivate(set) var isPlayToTheEnd = false
-
Undocumented
Declaration
Swift
public fileprivate(set) var isReplaying = false
-
Undocumented
Declaration
Swift
public internal(set) var pictureInPictureController: AVPictureInPictureController?
-
Load and play a videoId
Declaration
Swift
open func loadVideo(entityId: String, completionBlock:((_ linkPlays: [UZVideoLinkPlay]?, _ error: Error?) -> Void)? = nil)
Parameters
entityId
id
of videocompletionBlock
callback block with
[UZVideoLinkPlay]
or Error -
Play an
UZVideoItem
Declaration
Swift
open func loadVideo(_ video: UZVideoItem, completionBlock:((_ linkPlays: [UZVideoLinkPlay]?, _ error: Error?) -> Void)? = nil)
Parameters
video
UZVideoItem
completionBlock
callback block with
[UZVideoLinkPlay]
or Error -
Load and play a playlist
Declaration
Swift
open func loadPlaylist(metadataId: String, page: Int = 0, limit: Int = 20, playIndex: Int = 0, completionBlock:((_ playlist: [UZVideoItem]?, _ pagination: UZPagination, _ error: Error?) -> Void)? = nil)
Parameters
metadataId
playlist id
page
pagination, start from 0
limit
limit item
playIndex
index of item to start playing, set -1 to disable auto start
completionBlock
callback block with
[UZVideoItem]
, pagination info, or Error -
Undocumented
Declaration
Swift
open func loadConfigId(configId: String, completionBlock: ((UZThemeConfig?, Error?) -> Void)? = nil)
-
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
-
Undocumented
Declaration
Swift
open func playIfApplicable()
-
Undocumented
Declaration
Swift
open func play()
-
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 -
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(allowAutoPlay allow: Bool = false)
Parameters
allow
should allow to response
autoPlay
function -
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 nextVideo()
-
Undocumented
Declaration
Swift
open func previousVideo()
-
Undocumented
Declaration
Swift
open func togglePiP()
-
Undocumented
Declaration
Swift
open func switchVideoDefinition(_ linkplay: UZVideoLinkPlay)
-
Undocumented
Declaration
Swift
public init()
-
Undocumented
Declaration
Swift
public required init?(coder aDecoder: NSCoder)
-
Undocumented
Declaration
Swift
public convenience init (customControlView: UZPlayerControlView?)
-
Undocumented
Declaration
Swift
override open func layoutSubviews()
-
Undocumented
Declaration
Swift
open func showShare(from view: UIView)
-
Undocumented
Declaration
Swift
open func showRelates()
-
Undocumented
Declaration
Swift
open func showPlaylist()
-
Undocumented
Declaration
Swift
open func showQualitySelector()
-
Undocumented
Declaration
Swift
open func showMediaOptionSelector()
-
Undocumented
Declaration
Swift
@objc open func showAirPlayDevicesSelection()
-
Undocumented
Declaration
Swift
open func showCastingDeviceList()
-
Undocumented
Declaration
Swift
override open func observeValue(forKeyPath keyPath: String?, of object: Any?, change: [NSKeyValueChangeKey : Any]?, context: UnsafeMutableRawPointer?)
-
Undocumented
Declaration
Swift
open func UZPlayer(player: UZPlayerLayerView, playerIsPlaying playing: Bool)
-
Undocumented
Declaration
Swift
open func UZPlayer(player: UZPlayerLayerView ,loadedTimeDidChange loadedDuration: TimeInterval , totalDuration: TimeInterval)
-
Undocumented
Declaration
Swift
open func UZPlayer(player: UZPlayerLayerView, playerStateDidChange state: UZPlayerState)
-
Undocumented
Declaration
Swift
open func UZPlayer(player: UZPlayerLayerView, playTimeDidChange currentTime: TimeInterval, totalTime: TimeInterval)
-
Undocumented
Declaration
Swift
open func controlView(controlView: UZPlayerControlView, didChooseDefinition index: Int)
-
Undocumented
Declaration
Swift
open func controlView(controlView: UZPlayerControlView, didSelectButton button: UIButton)
-
Undocumented
Declaration
Swift
open func controlView(controlView: UZPlayerControlView, slider: UISlider, onSliderEvent event: UIControlEvents)
-
Undocumented
Declaration
Swift
open func pictureInPictureControllerWillStartPictureInPicture(_ pictureInPictureController: AVPictureInPictureController)
-
Undocumented
Declaration
Swift
open func pictureInPictureControllerDidStartPictureInPicture(_ pictureInPictureController: AVPictureInPictureController)
-
Undocumented
Declaration
Swift
open func pictureInPictureControllerDidStopPictureInPicture(_ pictureInPictureController: AVPictureInPictureController)
-
Undocumented
Declaration
Swift
public func adsLoader(_ loader: IMAAdsLoader!, adsLoadedWith adsLoadedData: IMAAdsLoadedData!)
-
Undocumented
Declaration
Swift
public func adsLoader(_ loader: IMAAdsLoader!, failedWith adErrorData: IMAAdLoadingErrorData!)
-
Undocumented
Declaration
Swift
public func adsManager(_ adsManager: IMAAdsManager!, didReceive event: IMAAdEvent!)
-
Undocumented
Declaration
Swift
public func adsManager(_ adsManager: IMAAdsManager!, didReceive error: IMAAdError!)
-
Undocumented
Declaration
Swift
public func adsManagerDidRequestContentPause(_ adsManager: IMAAdsManager!)
-
Undocumented
Declaration
Swift
public func adsManagerDidRequestContentResume(_ adsManager: IMAAdsManager!)