mirror of
https://github.com/warengroup/eximiabots-radiox.git
synced 2024-12-23 01:53:17 +00:00
Create event listeners once in Streamer class
This commit is contained in:
parent
408c5aaab8
commit
2579549f0b
@ -64,13 +64,6 @@ export default class Streamer {
|
||||
});
|
||||
}
|
||||
|
||||
this.map.set(station.name, audioPlayer);
|
||||
}
|
||||
|
||||
const url = station.stream[station.stream.default];
|
||||
const resource = createAudioResource(url);
|
||||
audioPlayer.play(resource);
|
||||
|
||||
audioPlayer
|
||||
.on(AudioPlayerStatus.Playing, () => {
|
||||
logger('Streamer', station.name + " / " + "Playing");
|
||||
@ -87,6 +80,14 @@ export default class Streamer {
|
||||
.on(AudioPlayerStatus.AutoPaused, () => {
|
||||
logger('Streamer', station.name + " / " + "AutoPaused");
|
||||
})
|
||||
|
||||
this.map.set(station.name, audioPlayer);
|
||||
}
|
||||
|
||||
const url = station.stream[station.stream.default];
|
||||
const resource = createAudioResource(url);
|
||||
audioPlayer.play(resource);
|
||||
|
||||
return audioPlayer;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user