Skip to content

Commit

Permalink
Update youtube-source and include WebEmbedded client
Browse files Browse the repository at this point in the history
  • Loading branch information
1Revenger1 committed Aug 20, 2024
1 parent 6320c4a commit 0d98259
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 7 deletions.
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ dependencies {
implementation("net.dv8tion:JDA:5.0.0-beta.23")
implementation("ch.qos.logback:logback-classic:1.4.5")
implementation("dev.arbjerg:lavaplayer:2.2.1") // https://github.com/lavalink-devs/lavaplayer
implementation("dev.lavalink.youtube:v2:1.5.2")
implementation("dev.lavalink.youtube:v2:1.7.0")
implementation("org.mongodb:mongodb-driver-sync:4.8.2")
implementation ("org.scilab.forge:jlatexmath:1.0.7")
}
Expand Down
10 changes: 4 additions & 6 deletions src/main/java/com/wylxbot/wylx/Core/Music/WylxPlayerManager.java
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,7 @@
import com.sedmelluq.discord.lavaplayer.player.DefaultAudioPlayerManager;
import com.sedmelluq.discord.lavaplayer.source.AudioSourceManagers;
import dev.lavalink.youtube.YoutubeAudioSourceManager;
import dev.lavalink.youtube.clients.AndroidMusicWithThumbnail;
import dev.lavalink.youtube.clients.MusicWithThumbnail;
import dev.lavalink.youtube.clients.TvHtml5EmbeddedWithThumbnail;
import dev.lavalink.youtube.clients.WebWithThumbnail;
import dev.lavalink.youtube.clients.*;

import java.util.concurrent.ConcurrentHashMap;

Expand All @@ -22,10 +19,11 @@ private WylxPlayerManager() {
// Use Youtube Source manager from youtube-source repo instead of built-in
YoutubeAudioSourceManager ytSrcMgr = new YoutubeAudioSourceManager(
/*allowSearch:*/ true,
new AndroidMusicWithThumbnail(),
new MusicWithThumbnail(),
new WebWithThumbnail(),
new TvHtml5EmbeddedWithThumbnail(),
new AndroidMusicWithThumbnail()
new WebEmbeddedWithThumbnail(),
new WebWithThumbnail()
);

playerManager.registerSourceManager(ytSrcMgr);
Expand Down

0 comments on commit 0d98259

Please sign in to comment.