mirror of
https://github.com/YuzuZensai/NekoMelody.git
synced 2026-01-31 14:57:58 +00:00
✨ feat: Queue skip
This commit is contained in:
@@ -123,6 +123,17 @@ export class Player {
|
|||||||
await this.play(this._stream.referenceUrl, time);
|
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() {
|
public getCurrentSampleRate() {
|
||||||
return this._stream?.information.bitrate || 0;
|
return this._stream?.information.bitrate || 0;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user