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