play walkout songs
This commit is contained in:
@@ -96,6 +96,17 @@ export class SpotifyWebApiClient {
|
||||
});
|
||||
}
|
||||
|
||||
async playTrack(trackId: string, deviceId?: string, positionMs?: number): Promise<void> {
|
||||
const endpoint = deviceId ? `/me/player/play?device_id=${deviceId}` : '/me/player/play';
|
||||
await this.request(endpoint, {
|
||||
method: 'PUT',
|
||||
body: JSON.stringify({
|
||||
uris: [`spotify:track:${trackId}`],
|
||||
position_ms: positionMs || 0,
|
||||
}),
|
||||
});
|
||||
}
|
||||
|
||||
async pause(): Promise<void> {
|
||||
await this.request('/me/player/pause', {
|
||||
method: 'PUT',
|
||||
|
||||
Reference in New Issue
Block a user