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: auto will switch between dataSaver and unlimited based on system preferences Settings-> Mobile Data -> Mobile Data Options -> Low Data Mode

    Note

    if connected to WIFI: auto will be same as unlimited

    Declaration

    Swift

    public var bandwidthPolicy: BandwidthPolicy { get set }

    Parameters

    mode

    auto / 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

    resolvable

    source with id and isLive props

    initialSeek

    seek position

    delay

    delay loading

    autoStart

    autoplay 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

    type

    type 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

    metadata

    metadata to load