PlaylistAPI Protocol

public protocol PlaylistAPI

Control and manage the playlists

  • Returns the mode used by this playlist instance.

    Declaration

    Swift

    var playlistMode: PlaylistMode { get }
  • Triggered when current item played in the playlist has changed.

    Declaration

    Swift

    var onItemChange: (() -> Void)? { get set }
  • Triggered when all items on the playlist was played.

    Declaration

    Swift

    var onPlaylistEnded: (() -> Void)? { get set }
  • Load new playlist.

    Declaration

    Swift

    func load(items: [PlayerConfiguration])

    Parameters

    items

    Playlist items.

  • Add item to the playlist.

    Declaration

    Swift

    func addItem(_ item: PlayerConfiguration, at index: Int?)
  • Replace an item in the playlist at the index.

    Declaration

    Swift

    func replaceItem(_ item: PlayerConfiguration, at index: Int)
  • Remove item from the playlist.

    Declaration

    Swift

    func removeItem(at index: Int)
  • Swap two items in the playlist.

    Declaration

    Swift

    func swap(at index: Int, to: Int)
  • Start playing next item from the playlist.

    Declaration

    Swift

    func nextItem()
  • Start playing previous item from the playlist.

    Declaration

    Swift

    func previousItem()
  • Play item at index on the playlist.

    Declaration

    Swift

    func playItem(at index: Int)
  • Returns number of items in the playlist.

    Declaration

    Swift

    func getSize() -> Int
  • Return the current item index in the playlist.

    Declaration

    Swift

    func getCurrentItemIndex() -> Int