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

Failed to construct 'URL': Invalid URL when using files in /public directory #338

Open
rgdev opened this issue Dec 6, 2024 · 0 comments · May be fixed by #339
Open

Failed to construct 'URL': Invalid URL when using files in /public directory #338

rgdev opened this issue Dec 6, 2024 · 0 comments · May be fixed by #339

Comments

@rgdev
Copy link

rgdev commented Dec 6, 2024

Problem

In the latest build (0.10.2) it seems setting the src property of a Video Node causes a url resolution failure when using a relative path to access files inside the public directory.

src=/video.mp4 -> error
src=/public/video.mp4 -> error
src=http://localhost:9000/public/video.mp4 -> works

This is the error reported inside the editor :

Failed to construct 'URL': Invalid URL

The problem occurred here:
33 | <Video
| ^
34 | src={'/video.mp4'}
35 | play={true}/>

at Video2.video (/node_modules/.vite/deps/chunk-QDB5CW75.js:106083:25)
at ComputedContext.invoke (/node_modules/.vite/deps/chunk-AYLKIJZ5.js:6067:26)
at Video2.mediaElement (/node_modules/.vite/deps/chunk-QDB5CW75.js:106068:17)
at Video2.setVolume (/node_modules/.vite/deps/chunk-QDB5CW75.js:73945:24)
at new Media2 (/node_modules/.vite/deps/chunk-QDB5CW75.js:73900:10)
at new Video2 (/node_modules/.vite/deps/chunk-QDB5CW75.js:106051:5)
at jsx (/node_modules/.vite/deps/chunk-A5ZTJLWB.js:14:18)
at Scene2D.runnerFactory (/src/project.tsx:33:8)
at Thread.next (/node_modules/.vite/deps/chunk-AYLKIJZ5.js:8746:32)
at threads (/node_modules/.vite/deps/chunk-AYLKIJZ5.js:8814:29)
at (/node_modules/.vite/deps/chunk-AYLKIJZ5.js:9331:49)
at Scene2D.execute (/node_modules/.vite/deps/chunk-AYLKIJZ5.js:9425:16)
at Scene2D.next (/node_modules/.vite/deps/chunk-AYLKIJZ5.js:9331:23)
at Scene2D.next (/node_modules/.vite/deps/chunk-QDB5CW75.js:106327:18)
at Scene2D.reset (/node_modules/.vite/deps/chunk-AYLKIJZ5.js:9370:16)
at Scene2D.reset (/node_modules/.vite/deps/chunk-QDB5CW75.js:106353:18)
at Scene2D.recalculate (/node_modules/.vite/deps/chunk-AYLKIJZ5.js:9308:16)
at PlaybackManager.recalculate (/node_modules/.vite/deps/chunk-AYLKIJZ5.js:7540:21)
at Player.prepare (/node_modules/.vite/deps/chunk-AYLKIJZ5.js:8097:29)
at Player.run (/node_modules/.vite/deps/chunk-AYLKIJZ5.js:8118:30)
at (/node_modules/.vite/deps/chunk-AYLKIJZ5.js:8153:22)

How to reproduce

Add a <Video> Node to the scene and try setting src={'/some-file.mp4'}

Versions

Tested on Revideo 0.10.2 (all revideo packages on same version), Chrome 131.0.6778.86, MacOS 14 (arm64)

@rgdev rgdev changed the title Failed to construct 'URL': Invalid URL wh Failed to construct 'URL': Invalid URL when using files in /public directory Dec 6, 2024
@rgdev rgdev linked a pull request Dec 7, 2024 that will close this issue
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

Successfully merging a pull request may close this issue.

1 participant