Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add audio in s3 #12

Open
rachidis opened this issue Jan 1, 2025 · 0 comments
Open

add audio in s3 #12

rachidis opened this issue Jan 1, 2025 · 0 comments

Comments

@rachidis
Copy link

rachidis commented Jan 1, 2025

I try to add an audio using

dispatch(ADD_AUDIO, {
  payload: {
      id: `introduction-${story.id}`,
      type: "audio",
      details: {
        src: url,
      },
      display: {
        from: 0,
        to: (await getAudioDurationInSeconds(url)) * 1000,
      },
      name: "IntroductionAudio",
    } as IAudio
});

and i get CORS error, i see that the code responsible for this behavior is from the package /state which is not shared.

currently we use;
as = (t) => new Promise( (r, n) => { const i = new Audio(); i.preload = "auto", i.addEventListener("loadedmetadata", () => { const a = i.duration * 1e3; r({ duration: a }); } ), i.addEventListener("error", (a) => { n(a); } ), i.src = t, i.crossOrigin = "anonymous", i.load(); } )
the problem with this is that the header is not set to 'no-core' so it trigger the problem.
you can see above that i use the remotion way to get the duration (getAudioDurationInSeconds) and it's working good because it uses that header.
isnt it possible to open that state repo too so we can contribute in it?

PS: the CORS in my s3 bucket is open '*'

@rachidis rachidis changed the title add audio using s3 add audio in s3 Jan 1, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant