Synchronize hype documents on pla

Can we achieve this classic solution from the Flash-Era with Hype Creatives? I have a take-over at newspaper website.
Here and here is a test link where you see 2 responsive Sitebar (300x600), on top a Superbanner (1012x100) and in the middle a billboard (1012x600) showing a video. The site uses a background image that is fixed and generates a parallax effect. But way too small. :slight_smile: 1920x1080. Should be 3840x2160. But that aside.

These are mostly static creatives/banners. The ones I am creating are animated. I would like to synchronize 3 creatives/banners and habe each one wait before they start animating.

// This Post will be updated once I get more information.

This is technically possible, but I am guessing that it will not be possible in an environment for ads.

With most ads, each one is served in its own <iframe> that is on a separate domain than the ads themselves. Communication between iframes is done via postMessage calls, but these will typically not work across domains unless there are certain sandbox exceptions, which are unlikely to be made for ad iframes.

I have a solution here if you are able to specify sandbox="allow-same-origin allow-scripts" on the ad iframes:
SyncedAds.zip (338.6 KB)

It works by having a script on the On Scene Load handler that sends out a message telling other iframes it is ready. One will load first which will have complete knowledge of who is ready; when it detects all of them are then it will signal its siblings to start an animation.

(Note that the sendMessageToSiblings() inner function is quite dumb and probably not good enough for ad production uses.)

The only difference in the scripts between the three ad files is the first line which specifies an identifier:

var myIdentifier = "ad2"; // change on each ad

This corresponds to items in a list that it knows it will need to complete:

var allIdentifiers = ["ad1", "ad2", "ad3"];

If the ads are not being placed as iframes, then this would become much easier. But I'm guessing it is in an iframe where you won't have the security ability to do this.

I imagine Flash could do it because ExternalInterface.call() seemed to talk to the flash plugin which had knowledge of all ad instances and didn't have to deal with current browser security issues.

1 Like