Insert an image-ad into a video

Posted by Anonymous February 2, 2010 - 7:47am

Insert an image-ad into a video

To monetize your video, you may want to add an image-ad into the video. Here, there is an example will show you how to implement this by using Moyea Web Player, XML code and flashvars code:

About Moyea Web Player:
Moyea Web Player on http://www.playerdiy.com/ is a Flash video player creator. With it, you can easily make customized Flash video player with playlist and full screen features for website.
Tutorial is here:
http://www.playerdiy.com/support/tutorial/customize-flash-video-player.html
Customize the skin and playback options of web FLV player:
http://www.playerdiy.com/configuration/

Using Moyea Web Player:
Step 1: Open Moyea Web Player and input a video into it.

Step 2: Click the “Add” button on “insert” tab on “Advertise” interface, check the “image” option, and then input an image(image in format of jpg, gif or png is available, and unlimited images can be added into a video).
http://www.playerdiy.com/images/adsolution/insert-image-ad1.jpg

Set at which time this image-ad will start, how long it will last and where it will link to (if don’t want to link to any website, just leave the form of “Navigation on click” blank).
http://www.playerdiy.com/images/adsolution/insert-image-ad2.jpg

Step 3: Set the value of “Video list style” is none to remove the playlist and the embed code at the right of FLV player
http://www.playerdiy.com/images/adsolution/insert-image-ad3.jpg

Step 4: Click the “Publish” button on “Publish” interface and, then we can get the above demo for website.

Using code:
XML Code:
To insert an ad into a video with xml code, all need to do is inserting a line of xml code about it into the medialist.xml file which published with the player. The line of the red code below is the xml code about the imag-ad which in the above demo, the value of each property in the code can be modified in the way you want to.

[code]

[/code]

Flashvars Code:
If you have published a player with an embedded xml file and have no the medialist.xml file, inserting an ad into a video, you need to insert a line of flashvars code into the embed code of the player. The syntax of the flashvars code as below:

playerOpts=advertList*^videoidx^position^duration^videotype^filepath^clickurl^clicktarget^sound^fadein
^fadeout^width^height...*s

Note: 1. No line break of the flashvars code; 2. When videoidx=0, it stands for the first video; 3. The "…" part means the front code can be duplicated to insert multiple ads into a single or mutilple videos.

The embed code of the above demo:

[code]

var so = new SWFObject('mwplayer.swf','player','500','450','9');
so.addParam('wmode','opaque');
so.addParam('quality','high');
so.addParam('allowfullscreen','true');
so.addParam('allowscriptaccess','always');
so.addParam('flashvars','playerOpts=advertList*^0^00:00:00:000^00:00:05:000^image^image-ad.jpg
^http://swfkits.com^_blank^^1^0^*s'); /*no line break here*/
so.write("flashcontent");

[/code]

The line of the red code is the flashvars code for inserting the image-ad into the first video.