-
-
Notifications
You must be signed in to change notification settings - Fork 194
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Track stops playing after 30-60 seconds #1630
Comments
@Nico-Mayer , the issue is with a change from discord and discordjs/voice. It's not really a discord-player issue. There are two temporary fixes right now that you can use in the meantime that are in the discord thanks to @skdhg : import { VoiceConnectionStatus } from '@discordjs/voice';
// or const { VoiceConnectionStatus } = require('@discordjs/voice');
// v6
player.events.on('connection', (queue) => {
queue.dispatcher.voiceConnection.on('stateChange', (oldState, newState) => {
if (oldState.status === VoiceConnectionStatus.Ready && newState.status === VoiceConnectionStatus.Connecting) {
queue.dispatcher.voiceConnection.configureNetworking();
}
});
});
// v5
player.on('connectionCreate', (queue) => {
queue.connection.voiceConnection.on('stateChange', (oldState, newState) => {
if (oldState.status === VoiceConnectionStatus.Ready && newState.status === VoiceConnectionStatus.Connecting) {
queue.connection.voiceConnection.configureNetworking();
}
})
}); |
This is the new solution as per discordjs/discord.js#9185 (comment) // v6
player.events.on('connection', (queue) => {
queue.dispatcher.voiceConnection.on('stateChange', (oldState, newState) => {
const oldNetworking = Reflect.get(oldState, 'networking');
const newNetworking = Reflect.get(newState, 'networking');
const networkStateChangeHandler = (oldNetworkState, newNetworkState) => {
const newUdp = Reflect.get(newNetworkState, 'udp');
clearInterval(newUdp?.keepAliveInterval);
}
oldNetworking?.off('stateChange', networkStateChangeHandler);
newNetworking?.on('stateChange', networkStateChangeHandler);
});
});
// v5
player.on('connectionCreate', (queue) => {
queue.connection.voiceConnection.on('stateChange', (oldState, newState) => {
const oldNetworking = Reflect.get(oldState, 'networking');
const newNetworking = Reflect.get(newState, 'networking');
const networkStateChangeHandler = (oldNetworkState, newNetworkState) => {
const newUdp = Reflect.get(newNetworkState, 'udp');
clearInterval(newUdp?.keepAliveInterval);
}
oldNetworking?.off('stateChange', networkStateChangeHandler);
newNetworking?.on('stateChange', networkStateChangeHandler);
});
}); |
Fix for player autopausing after quitting after 30-60s. Androz2091/discord-player#1630 (comment)
Is anyone else after implementing this fix running into the issue that the player only plays tracks for 2m 30s and then stops and queues the next track? Is there a fix similair to above for it? |
Fix for player autopausing after quitting after 30-60s. Androz2091/discord-player#1630 (comment)
Note to newcomersIf you just installed discord-player, there's a chance that you have v6.0.0 installed. If yes, you can ignore this issue as discord-player v6.0.0 comes with this patch. v6.0.0 users can disable default patch by setting |
* fix: Discord opus dependency issue Signed-off-by: TannerGabriel <gabrieltanner.code@gmail.com> * Fix activityType (TannerGabriel#199) * Fix activityType * Revert "Fix activityType" This reverts commit 58455f6. * Fix activityType and status * Switch Dockerfile to distroless base image (TannerGabriel#209) * Switch Dockerfile to distroless image * Docker: Compress ffmpeg with upx * feat: add docker build github action (TannerGabriel#208) * feat: add docker build github action should use github.actor prepare for upstream pr * update readme * Update README.md * fix: Docker build action (TannerGabriel#211) * fix: Docker build action repo name Signed-off-by: TannerGabriel <gabrieltanner.code@gmail.com> * Add workflow dispatch to docker build action Signed-off-by: TannerGabriel <gabrieltanner.code@gmail.com> --------- Signed-off-by: TannerGabriel <gabrieltanner.code@gmail.com> * Update index.js (TannerGabriel#213) Fix for player autopausing after quitting after 30-60s. Androz2091/discord-player#1630 (comment) --------- Signed-off-by: TannerGabriel <gabrieltanner.code@gmail.com> Co-authored-by: TannerGabriel <gabrieltanner.code@gmail.com> Co-authored-by: Bygrilinho <20670349+Bygrilinho@users.noreply.github.com> Co-authored-by: Florentin Schäfer <florentin.schaefer@gmail.com> Co-authored-by: Fredrick Myrvoll <fredrickmyrvoll@gmail.com> Co-authored-by: smclean117 <90870055+smclean117@users.noreply.github.com>
Fix for player autopausing after quitting after 30-60s. Androz2091/discord-player#1630 (comment)
Describe the bug
After the bot joins the VC it starts playing the selected song, but after 30-60 the track stops.
Bot stays in VC for quite some time after that.
No logs are present in Node console.
Same bug is mentioned here Issue
To Reproduce
Steps to reproduce the behavior:
Expected behavior
Bot should play the whole song and then leve the VC.
Screenshots
Please complete the following information:
Additional context
The text was updated successfully, but these errors were encountered: