Closed
Description
I've been trying to solve this problem since forever
when using SubtitlesOctopus with Nextjs project I always get errors like
I'm using Nextjs With Typescript
My code:
// Player.tsx
import { useEffect, useRef } from "react";
// @ts-ignore
import SubtitlesOctopus from "libass-wasm";
const MainDomain = "https://cdn..../"; // Basically my CDN url
type PlayerProps = {
eng: string;
};
export default function Player({ eng }: PlayerProps) {
useEffect(() => {
Subtitles();
}, []);
function Subtitles() {
var options = {
video: document.querySelector("video"),
subUrl: MainDomain + eng,
workerUrl: new URL("libass-wasm/dist/js/subtitles-octopus-worker.js", import.meta.url)
};
var instance = new SubtitlesOctopus(options);
}
return <video />;
}
I would be appreciated If someone know how to solve this issue or If someone can make a repo example of how to use SubtitlesOctopus with Nextjs Typescript
Thank You!
Metadata
Metadata
Assignees
Labels
No labels