ofVideoPlayer and Emscripten
With the current OF branch the videoPlayer examples only work with Emscripten, if I use ofSoundStream (before loading the video player) in ofSetup. Somehow that was not needed before...
Thats the error without ofSoundStream:
Uncaught ReferenceError: AUDIO is not defined
at _html5video_player_create (videoPlayerExample.js:1:183919)
at ofxEmscriptenVideoPlayer::ofxEmscriptenVideoPlayer() (videoPlayerExample.wasm:0x4605f)
at ofApp::setup() (videoPlayerExample.wasm:0x908f4)
AUDIO is defined in https://github.com/openframeworks/openFrameworks/blob/master/addons/ofxEmscripten/libs/html5audio/lib/emscripten/library_html5audio.js and used by the videoPlayer, because it uses the same audioContext (which is needed for panning for example)...
Is this some regression? it used to work well? if yes can you please try to identify which commit introduced this behavior?
@dimitre yes, it was working before (not long ago). will try to find the commit the next days...
can you please test it again in latest master?
@dimitre still the same with the latest master. I will have a look into the recent commits, when I have some time (soon).
@dimitre I found it (actually not sure how to solve this): https://github.com/openframeworks/openFrameworks/pull/7301/files :)
@2bbb is there a way to enable soundstream for the videoplayer automatically (like before) with Emscripten? Thank you.
Hi, @Jonathhhan
maybe there is a way, I think. but I don't understand about Emscripten...
Notice: I DON'T UNDERSTAND Emscripten.
can we call ofxEmscriptenAudioContext() in ofxEmscriptenVideoPlayer:: load()? (isn't there setup...?)
currently ofxEmscriptenAudioContext() is hide in implementation only in ofxEmscriptenSoundPlayer.cpp.
but maybe we can test quickly with dirty way to edit ofxEmscriptenVideoPlayer.cpp like:
extern int ofxEmscriptenAudioContext();
bool ofxEmscriptenVideoPlayer::load(string name){
ofxEmscriptenAudioContext();
if (name.substr(0, 12) == "blob:http://" || name.substr(0, 13) == "blob:https://"){
....
}
this way is to only for test. if it clear problem, then we need to decide to make ofxEmscriptenAudioContext public in header, or not.
@2bbb thanks a lot. I tried your suggestion but it does not work.
No, there is no setup (like in ofVideoPlayer?)
Now the error is:
Uncaught TypeError: Cannot read properties of undefined (reading 'createMediaElementSource')
in: https://github.com/openframeworks/openFrameworks/blob/master/addons/ofxEmscripten/libs/html5video/lib/emscripten/library_html5video.js
Sort of a hack but this works for me:
https://gist.github.com/ofTheo/4283463783876f901f80c00f99bc56ec