Fixed: Improper initialization of ActiveX component when Flash not available causing FFDec not start

This commit is contained in:
Jindra Petřík
2021-02-08 20:15:19 +01:00
parent a6c41ec269
commit 04683f0cb8
3 changed files with 33 additions and 29 deletions
@@ -178,36 +178,36 @@ public final class FlashPlayerPanel extends Panel implements Closeable, MediaDis
// hack: Kernel32.INSTANCE.ConnectNamedPipe never completes in ActiveXControl static constructor
flash = CancellableWorker.call(callable, 5, TimeUnit.SECONDS);
flash.setAllowScriptAccess("always");
try {
flash.setAllowNetworking("all");
} catch (ActiveXException ex) {
// ignore
}
flash.addOnReadyStateChangeListener((ActiveXEvent axe) -> {
fireMediaDisplayStateChanged();
});
flash.addFlashCallListener((ActiveXEvent axe) -> {
String req = (String) axe.args.get("request");
Matcher m = Pattern.compile("<invoke name=\"([^\"]+)\" returntype=\"xml\"><arguments><string>(.*)</string></arguments></invoke>").matcher(req);
if (m.matches()) {
String funname = m.group(1);
String msg = m.group(2);
if (funname.equals("alert") || funname.equals("console.log")) {
if (Main.debugDialog != null) {
Main.debugDialog.log(funname + ":" + msg);
}
}
}
});
} catch (ActiveXException | TimeoutException | InterruptedException | ExecutionException ex) {
logger.log(Level.WARNING, "Cannot initialize flash panel", ex);
throw new FlashUnsupportedException();
}
flash.setAllowScriptAccess("always");
try {
flash.setAllowNetworking("all");
} catch (ActiveXException ex) {
// ignore
}
flash.addOnReadyStateChangeListener((ActiveXEvent axe) -> {
fireMediaDisplayStateChanged();
});
flash.addFlashCallListener((ActiveXEvent axe) -> {
String req = (String) axe.args.get("request");
Matcher m = Pattern.compile("<invoke name=\"([^\"]+)\" returntype=\"xml\"><arguments><string>(.*)</string></arguments></invoke>").matcher(req);
if (m.matches()) {
String funname = m.group(1);
String msg = m.group(2);
if (funname.equals("alert") || funname.equals("console.log")) {
if (Main.debugDialog != null) {
Main.debugDialog.log(funname + ":" + msg);
}
}
}
});
timer = new Timer();
timer.schedule(new TimerTask() {
private boolean isPlaying = false;