fix: eac3 codec support

This commit is contained in:
Prayag Prajapati committed 2024-04-29 21:31:52 +05:30
1 parent e8b4d6d434
commit b94442560c
2 files changed
+29 -27

No files matched your search

+13 -12
View File
@@ -38,7 +38,7 @@ import { useApi } from "../../utils/store/api";
import { setBackdrop } from "../../utils/store/backdrop"; import { setBackdrop } from "../../utils/store/backdrop";
import { FormControl, TextField } from "@mui/material"; import { FormControl, TextField } from "@mui/material";
import JASSUB from "jassub"; import type JASSUB from "jassub";
import workerUrl from "jassub/dist/jassub-worker.js?url"; import workerUrl from "jassub/dist/jassub-worker.js?url";
import wasmUrl from "jassub/dist/jassub-worker.wasm?url"; import wasmUrl from "jassub/dist/jassub-worker.wasm?url";
@@ -1121,22 +1121,23 @@ const VideoPlayer = () => {
selectedSubtitle !== "nosub" && selectedSubtitle !== "nosub" &&
showSubtitles showSubtitles
) { ) {
fetchFonts().then((uint8) => { // fetchFonts().then((uint8) => {
const subtitleRendererRaw = new JASSUB({ // const subtitleRendererRaw = new JASSUB({
video: player.current.getInternalPlayer(), // video: player.current.getInternalPlayer(),
subUrl: `${api.basePath}/Videos/${item?.Id}/${item?.Id}/Subtitles/${selectedSubtitle}/Stream.ass?api_key=${api.accessToken}`, // subUrl: `${api.basePath}/Videos/${item?.Id}/${item?.Id}/Subtitles/${selectedSubtitle}/Stream.ass?api_key=${api.accessToken}`,
workerUrl, // workerUrl,
wasmUrl, // wasmUrl,
availableFonts: { "noto sans": uint8 }, // availableFonts: { "noto sans": uint8 },
fallbackFont: "Noto Sans", // fallbackFont: "Noto Sans",
}); // });
setSubtitleRenderer(subtitleRendererRaw); // setSubtitleRenderer(subtitleRendererRaw);
}); // });
} }
}, [showSubtitles, selectedSubtitle]); }, [showSubtitles, selectedSubtitle]);
useLayoutEffect(() => { useLayoutEffect(() => {
setPlaying(true); setPlaying(true);
console.log(progress);
}, [item?.Id]); }, [item?.Id]);
return ( return (
@@ -6,12 +6,12 @@ import {
type DirectPlayProfile, type DirectPlayProfile,
DlnaProfileType DlnaProfileType
} from '@jellyfin/sdk/lib/generated-client'; } from '@jellyfin/sdk/lib/generated-client';
import { getSupportedMP4VideoCodecs } from './helpers/mp4-video-formats'; import { getSupportedAudioCodecs } from "./helpers/audio-formats";
import { getSupportedMP4AudioCodecs } from './helpers/mp4-audio-formats'; import { getSupportedMP4AudioCodecs } from "./helpers/mp4-audio-formats";
import { getSupportedMP4VideoCodecs } from "./helpers/mp4-video-formats";
import { hasMkvSupport } from './helpers/transcoding-formats'; import { hasMkvSupport } from './helpers/transcoding-formats';
import { getSupportedWebMAudioCodecs } from './helpers/webm-audio-formats'; import { getSupportedWebMAudioCodecs } from './helpers/webm-audio-formats';
import { getSupportedWebMVideoCodecs } from './helpers/webm-video-formats'; import { getSupportedWebMVideoCodecs } from "./helpers/webm-video-formats";
import { getSupportedAudioCodecs } from './helpers/audio-formats';
/** /**
* Returns a valid DirectPlayProfile for the current platform. * Returns a valid DirectPlayProfile for the current platform.
@@ -58,17 +58,18 @@ export function getDirectPlayProfiles(
} }
const supportedAudio = [ const supportedAudio = [
'opus', "opus",
'mp3', "mp3",
'mp2', "mp2",
'aac', "aac",
'flac', "flac",
'alac', "alac",
'webma', "webma",
'wma', "wma",
'wav', "wav",
'ogg', "ogg",
'oga' "oga",
"eac3",
]; ];
for (const audioFormat of supportedAudio.filter(format => for (const audioFormat of supportedAudio.filter(format =>