SPTAppRemotePlayerAPI Protocol Reference
Conforms to | NSObject |
---|---|
Declared in | SPTAppRemotePlayerAPI.h |
delegate
required method
The delegate receiving player state updates
@property (nonatomic, weak) id<SPTAppRemotePlayerStateDelegate> delegate
Declared In
SPTAppRemotePlayerAPI.h
– play:callback:
required method
Asks the Spotify player to play the entity with the given identifier.
- (void)play:(NSString *)entityIdentifier callback:(nullable SPTAppRemoteCallback)callback
Parameters
entityIdentifier |
The unique identifier of the entity to play. |
---|---|
callback |
On success |
Discussion
Note: Implement SPTAppRemotePlayerStateDelegate
and set yourself as delegate in order to be notified when the
the track begins to play.
Declared In
SPTAppRemotePlayerAPI.h
– playItem:callback:
required method
Asks the Spotify player to play the provided content item.
- (void)playItem:(id<SPTAppRemoteContentItem>)contentItem callback:(nullable SPTAppRemoteCallback)callback
Parameters
contentItem |
The content item to play. |
---|---|
callback |
On success |
Discussion
Note: Implement SPTAppRemotePlayerStateDelegate
and set yourself as delegate in order to be notified when the
the track begins to play.
Note: The playable
property of the SPTAppRemoteContentItem
indicates whether or not a content item is
playable.
Declared In
SPTAppRemotePlayerAPI.h
– resume:
required method
Asks the Spotify player to resume playback.
- (void)resume:(nullable SPTAppRemoteCallback)callback
Parameters
callback |
On success |
---|
Discussion
Note: Implement SPTAppRemotePlayerStateDelegate
and set yourself as delegate in order to be notified when the
the playback resumes.
Declared In
SPTAppRemotePlayerAPI.h
– pause:
required method
Asks the Spotify player to pause playback.
- (void)pause:(nullable SPTAppRemoteCallback)callback
Parameters
callback |
On success |
---|
Discussion
Note: Implement SPTAppRemotePlayerStateDelegate
and set yourself as delegate in order to be notified when the
the playback pauses.
Declared In
SPTAppRemotePlayerAPI.h
– skipToNext:
required method
Asks the Spotify player to skip to the next track.
- (void)skipToNext:(nullable SPTAppRemoteCallback)callback
Parameters
callback |
On success |
---|
Discussion
Note: Implement SPTAppRemotePlayerStateDelegate
and set yourself as delegate in order to be notified when the
the track changes.
Declared In
SPTAppRemotePlayerAPI.h
– skipToPrevious:
required method
Asks the Spotify player to skip to the previous track.
- (void)skipToPrevious:(nullable SPTAppRemoteCallback)callback
Parameters
callback |
On success |
---|
Discussion
Note: Implement SPTAppRemotePlayerStateDelegate
and set yourself as delegate in order to be notified when the
the track changes.
Declared In
SPTAppRemotePlayerAPI.h
– seekToPosition:callback:
required method
Asks the Spotify player to seek to the specified position.
- (void)seekToPosition:(NSInteger)position callback:(nullable SPTAppRemoteCallback)callback
Parameters
position |
The position to seek to in milliseconds. |
---|---|
callback |
On success |
Declared In
SPTAppRemotePlayerAPI.h
– setShuffle:callback:
required method
Asks the Spotify player to set shuffle mode.
- (void)setShuffle:(BOOL)shuffle callback:(nullable SPTAppRemoteCallback)callback
Parameters
shuffle |
|
---|---|
callback |
On success |
Declared In
SPTAppRemotePlayerAPI.h
– setRepeatMode:callback:
required method
Asks the Spotify player to set the repeat mode.
- (void)setRepeatMode:(SPTAppRemotePlaybackOptionsRepeatMode)repeatMode callback:(nullable SPTAppRemoteCallback)callback
Parameters
repeatMode |
The repeat mode to set. |
---|---|
callback |
On success |
Declared In
SPTAppRemotePlayerAPI.h
– getPlayerState:
required method
Asks the Spotify player for the current player state.
- (void)getPlayerState:(nullable SPTAppRemoteCallback)callback
Parameters
callback |
On success |
---|
Declared In
SPTAppRemotePlayerAPI.h
– subscribeToPlayerState:
required method
Subscribes to player state changes from the Spotify app.
- (void)subscribeToPlayerState:(nullable SPTAppRemoteCallback)callback
Parameters
callback |
On success |
---|
Discussion
Note: Implement SPTAppRemotePlayerStateDelegate
and set yourself as delegate in order to be notified when the
the player state changes.
Declared In
SPTAppRemotePlayerAPI.h
– unsubscribeToPlayerState:
required method
Stops subscribing to player state changes from the Spotify app.
- (void)unsubscribeToPlayerState:(nullable SPTAppRemoteCallback)callback
Parameters
callback |
On success |
---|
Declared In
SPTAppRemotePlayerAPI.h