feat(music): support direct media playback from Fluxer attachments and uploaded files (#24)

- Add AttachmentUtils for detecting fluxerusercontent.com URLs and chat file attachments
- Support playing uploaded audio/video files directly via %play and %playnext
- Add Route 3d in-process ffmpeg decoding for container formats (.mp4, .mkv, .mov, etc.)
- Add native zero-re-encode passthrough for .opus, .webm, and .ogg attachments
- Add 📎 Fluxer Attachment source badges and embeds across all 6 locales
- Fixes #24
This commit is contained in:
NoLogicAlan committed 2026-10-29 03:08:20 +03:00
1 parent 91e7812c30
commit 7c5fb1e468
14 files changed
+300 -18

No files matched your search

+5 -2
View File
@@ -73,7 +73,7 @@ const DisplayMixin = {
? `[Radio]: ${vid.title} - ${vid.author?.url || ""}`
: `[Radio] [${vid.title} by ${vid.author?.name || "Unknown"}](${vid.author?.url || ""})`;
}
if (vid.type === "external" || vid.type === "stream") {
if (vid.type === "external" || vid.type === "stream" || vid.type === "attachment") {
return code
? `${vid.title} - ${vid.url}`
: `[${vid.title}](${vid.url})`;
@@ -185,6 +185,9 @@ const DisplayMixin = {
if (current.type === "radio") {
sourceName = this._t("responses.play.sourceRadio");
sourceIcon = "📻";
} else if (current.type === "attachment" || current.url?.includes("fluxerusercontent.com") || current.url?.includes("cdn.fluxer.app")) {
sourceName = this._t("responses.play.sourceAttachment");
sourceIcon = "📎";
} else if (current.spotifyUrl || current.type === "spotify") {
sourceName = this._t("responses.play.sourceSpotify");
sourceIcon = "🟢";
@@ -222,7 +225,7 @@ const DisplayMixin = {
/* Radio live metadata probe is optional — gracefully fall back to station display */
textMsg = `${vcLine}📻 **[${current.title}](${current.author?.url || current.url})**\n\n🔉 ${vol} │ ${loopqueue} Queue │ ${songloop} Song │ ${autoplay} Autoplay`;
}
} else if (current.type === "external" || current.type === "stream") {
} else if (current.type === "external" || current.type === "stream" || current.type === "attachment") {
const totalMs = this._getTrackDurationMs(current);
const progressLine = totalMs > 0 ? `\n${this._createProgressBar(20)}` : "";
textMsg = `${vcLine}🎵 **[${current.title}](${current.url})** by ${artistName}${progressLine}\n\n🔉 ${vol} │ ${loopqueue} Queue │ ${songloop} Song │ ${autoplay} Autoplay`;