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
+30 -28

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