You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Note: I'm not a C++ developer, nor do I have a lot of experience with WASM! Maybe I'm misunderstanding parts of this.
Today I was able to successfully deploy a built WASM version of raven onto one of our web servers. Exciting!
Following the instructions in the README got me a running version of raven, but I spent quite a bit of time trying to figure out how to actually read a file, since the "Open" menu item doesn't do anything in the browser, and I couldn't figure out any way to use javascript to interact with the main window!
I followed a few guides on how to create "files" (in-memory) in emscripten, and these all caused raven to crash completely.
BUT!
What I finally ended up doing was replacing from_json_file(...) with from_json_string(...) in app.cpp. This allowed me to pass in raw json as an argument to the emscripten app, and get the timeline loaded in the browser!
Anyway, after all of that I had two thoughts:
I don't know how emscripten works, but can we expose a function like from_json_string() to javascript? This way people can write their own javascript code to handle finding and reading OTIO files.
Could we add an argument into the main CLI app to do handle passing in raw json, instead of a file path?
Documenting the WASM stuff better would be lovely, especially for people like me who have no idea what they're doing!
The text was updated successfully, but these errors were encountered:
I wonder if the right thing to do is to write a browser specific main? Passing json from the command line in general sounds like trouble. I'm wondering if what you actually need is to be able to pass a URL to main, rather than raw json data? You would then use a FETCH command to get the data as a string and pass it to from_json_string. So basically, add a new command line switch like --url https://some/path/to.otio.
Yes, you're right that the WASM build of raven needs some work. There's an easy-to-miss note about "Needs file open/save dialog" in the README and some links to possible paths forward. If I recall correctly I attempted one of those but ran into some roadblocks, but I bet a fresh attempt could make one of those work.
The suggestions you both made about ways to feed OTIO JSON into the WASM are all great. Depending on the use case any/all of these could be useful.
Note: I'm not a C++ developer, nor do I have a lot of experience with WASM! Maybe I'm misunderstanding parts of this.
Today I was able to successfully deploy a built WASM version of raven onto one of our web servers. Exciting!
Following the instructions in the README got me a running version of raven, but I spent quite a bit of time trying to figure out how to actually read a file, since the "Open" menu item doesn't do anything in the browser, and I couldn't figure out any way to use javascript to interact with the main window!
I followed a few guides on how to create "files" (in-memory) in emscripten, and these all caused raven to crash completely.
BUT!
What I finally ended up doing was replacing
from_json_file(...)
withfrom_json_string(...)
inapp.cpp
. This allowed me to pass in raw json as an argument to the emscripten app, and get the timeline loaded in the browser!Anyway, after all of that I had two thoughts:
from_json_string()
to javascript? This way people can write their own javascript code to handle finding and reading OTIO files.The text was updated successfully, but these errors were encountered: