mirror of
https://github.com/YuzuZensai/NekoMelody.git
synced 2026-01-30 20:34:32 +00:00
✨ feat: Queue skip
This commit is contained in:
@@ -123,6 +123,17 @@ export class Player {
|
||||
await this.play(this._stream.referenceUrl, time);
|
||||
}
|
||||
|
||||
public async skip() {
|
||||
if (this.queue.length === 0) {
|
||||
throw new Error("No song in queue");
|
||||
}
|
||||
|
||||
const next = this.queue.shift();
|
||||
if (next) {
|
||||
this._createStream(next, next.url, 0);
|
||||
}
|
||||
}
|
||||
|
||||
public getCurrentSampleRate() {
|
||||
return this._stream?.information.bitrate || 0;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user