mirror of https://github.com/sussy-code/smov.git
suggested changes
This commit is contained in:
parent
495222eb10
commit
156b693460
|
@ -6,6 +6,7 @@ export enum MWStreamType {
|
||||||
export enum MWCaptionType {
|
export enum MWCaptionType {
|
||||||
VTT = "vtt",
|
VTT = "vtt",
|
||||||
SRT = "srt",
|
SRT = "srt",
|
||||||
|
UNKNOWN = "unknown",
|
||||||
}
|
}
|
||||||
|
|
||||||
export enum MWStreamQuality {
|
export enum MWStreamQuality {
|
||||||
|
@ -20,7 +21,7 @@ export enum MWStreamQuality {
|
||||||
export type MWCaption = {
|
export type MWCaption = {
|
||||||
needsProxy?: boolean;
|
needsProxy?: boolean;
|
||||||
url: string;
|
url: string;
|
||||||
type?: MWCaptionType;
|
type: MWCaptionType;
|
||||||
langIso: string;
|
langIso: string;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -3,7 +3,7 @@ import {
|
||||||
parseSubtitles,
|
parseSubtitles,
|
||||||
subtitleTypeList,
|
subtitleTypeList,
|
||||||
} from "@/backend/helpers/captions";
|
} from "@/backend/helpers/captions";
|
||||||
import { MWCaption } from "@/backend/helpers/streams";
|
import { MWCaption, MWCaptionType } from "@/backend/helpers/streams";
|
||||||
import { Icon, Icons } from "@/components/Icon";
|
import { Icon, Icons } from "@/components/Icon";
|
||||||
import { FloatingCardView } from "@/components/popout/FloatingCard";
|
import { FloatingCardView } from "@/components/popout/FloatingCard";
|
||||||
import { FloatingView } from "@/components/popout/FloatingView";
|
import { FloatingView } from "@/components/popout/FloatingView";
|
||||||
|
@ -47,7 +47,10 @@ export function CaptionSelectionPopout(props: {
|
||||||
const text = await result.text();
|
const text = await result.text();
|
||||||
parseSubtitles(text); // This will throw if the file is invalid
|
parseSubtitles(text); // This will throw if the file is invalid
|
||||||
controls.setCaption(id, blobUrl);
|
controls.setCaption(id, blobUrl);
|
||||||
controls.closePopout();
|
// sometimes this doesn't work, so we add a small delay
|
||||||
|
setTimeout(() => {
|
||||||
|
controls.closePopout();
|
||||||
|
}, 100);
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
|
@ -107,6 +110,7 @@ export function CaptionSelectionPopout(props: {
|
||||||
const customSubtitle = {
|
const customSubtitle = {
|
||||||
langIso: "custom",
|
langIso: "custom",
|
||||||
url: URL.createObjectURL(e.target.files[0]),
|
url: URL.createObjectURL(e.target.files[0]),
|
||||||
|
type: MWCaptionType.UNKNOWN,
|
||||||
};
|
};
|
||||||
setCaption(customSubtitle, false);
|
setCaption(customSubtitle, false);
|
||||||
}}
|
}}
|
||||||
|
|
Loading…
Reference in New Issue