How to detect when Chrome's "click-to-play" Flash blocking feature is currently active How to detect when Chrome's "click-to-play" Flash blocking feature is currently active google-chrome google-chrome

How to detect when Chrome's "click-to-play" Flash blocking feature is currently active


For the benefit of others who are looking for the rules around Flash blocking stuff,please see them below:

  • The Flash Content and the page are loaded from the same domain.
    Unknown Width and Height of the Flash Object ie when Chrome gets thewidth and height as 0 or less than 0.
  • The Flash Content iswhitelisted by the user in Chrome Settings.
  • The Width and Height ofthe Flash Object are less than or equal to 5 each, considering thecontent to be Tiny and essential.
  • The Width and Height of theFlash object are equal or greater than 398x298.
  • The Aspect Ratioof the content is 16:9, (with an allowed deviation of 0.01) AND thewidth*height area is at least 120K.

At least one of the above criterias need to be met, in order to get the content marked as Essential and not get Auto-Paused. Although, I have seen few deviations and Chrome hasn't made any public announcement on the rules yet.


Add an empty Flash file larger than 398x298 at the bottom of your page. I found once you have at least one Flash file above their minimum Chrome will not pause any of your Flash. You cannot hide this extra Flash file with CSS. Optionally use a javascript timeout (3 seconds) to hide the empty Flash file in case it messes with your page layout. I'm using swfObject for embedding.


To circumvent the Chrome click-to-play throttling, load your SWF from the same domain and protocol as your site.


You can use the AS3 ThrottleEvent to detect when the SWF has been throttled.

// AS3 codeimport flash.events.ThrottleEvent;import flash.external.ExternalInterface;stage.addEventListener(ThrottleEvent.THROTTLE, onThrottleEvent);private function onThrottleEvent(e:ThrottleEvent) {    ExternalInterface.call("onThrottleEvent", e.state); // call javascript function }

You can setup an ExternalInterface call to keep track of this state in JavaScript, in JavaScript manage z-index of your SWF based on if it's throttled or not.

// JS Codevar IS_THROTTLED = false;window.onThrottleEvent = function (throttleState) {  IS_THROTTLED = (throttleState === "throttle");}