public protocol PlaylistAPI
Control and manage the playlists
public protocol PlaylistAPI
Control and manage the playlists
Returns the mode used by this playlist instance.
Swift
var playlistMode: PlaylistMode { get }
Triggered when current item played in the playlist has changed.
Swift
var onItemChange: (() -> Void)? { get set }
Triggered when all items on the playlist was played.
Swift
var onPlaylistEnded: (() -> Void)? { get set }
Load new playlist.
Swift
func load(items: [PlayerConfiguration])
items
|
Playlist items. |
Add item to the playlist.
Swift
func addItem(_ item: PlayerConfiguration, at index: Int?)
Replace an item in the playlist at the index.
Swift
func replaceItem(_ item: PlayerConfiguration, at index: Int)
Remove item from the playlist.
Swift
func removeItem(at index: Int)
Swap two items in the playlist.
Swift
func swap(at index: Int, to: Int)
Start playing next item from the playlist.
Swift
func nextItem()
Start playing previous item from the playlist.
Swift
func previousItem()
Play item at index on the playlist.
Swift
func playItem(at index: Int)
Returns number of items in the playlist.
Swift
func getSize() -> Int
Return the current item index in the playlist.
Swift
func getCurrentItemIndex() -> Int