Hype vs. Flash - syncing

Hi there,

i had a question/problem. I need a synced wallpaper ad. Did ever someone did this and synced two html5-files?

I tried this synced timelines but it didn’t worked on wallpaper.

ty
paul

example link?

1 Like

You can use triggerCustomBehaviour to come up with a solution. But first let me ask you what the target (ad service provider) is? Because most offer a set of functions todo just that (doubleclick, adform etc.) straight out of the box.

Another option when trying todo this manually is to reach out of your “Master” banner and trigger a function in the “Slave” Banner. The risk of such an simple solution is that the “Slave” banner isn’t loaded when the “Master” sends the sync command.

I wrote a Handshake for Flash that uses Localconnection to establish a two-way connection and stays Idle until the first Handshake occures. After that it offers an command pipeline I can send signals back and forth on.

We should recreate this for Hype for those scenarios when sync is not done via doubleclick or adform.

Oh! I just thought of the detail todo such an implementation. As most HTML5 ads a wrapped into an iFrame sending signals back and forth isn’t as trivial as with Flash. One has to respect the security/sandboxing that is in place… therefor I highly recommend using the solution of your ad service provider.

YES, that’s what i need!!! I tried it out on Egde Animate, but the solution was not working. Because Edge Animate doesn’t handle the javascripts that way hype do.

I did it also in flash with localconnection and thats what we need for wallpaper ads. I search the script i used in Edge Animate, then we can try to do it better. :slight_smile:

Did you read my last post? It might be pretty trick when each ad is wrapped into a iFrame (which most ad servers do). If the two ads are rendered into the same DOM or you have control over the iFrame creation it is do-able. Otherwise it will be considered Cross-Site-Scripting. By the way: Ad servers are responsible for rendering the iFrame container therefor they can offer a solution out of the box.

This isn’t a Hype problem but rather a general security measure in place to prevent people hijacking sensitive information.

isn´t it possible by using postmessage?

Doesn't work via iframe. Its also a security problem. :frowning:

It is… I ran into a problem trying to upload ads with such a solution so I didn't suggest it but could work.

iFrame to iFrame might be tricky as the first iFrame would have to receive the context of the second iFrame. Meaning the host site in the middle would have to be involved as a Bridge, correct me if I am wrong.
Again a thing an ad server has no problem with as he orchestrates the ad initialization from the host container and can provide this Bridge.

We did it on iFramesolution with this script. but it had performance-problems.

/* start ow3 edge play synchronously function /
var bannerName = 'RESky';
var banners = 3;
localStorage.setItem(bannerName, '0');
AdobeEdge.bootstrapCallback(function (compId) {
console.log('composition loaded: ' + compId);
localStorage.setItem(bannerName, 'ow3');
AdobeEdge.getComposition(compId).getStage().stop(0);
var p = 1;
function onStorageEvent(storageEvent) {
var OW3ElementsInStorage = OW3ElementsInStorage();
if(OW3ElementsInStorage == banners) {
console.log('play ' + bannerName);
AdobeEdge.getComposition(compId).getStage().play();
}
function OW3ElementsInStorage() {
var values = [],
keys = Object.keys(localStorage),
i = keys.length;
while ( i-- ) {
values.push( localStorage.getItem(keys[i]) );
}
p=0;
for(i=0;i<values.length;i++) {
if(values[i] == 'ow3')
p++;
}
return p;
}
}
window.addEventListener('storage', onStorageEvent, false);
onStorageEvent(1); // trigger onStorageEvent function on init
});
/ end ow3 edge play synchronously function */

That could work… if nobody else steps up to the plate I’ll give it a try later.
http://www.w3schools.com/html/html5_webstorage.asp

Have you found a solution in the meantime?

I haven't had a need to do this. However, if I did – and the starting frame didn't matter because the animation loops – I might use a time stamp and modulo (based on the total frames/seconds of animation) to get the two Hype projects to jump to the same frame.

That's just theoretical though.

postMessage, localStorage, serverside
guess those are the possible roads to go. any with its own issues, risks, features

your provided solution using localStorage, storage event, will be almost the same within hype as only the hypespecific parts will change …

@h_classen Did you experience any improvements on the topic since June '16?

No, no solution.