mirror of
https://github.com/streamyfin/streamyfin.git
synced 2026-01-15 23:59:08 +00:00
feat: airplay and chromecast for music
This commit is contained in:
20
utils/jellyfin/audio/getAudioContentType.ts
Normal file
20
utils/jellyfin/audio/getAudioContentType.ts
Normal file
@@ -0,0 +1,20 @@
|
||||
/**
|
||||
* Maps Jellyfin audio container types to MIME types for Chromecast
|
||||
*/
|
||||
export const getAudioContentType = (container?: string | null): string => {
|
||||
if (!container) return "audio/mpeg";
|
||||
|
||||
const map: Record<string, string> = {
|
||||
mp3: "audio/mpeg",
|
||||
aac: "audio/aac",
|
||||
m4a: "audio/mp4",
|
||||
flac: "audio/flac",
|
||||
wav: "audio/wav",
|
||||
opus: "audio/opus",
|
||||
ogg: "audio/ogg",
|
||||
wma: "audio/x-ms-wma",
|
||||
webm: "audio/webm",
|
||||
};
|
||||
|
||||
return map[container.toLowerCase()] ?? "audio/mpeg";
|
||||
};
|
||||
Reference in New Issue
Block a user