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
Using ogv.js with a React app? #525
Comments
Yeah, it's probably having trouble loading the .wasm file, which needs to be loaded from an actual file on the server. (Currently the error messages are not very nice in this case.) I'm not too familiar with React so don't know if it's specifically breaking anything; but roughly what you want to do is:
Double-check in the browser's debugger 'network' panel that the .wasm file is being loaded and that it has the correct Content-Type of 'application/wasm' as well, if it's not right that can trip things up. |
(Note that for current webpack versions, there's special handling of .wasm files that takes over even past explicit use of |
I tried putting all lib files into public folder
and the same error in console output. By the way the above file is the only that is being loaded on the page.
I don't actually have any special handling of .wasm files in my webpack.config. |
No errors or failures to load? Odd... |
Can you describe how the assets folder is defined and copied to the web server in the webpack config? Is it there when you follow a direct URL? Is there a sample deployment I can try to debug? |
Thanks to your help I understood I should somehow use public folder and handle lib files manually. So I didn't have to make any changes in my webpack.config.js to make it work.
However I didn't have a chance to test it in the Safari, but at least it now works in Chrome/Mozilla. In addition I don't want all the files to work with .webm and .vorbis audio, I acutally need only tools to work with .opus files. Which files should I only leave in my PUBLIC folder to support only .opus audio? |
Awesome :D For .opus files you'll need these:
The versions without the "-wasm" suffix are for older browser versions without WebAssembly support, so if you're certain your browser requirements already exclude those you could drop them to save few kb. If you're not supporting IE you also don't need the dynamicaudio.swf file, which is only used for IE 10/11. The rest of the files should be the other codecs, which only get loaded on demand so you can freely drop them if you know they won't be used. |
@Brion
Because otherwise I was getting an error
I also tested in Safari 12.1.1 and it's playing .ogg now! |
Whoops, I forgot the worker file -- yes you need that too. :) Hmm, can you file a new issue for the 'ended-fires-early', if possible with a sample file? That's probably an audio-specific bug (IIRC if there's video it'll delay the 'ended' event until it's out of frames, but might not be handling audio correctly). Then we can close this one out and I'll try to track the other down. |
Sure, I'll try to test more and then open issue if I get more on the early 'ended' event problem. Thanks! |
Basically I'm trying to implement playing ogg-opus audio in react app in Safari (it doesn't support .ogg format). I use create-react-app to init the project.
I tried just installing it and importing it in code, but when I'm trying to play the audio I get this error:
I think I get this because I should somehow preload it by including ability to preload *.wasm files in my webpack.config.js, and I tried editing it manually, but I couldn't make it work.
Thanks for help in advance.
The text was updated successfully, but these errors were encountered: