iMectPlayer has a default overlay ad container to display JPG, PNG, GIF, animated GIF and SWF objects over the video, but you can develop your own as well. This object is controlled from the JSON, so this page is an additional document for the JSON parameters. Every setting is per video.
| parameter | description |
|---|---|
| overlay_ad | A URL to an SWF file containing an overlay advertisement - or any overlay Flash thing. You can develop your own or use wuplayer's default. |
| overlay_ad_sec | In which second to show the overlay ad after the video starts playing. Default: 10. Must be > 0. |
| overlay_ad_staturl | The player pings this URL when the overlay ad appears, to measure the views of the overlay ad. |
| overlay_ad_link | This URL will be opened in a new browser window if you click on the overlay ad, |
| overlay_ad_clickstaturl | The player pings this URL when the user clicked on the overlay ad. You can measure click-ons this way. |
This is controlled by the "overlay_ad" setting's query string. So the value for the overlay_ad looks something like this (with URL escaping removed for readability):
http://example.com/overlay.swf?media=something.png&position=top-left
&hidesec=4
Media is the url of the ad. It can be a JPG, PNG or GIF image or an SWF animation. Animated GIFs and transparency (even in SWF animations) are supported.
Hidesec is the duration in seconds to show the ad upon it's first appearance.
The container continuosly resizes itself to the played video and also resizes the ad shown. For landscape (common) ads the width will be 90% and the height 33% of the video. For vertical (skyscraper) ads the width will be 33% and the height 90%.
The ad can be shown on 9 positions: top-left, top-center, top-right, left-center, center, right-center, bottom-left, bottom-center, bottom-right. It will be automatically animated, move-in by default and fade-in for the "center" setting.
The overlay ad container implements this interface to communicate with iMectPlayer. Use this if you'd like to develop your own ad container SWF.
The first frame should contain a "wuplayer_adhandler" object, so the first frame's ActionScript will look something like this:
stop();
Security.allowDomain('*');
import MY_OWN_CLASS;
var wuplayer_adhandler:Object = new MY_OWN_CLASS();
The minimum implementation/interface for that class:
public class MY_OWN_CLASS {
public function init(rootObj:DisplayObject, parent:Object):void {
/*
This isn't a constructor, but called by iMectPlayer later, once.
The whole SWF will be put into rootObj.
parent is iMectPlayer's inner overlay-handler object.
Call parent.onclose(), when you'd like to hide your content.
It will call your hide() method automatically.
Call parent.clickstat() for pinging your overlay ad click stat server.
*/
}
public function hide():void {
/*
This method should hide your content.
You can start animations as well, don't need to hide immediately.
It can be called several times.
*/
}
public function show():void {
/*
This method should display your content.
You shouldn't display anything upon init or in your constructor.
It can be called several times.
*/
}
public function onresize(stagewidth:Number, stageheight:Number) {
/*
It called when the player is resized, you should resize your content as well.
*/
}
}
iMect means internet, media and other cool things. iMect is a small company near lake Velence, Hungary. We’ve a big footer on every page where you can discover what we do and what happens with us.
Az iMect jelentése: internet, média és egyéb király dolgok. Egy kis cég vagyunk közel a Velencei-tóhoz. Minden oldalon van egy nagy lábléc, ahol felfedezheted, hogy mivel foglalkozunk.