mirror of
https://git.huckle.dev/Huckles-Minecraft-Archive/jpexs-decompiler.git
synced 2026-09-25 10:50:47 +00:00
Fixed: Improper initialization of ActiveX component when Flash not available causing FFDec not start
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user