Publisher » PUB - Tutorials

ID #1030

AdultVideoScript How to setup FlowPlayer and show video player ads ?

Setting Up FlowPlayer in AVS (AdultVideoScript )

Adult Video Script is easy to setup with an alternative video player. Heres is a simple howto on how to integrate the FlowPlayer with Adult Video Script (removing the AVS flash player).

Installing the FlowPlayer files on the server

First, get the latest version of the player from FlowPlayer website .

Upload the files in those locations:

/WHERE/AVS/IS/INSTALLED/media/player/flowplayer-3.2.2.swf

/WHERE/AVS/IS/INSTALLED/media/player/flowplayer.controls-3.2.1.swf (optional)

/WHERE/AVS/IS/INSTALLED/media/player/js/flowplayer-3.2.2.min.js

If you are using lighttpd pseaudo-streaming module, also install the pluigin for flowplayer. You can download it here. Upload the file:

/WHERE/AVS/IS/INSTALLED/media/player/flowplayer.pseudostreaming-3.2.2.swf (optional)

Create the Video Player template

In the directory /WHERE/AVS/IS/INSTALLED/templates/frontend/CURRENTLY-USED-TEMPLATE/ , create the file video_flowadx.tpl and add these lines:

<script type='text/javascript' src="{$baseurl}/media/player/js/flowplayer-3.2.0.min.js"></script>

<a href="{$baseurl}/media/videos/flv/{$video.VID}.flv"
style="display: block; width: {$player_width}px; height:500px;" id="flowplay"> </a>

<script type='text/javascript'>
{literal}flowplayer("flowplay", { {/literal}
src: '{$relative}/media/player/flowplayer-3.2.1.swf',
{literal}
wmode: 'transparent'
},
{
clip: {
autoPlay: true,
autoBuffering: true
}

});{/literal}
</script>

If you modified your template, don't forget to configure the proper dimension for the flash player. Also, if you are using the lighttpd module to protect your content, follow the plugin instructions to setup the pseudostreaming properly.

Setup your template to use the new player

Edit /WHERE/AVS/IS/INSTALLED/templates/frontend/CURRENTLY-USED-TEMPLATE/video.tpl and
replace following line:

{include file='video_vplayer.tpl'}

with (look for all instances):

{include file='video_flowadx.tpl'}


Test your site to confirm the new player work

The FlowPlayer should now be used to display your movies. Make sure everything works the way you expect before continuing to the next step.

Configure AdXpansion video ads to display in your player

Once you are certain the video player works properly, you can make the necessary changes to the file /WHERE/AVS/IS/INSTALLED/templates/frontend/CURRENTLY-USED-TEMPLATE/video_flowadx.tpl , you can refer to the instruction given in the other tutorial to get the proper code to add to your template.

Advanced Usage:

Using mod_secdownload with flowplayer and AVS

If you are using mod_secdownload, you need to install and run a special flowplayer plugin called Secure Streaming.

First, download the pluging and place it at the same location then the flowplayer flash file. /WHERE/AVS/IS/INSTALLED/media/player/flowplayer.rtmp-3.2.1.swf

Next, modify your video template /WHERE/AVS/IS/INSTALLED/templates/frontend/CURRENTLY-USED-TEMPLATE/video_flowadx.tpl . You will need to configure the token to be the same thing then what is configured in your lighttpd configuration.

<script type='text/javascript' src="{$baseurl}/media/player/js/flowplayer-3.2.0.min.js"></script>
<script type='text/javascript'
src='http://ads.adxpansion.com/public/js/showads.php?zone_id=65&type=flowplayer'></script>

<a href="{$baseurl}/media/videos/flv/{$video.VID}.flv"
style="display: block; width: {$player_width}px; height:500px;" id="flowplay"> </a>

<script type='text/javascript'>
var tstamp={$smarty.now};

{literal}flowplayer("flowplay", { {/literal}
src: '{$relative}/media/player/flowplayer-3.2.1.swf',
{literal}
wmode: 'transparent'
},
{
plugins: {
secure: {
url: 'flowplayer.securestreaming-3.2.0.swf',
timestamp: tstamp.toString(16).toUpperCase(),
token: 'simplek'
}
},


clip: {
autoPlay: true,
autoBuffering: true,
urlResolvers: 'secure'

}

});
$f().adxpansion();
{/literal}
</script>

Using PseudoStreaming with lighttpd

If you want to allow your surfers to seek anywhere in yoru movies and have lighttpd configured accordingly, here's how t oconfigure the plugin properly:

<script type='text/javascript' src="{$baseurl}/media/player/js/flowplayer-3.2.0.min.js"></script>
<script type='text/javascript'
src='http://ads.adxpansion.com/public/js/showads.php?zone_id=65&type=flowplayer'></script>

<a href="{$baseurl}/media/videos/flv/{$video.VID}.flv"
style="display: block; width: {$player_width}px; height:500px;" id="flowplay"> </a>

<script type='text/javascript'>
{literal}flowplayer("flowplay", { {/literal}
src: '{$relative}/media/player/flowplayer-3.2.1.swf',
{literal}
wmode: 'transparent'
},
{
plugins: {
lighttpd: {
url: 'flowplayer.pseudostreaming-3.2.2.swf'
}
},


clip: {
autoPlay: true,
autoBuffering: true,
provider: 'lighttpd'

}

});
$f().adxpansion();
{/literal}
</script>

Tags: -

Related entries:

Last update: 2010-06-16 09:02
Author: AdXpansion Admin
Revision: 1.2

Digg it! Print this record Send to a friend Show this as PDF file

You cannot comment on this entry