feat: add subtitle support #337

This commit is contained in:
Prayag Prajapati committed 2024-08-27 19:12:46 +05:30
1 parent 8106b714a1
commit cec17b270a
20 files changed
+4958 -4755

No files matched your search

+8
View File
@@ -40,6 +40,7 @@ import PlayNextButton from "@/components/buttons/playNextButton";
import PlayPreviousButton from "@/components/buttons/playPreviousButtom";
import QueueButton from "@/components/buttons/queueButton";
import OutroCard from "@/components/outroCard";
import useQueue from "@/utils/store/queue";
import { createFileRoute, useRouter } from "@tanstack/react-router";
import type { OnProgressProps } from "react-player/base";
import subtitleFont from "./Noto-Sans-Indosphere.ttf";
@@ -98,6 +99,10 @@ function VideoPlayer() {
state.playsessionId,
state.intro,
]);
const [currentQueueItemIndex, queue] = useQueue((s) => [
s.currentItemIndex,
s.tracks,
]);
const [loading, setLoading] = useState(true);
const [settingsMenu, setSettingsMenu] = useState(null);
@@ -330,6 +335,9 @@ function VideoPlayer() {
}, [progress]);
const showUpNextCard = useMemo(() => {
if (queue[currentQueueItemIndex]?.Id === queue[queue.length - 1]?.Id) {
return false; // Check if the current playing episode is last episode in queue
}
if (introInfo?.Credits) {
if (
ticksToSec(progress) >= introInfo?.Credits.ShowSkipPromptAt &&