rainbowcreatures / FlashyWrappers

AIR / Flash video recording SDK
17 stars 10 forks source link

Receive StatusEvent (trace) instead of StatusEvent (started)...Never receive the StatusEvent (started) event #9

Open rubel opened 7 years ago

rubel commented 7 years ago

myEncoder = FWVideoEncoder.getInstance(this);
myEncoder.addEventListener(StatusEvent.STATUS, onStatus); myEncoder.load("../../lib/FlashPlayer/mp4/");

private function onStatus(e:StatusEvent):void { if (e.code == "ready") {
myEncoder.start(20, FWVideoEncoder.AUDIO_MICROPHONE); }

// FW was started........NEVER HAPPENS
if (e.code == "started") {
    //NEVER ENTERS HERE
    addEventListener(Event.ENTER_FRAME, onFrame);
}

}

rainbowcreatures commented 7 years ago

Strange. In the source code these are the important bits(in FWVideoEncoder.as):

res = ffmpeg_initFinished() as Boolean; } } // safe to call finish now if (res) { checkInitThreadFinished = false; // in AIR we remove this event listener again, in FlasCC we don't remove it, it is removed elsewhere CONFIG::AIR { removeEventListener(Event.ENTER_FRAME, enterFrame); } // dispatch event startRecording(); instance.dispatchEvent( new StatusEvent( StatusEvent.STATUS, false, false, "started", "")); } So either ffmpeg_initFinished() doesn't return true or it's something else. Try to put a trace near the dispatchEvent to see if its really never dispatched and / or trace the return value of initFinished.