Playable
public protocol Playable
A type that can be streamed with the Spotify Audio Playback framework.
Types that conform to this protocol implement a convenience method that calls the shared SPTAudioStreamingController
instance’s play(_:)
method, beginning playback of the item that performed the method,
-
play(completion:)
Default implementationPlays the item from the beginning.
If the item represents a collection of tracks, such as an album or playlst, this method begins playing the first track in the context.
Note
This method uses the shared
SPTAudioStreamingController
instance to play the item. If the controller has not been initialized, started on its own thread, or logged into the Spotify service, then this method will do nothing.Default Implementation
Declaration
Swift
func play(completion handler: @escaping SKErrorHandler)
Parameters
handler
The callback handler for the request, providing an error identifying if and why the request failed, or
nil
if the request was successful.