jorgenhenrichsen / SwiftAudio

Audio player for iOS
MIT License
226 stars 86 forks source link

Less constrained RemoteCommandController #73

Open rurza opened 5 years ago

rurza commented 5 years ago

Hey! Right now AudioPlayer asks items for related remote commands or uses those provided when track changes. I find very useful to have the ability to refresh them later (because of the how backend's API is designed) – unfortunately current API doesn't allow to do that. Maybe a new function or remoteCommands didSet block?

public var remoteCommands: [RemoteCommand] = [] {
    didSet {
        if let currentItem = currentItem {
            enableRemoteCommands(forItem: currentItem)
        }
    }
}
jorgenhenrichsen commented 5 years ago

Yep, seems like a fair thing to include!