Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Detect FLASH plugin crashes

Is there any way to detect flash-plugin crashes in major browsers (firefox, ie, chrome, safari and opera) via javascript?

like image 661
Skay Avatar asked Jul 25 '10 11:07

Skay


2 Answers

I'm not sure whether that works or not. You can periodically get a reference to flash object and check whether it has the method SetVariable.

function checkFlashCrashed() {
   try {
      var tmp = document.getElementById("flashObjectId").SetVariable;
      if(!tmp) {
         alert("Flash crashed");
         return;
      }
   } catch (e) {
      alert("Flash crashed");
      return;
   }
   setTimeout(checkFlashCrashed, 1000); // check it out every one second
}

SetVariable is an interface function that can be called from Javascript code. If flash crashes, its interface should crash, too. Hence, that may be a solution.

like image 163
Zafer Avatar answered Sep 25 '22 00:09

Zafer


Use global exception handling in ActionScript to call an external interface on UncaughtErrorEvent.UNCAUGHT_ERROR.

When an error occurs in the Flash Player runtime, it may catch the exception and signal JavaScript.

like image 45
Jason Sturges Avatar answered Sep 23 '22 00:09

Jason Sturges