MediaButtons
public enum MediaButtons
Collection of SwiftUI media buttons (SwiftlyKodi Type)
The Views require to have the KodiPlayer Observable Class in the ‘environment’ or else your Application will crash
Note
The buttons are smart and will be disabled when not applicable-
Play/Pause an item in the playlist
There are a few senario’s:
- Playlist is empty: disable this button; there is nothing to play
- Player is paused: do method .playerPlayPause to pause
- Player is playing: do method .playerPlayPause to play
- Player is stopped: do method .playerOpen to start the playlist
Declaration
Swift
struct PlayPause : View -
Play the previous item
See moreNote
Kodi is a bit weird; going to ‘previous’ goes to the beginning of an item when it played for a while; else it reallly goes to the previous itemDeclaration
Swift
struct PlayPrevious : View -
Play the next item
See moreDeclaration
Swift
struct PlayNext : View -
Toggle shuffle button
See moreDeclaration
Swift
struct SetShuffle : View -
Toggle repeat button
See moreDeclaration
Swift
struct SetRepeat : View -
Partymode button (forced to audio)
See moreNote
This will set ‘Party Mode’ for audio, I don’t see a use of videos for thisDeclaration
Swift
struct SetPartyMode : View -
Volume slider
See moreDeclaration
Swift
struct VolumeSlider : View
View on GitHub
MediaButtons Enumeration Reference