Fix video not looping on end

This commit is contained in:
Wizzard 2024-02-05 23:25:44 -05:00
parent d8951ebdd7
commit 3dc617b38b
1 changed files with 8 additions and 9 deletions

View File

@ -47,23 +47,22 @@ module.exports = {
player.on('error', err => console.error(err));
player.on('end', () => {
player.play({
const playStream = () => {
player.play(videoLink, {
kbpsVideo: 7000,
fps: 60,
hwaccel: true,
kbpsAudio: 128,
volume: 1,
});
};
player.on('finish', () => {
console.log('Media ended, replaying...');
playStream();
});
player.play({
kbpsVideo: 7000,
fps: 60,
hwaccel: true,
kbpsAudio: 128,
volume: 1,
});
playStream();
message.channel.send('Livestream started with the provided video link.')
.then(msg => setTimeout(() => msg.delete().catch(console.error), deleteTimeout));