AudioPlayerAgentProtocol

public protocol AudioPlayerAgentProtocol : CapabilityAgentable

The AudioPlayerAgent handles directives for controlling audio playback.

  • Sets a delegate to be notified of AudioPlayerDisplayTemplate changes.

    Declaration

    Swift

    var displayDelegate: AudioPlayerDisplayDelegate? { get set }
  • Adds a delegate to be notified of AudioPlayerState changes.

    Declaration

    Swift

    func add(delegate: AudioPlayerAgentDelegate)

    Parameters

    delegate

    The object to add.

  • Removes a delegate from AudioPlayerAgent.

    Declaration

    Swift

    func remove(delegate: AudioPlayerAgentDelegate)

    Parameters

    delegate

    The object to remove.

  • Returns the current time of the current player item.

    This function retrieves the offset(seconds) of the current MediaPlayable handled by the AudioPlayerAgent.

    Declaration

    Swift

    var offset: Int? { get }
  • The duration of the current player item.

    This function retrieves the duration(seconds) of the current MediaPlayable handled by the AudioPlayerAgent.

    Declaration

    Swift

    var duration: Int? { get }
  • The audio playback volume for the player.

    This function retrieves the volume of the current MediaPlayable handled by the AudioPlayerAgent.

    Declaration

    Swift

    var volume: Float { get set }
  • Begins playback of the current item.

    Declaration

    Swift

    func play()
  • Stop playback.

    Declaration

    Swift

    func stop()
  • Initiates playback of the next item.

    Declaration

    Swift

    @discardableResult
    func next(completion: ((StreamDataState) -> Void)?) -> String

    Parameters

    completion

    The completion handler to call when the request is complete.

    Return Value

    The dialogRequestId for request.

  • initiates playback of the previous item.

    Declaration

    Swift

    @discardableResult
    func prev(completion: ((StreamDataState) -> Void)?) -> String

    Parameters

    completion

    The completion handler to call when the request is complete.

    Return Value

    The dialogRequestId for request.

  • Pauses playback.

    Declaration

    Swift

    func pause()
  • Change favorite status by sending current status as on / off.

    Declaration

    Swift

    func requestFavoriteCommand(current: Bool)
  • Change repeatMode by sending current repeatMode as all / one / none.

    Declaration

    Swift

    func requestRepeatCommand(currentMode: AudioPlayerDisplayRepeat)
  • Change shuffle status by sending current status as on / off.

    Declaration

    Swift

    func requestShuffleCommand(current: Bool)
  • Sets the current playback time to the specified time.

    Declaration

    Swift

    func seek(to offset: Int)

    Parameters

    offset

    The time(seconds) to which to seek.

  • This should be called when occur interaction(input event such as touch, drag, etc…) for display

    Declaration

    Swift

    func notifyUserInteraction()

Default

  • next() Extension method

    <#Description#>

    Declaration

    Swift

    @discardableResult
    func next() -> String

    Return Value

    <#description#>

  • prev() Extension method

    initiates playback of the previous item.

    Declaration

    Swift

    @discardableResult
    func prev() -> String