feat: convert srt to vtt if required

This commit is contained in:
Adrian Castro
2024-02-12 15:26:54 +01:00
parent 3d1a5a88f2
commit 33a62752e2
4 changed files with 39 additions and 8 deletions

View File

@@ -53,7 +53,7 @@ const VideoPlayer: React.FC<VideoPlayerProps> = ({ data }) => {
const fetchVideo = async () => {
if (!data) return null;
const { id, type } = data;
const media = await fetchMediaDetails(id, type);
const media = await fetchMediaDetails(id, type).catch(() => null);
if (!media) return null;
const { result } = media;
@@ -72,7 +72,10 @@ const VideoPlayer: React.FC<VideoPlayerProps> = ({ data }) => {
episode,
);
const stream = await getVideoStream(scrapeMedia);
const stream = await getVideoStream({
media: scrapeMedia,
forceVTT: true,
}).catch(() => null);
if (!stream) {
await ScreenOrientation.lockAsync(
ScreenOrientation.OrientationLock.PORTRAIT_UP,