Skip to content

Commit

Permalink
feat(web): add setQueue method (#2394)
Browse files Browse the repository at this point in the history
  • Loading branch information
jspizziri authored Dec 20, 2024
1 parent a486121 commit 2765d09
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
2 changes: 1 addition & 1 deletion example/src/components/PlaybackError.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ const styles = StyleSheet.create({
container: {
width: '100%',
marginVertical: 24,
alignSelf: 'center'
alignSelf: 'center',
},
text: {
color: 'red',
Expand Down
5 changes: 5 additions & 0 deletions web/TrackPlayerModule.ts
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,11 @@ export class TrackPlayerModule extends PlaylistPlayer {
return this.playlist;
}

public async setQueue(queue: Track[]) {
await this.stop();
this.playlist = queue;
}

public getActiveTrack(): Track | undefined {
return this.current;
}
Expand Down

0 comments on commit 2765d09

Please sign in to comment.