Tracking state of Chrome's Click-to-play feature
How do you detect that a Flash plugin has been temporarily disabled, or, conversely, detect that it has been enabled due to Chrome's "click-to-play" feature?
Background
Chrome's new "click-to-play" feature detects plugins that are not visibly significant and pauses them. Chrome displays a "play" button over the plugin, a user may click the "play" button to activate the plugin. (reference: https://productforums.google.com/forum/#!topic/chrome/xPcpRBzyPcc)
Here's a screenshot of it in action (notice white play buttons):
You can see in this screen shot that it has paused a video-player (right column). That video player has HTML5-based controls overlaying a Flash-based video player. So, there's no way for a user to click the play-button as the entire SWF is purposefully covered by HTML5-based play/pause controls.
What I need is to detect when the SWF has been paused by the "click-to-play" feature so I can disable the controls and make the SWF interactive.
What I've tried
- In JavaScript - All methods exposed via
ExternalInterface
are still available though the SWF is paused. It actually responds like it's playing and does not return an error. - In JavaScript - Update the size of the embedded
<object>
to > 700x400px. "Click-to-play" does not pause a SWF of this size. So, I tried using-webkit-transfor: scale(0.5)
to use CSS to scale it back to desired size. Chrome calculates the final rendered size and pauses the SWF regardless. - In Flash -
stage.frameRate
returns correct value (it's not set to 0 to pause the SWF for instance)
In writing up this question I found an answer, decided to post here anyways in case others need help with this issue.