DorisAVPlayer
public class DorisAVPlayer : DorisPlayer
extension DorisAVPlayer: DorisBeaconsPluginOutput
AVPlayer wrapper with extras
-
audiosession route(airplay, headphones, builtInSpeaker, etc..)
Declaration
Swift
public var currentPlaybackReceiver: DorisPlaybackReceiver { get } -
mute player
Declaration
Swift
public var isMuted: Bool { get set } -
resume rate to apple when play() is called
Declaration
Swift
public var resumeRate: Double -
playback rate
Declaration
Swift
public var rate: Double { get set } -
playback rble(ate
Declaration
Swift
public var volume: Double { get set } -
Control PIP
Declaration
Swift
public var isPipEnabled: Bool { get set } -
Select desired bandwidthPolicy mode and threshold
Note
if connected to Cellular:autowill switch betweendataSaverandunlimitedbased on system preferencesSettings->Mobile Data->Mobile Data Options->Low Data ModeNote
if connected to WIFI:autowill be same asunlimitedDeclaration
Swift
public var bandwidthPolicy: BandwidthPolicy { get set }Parameters
modeauto / unlimited / dataSaver
-
Replaces the current player item with the new one generated based on source data
Declaration
Swift
public func load(resolvable: ResolvableSource, autoStart: Bool, completion: @escaping (Error?) -> Void)Parameters
resolvablesource with id and isLive props
initialSeekseek position
delaydelay loading
autoStartautoplay after loading
-
Reload previously loaded resolvable source
Declaration
Swift
public func reload(restart: Bool, completion: @escaping (Error?) -> Void) -
Replaces the current player item with nil
Declaration
Swift
public func unload(clearCache: Bool = true) -
Begins playback of the current item
Declaration
Swift
public func play() -
Pauses playback of the current item
Declaration
Swift
public func pause() -
Stops playback of the current item then seeks to 0
Declaration
Swift
public func stop() -
Sets the media current time to the specified position
Declaration
Swift
public func seek(_ type: SeekType, callback: ((_ isCompleted: Bool) -> Void)? = nil)Parameters
typetype of seek could be: date, position, offset
-
restart current stream, for VOD(seek to 0 and play), for LIVE(seek to seekable range start and play)
Declaration
Swift
public func restart() -
Replaces the current item metadata and updates now playing info (lock screen controls)
Declaration
Swift
public func updateMetadata(_ metadata: DorisPlayerMediaMetadata)Parameters
metadatametadata to load