![]() ![]() ![]() ![]() |
Table of Contents |
7.4 BannerPlayer Applet
Introduction
The BannerPlayer applet is provided as a sample Java applet you can embed in your chat rooms to display banner advertisements. The Logo area to the left of the main VolanoChat window and the Banner area at the top of each chat room window are both embedded Java applets. This provides for displaying local banner advertisements, or banner advertisements from remote ad servers such as LinkExchange, FlyCast or DoubleClick, to name a few. You can replace the bannerplayer applet with any Java applet of your choice, such as an audio or video applet. (See [7.5] Adding Other Applets.)
An example instance of the BannerPlayer applet is shown below:
Applet 1: BannerPlayer applet.
This example displays three rotating banner images with a static navigation bar below the banner area. The banner images are displayed in the standard full banner image size of 468 by 60 pixels. The HTML tags used to create the BannerPlayer applet instance shown above are:
<applet codebase="vcclient" code="COM.volano.BannerPlayer.class" width="468" height="76"> <param name="background" value="#000000"> <param name="foreground" value="#FFFFFF"> <param name="banner.width" value="468"> <param name="banner.height" value="60"> <param name="banner.cache" value="true"> <param name="banner.1" value="15 welcome.gif http://www.volano.com/"> <param name="banner.2" value="15 help.gif help.html"> <param name="banner.3" value="15 chatwithme.gif http://www.volano.com/"> <param name="bar.width" value="468"> <param name="bar.height" value="16"> <param name="bar.cache" value="true"> <param name="bar.ismap" value="false"> <param name="bar.image" value="0 bar.gif http://www.volano.com/vcclient/help.html"> </applet>
The banner images are linked to static Web pages with absolute and relative addresses, while the navigation bar is linked to a non-existent CGI script in order to demonstrate the use of image map coordinates.
When embedding the BannerPlayer in the chat rooms of your VolanoChat applet, simply place these applet parameter definitions within a text file containing the same names and values. For example, the parameters shown above are defined as a Java properties file like this:
background=#000000 foreground=#FFFFFF banner.width=468 banner.height=60 banner.cache=true banner.1=15 welcome.gif http://www.volano.com/ banner.2=15 help.gif help.html banner.3=15 chatwithme.gif http://www.volano.com/ bar.width=468 bar.height=16 bar.cache=true bar.ismap=true bar.image=0 bar.gif /cgi-bin/clickbar?
You then tell the VolanoChat applet where to find the properties for its embedded applet with the banner.parameters
property in your properties.txt file. See the [7.1.2] VolanoChat Properties page for more information.
Parameters
Sample BannerPlayer parameters defined as Java properties are found in the BannerPlayer.txt
file provided with VolanoChat. The complete list of all possible BannerPlayer applet parameters is shown below.
background
- the background color of the applet, specified in the format
#RRGGBB
, whereRR
is the red hexadecimal value,GG
is the green hexadecimal value, andBB
is the blue hexadecimal value. The background is visible when displaying transparent images or when the images are smaller than the applet size. The default is the background color of the window. foreground
- the foreground color of the applet, specified in the format
#RRGGBB
, whereRR
is the red hexadecimal value,GG
is the green hexadecimal value, andBB
is the blue hexadecimal value. The foreground color is the color of the text used to display error messages when the applet is unable to load an image. The default is the foreground color of the window. banner.width
- the width in pixels at which to display the banner images. The default is 468 pixels.
banner.height
- the height in pixels at which to display the banner images. The default is 60 pixels.
banner.cache
true
if the banner images should be cached; otherwisefalse
. The default isfalse
. A value offalse
flushes all images previously displayed from the URL before invoking the URL again for another image.banner.ismap
true
if the banner is an image map; otherwisefalse
. The default value isfalse
.banner.char
- a character that will be substituted for a unique integer counter if present in either the source or link URL. The default is no character substitution in the URLs. If more than a single character is specified, only the first character of the string is used.
banner.n
- the image specifications, where
n
is a positive integer that defines the sequence number of the banner image. The numbers must be sequential and start with the number 1. bar.width
- the width in pixels at which to display an optional navigation bar. The default is 468 pixels.
bar.height
- the height in pixels at which to display an optional navigation bar. The default is 16 pixels.
bar.cache
true
if the bar image should be cached; otherwisefalse
. The default isfalse
. A value offalse
flushes all images previously displayed from the URL before invoking the URL again for another image.bar.ismap
true
if the navigation bar is an image map; otherwisefalse
. The default value isfalse
.bar.char
- a character that will be substituted for a unique integer counter if present in either the source or link URL. The default is no character substitution in the URLs. If more than a single character is specified, only the first character of the string is used.
bar.image
- the image specifications for the navigation bar, where the time value is ignored. To omit the navigation bar, leave this parameter undefined.
Image specification consists of three elements separated by spaces or tabs:
time src href
where:
time
- is the time in seconds for the image to be displayed. A time of zero means to display the image until the applet is stopped.
src
- is the absolute or relative image source URL. A relative URL is normally assumed to be relative to the applet code base. When the BannerPlayer applet is embedded into the VolanoChat applet, a relative URL is assumed to be relative to the location of the BannerPlayer's properties file.
href
- is the absolute or relative URL to which this image is linked, or the keyword
null
if the image has no link. A relative URL is normally assumed to be relative to the applet code base. When the BannerPlayer applet is embedded into the VolanoChat applet, a relative URL is assumed to be relative to the location of the BannerPlayer's properties file.
Images can be animated GIF files, standard GIF files, or JPEG files. Specify a time of zero to display an image indefinitely. For example, you could specify the last image in a series to be displayed indefinitely in order to prevent the sequence from being repeated.
banner.ismap
or bar.ismap
is set to true
, its corresponding links are converted into image maps with the correct coordinates of the mouse cursor appended to the addresses. You'll see this in action if you look at the link in your browser status area while you move your mouse cursor over the navigation bar in the BannerPlayer applet shown above.![]() ![]() ![]() ![]() |
XHTML 1.0 | Table of Contents |