mirror of
https://github.com/warengroup/eximiabots-radiox.git
synced 2024-12-23 05:13: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
|
audioPlayer
|
||||||
.on(AudioPlayerStatus.Playing, () => {
|
.on(AudioPlayerStatus.Playing, () => {
|
||||||
logger('Streamer', station.name + " / " + "Playing");
|
logger('Streamer', station.name + " / " + "Playing");
|
||||||
@ -87,6 +80,14 @@ export default class Streamer {
|
|||||||
.on(AudioPlayerStatus.AutoPaused, () => {
|
.on(AudioPlayerStatus.AutoPaused, () => {
|
||||||
logger('Streamer', station.name + " / " + "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;
|
return audioPlayer;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user