KodiPlayer

public final class KodiPlayer : ObservableObject

The Observable Class that contains all the Player information (SwiftlyKodi Type)

  • The properties of the player
  • The optional current item in the player
  • The current audio playlist
  • The current video playlist
  • The volume of the player

Note

Volume is part of the Application properties but it makes sense here

Constants and Variables

  • The shared instance of this KodiPlayer class

    Declaration

    Swift

    public static let shared: KodiPlayer

Published properties

  • The properties of the player

    Declaration

    Swift

    @Published
    public private(set) var properties: Player.Property.Value { get set }
  • The optional current item in the player

    Declaration

    Swift

    @Published
    public private(set) var currentItem: (any KodiItem)? { get set }
  • The current audio playlist

    Declaration

    Swift

    @Published
    public private(set) var audioPlaylist: [(any KodiItem)]? { get set }
  • The current video playlist

    Declaration

    Swift

    @Published
    public private(set) var videoPlaylist: [(any KodiItem)]? { get set }
  • The time of latest playlist update

    Note

    SwiftUI can’t observe the playlists because they have Protocol items

    Declaration

    Swift

    @Published
    public private(set) var playlistUpdate: Date { get set }
  • The volume setting of the application

    Note

    This is an Application property but it makes more sense here

    Declaration

    Swift

    @Published
    public var volume: Double { get set }
  • Bool if the volume of the application is muted or not

    Note

    This is an Application property but it makes more sense here

    Declaration

    Swift

    @Published
    public private(set) var muted: Bool { get set }

Calculated stuff

  • The current playlist, based on the current ID

    Declaration

    Swift

    public var currentPlaylist: [(any KodiItem)]? { get }