New xenForo integration available, check out the details on our blog!

Support Garage

Get Help With Your AVChat Products & Services

Getting Started With AVChat Standalone

6. Features

1. Quick Overview

1.1 File Structure
AVChat has 2 groups of files:
  • client side files, that go on your web server (html, js, xml, swf files, etc.) and are loaded by your web site users in their browsers
  • media server files that go on your media server (Red5,FMIS,Wowza) these handle all the logic of sending messages between users, banning IPs, accepting connections, etc...

1.2 Configuration files

AVChat has 2 main configuration files:
  1. avc_settings.xxx which you will find in your AVChat installation folder on your web server (its's part of the client side files) Starting with build 2060 all the settings from avc_settings.php and avc_settings.aspx.cs were moved to a new file avc_settings.xml from which they are imported. For simple ASP avc_setting.asp remains unchanged.
  2. media server configuration file which depending on the media server it's called:
    • settings.asc on FMS/AMS, you will find it in /applications/avchat30 on FMS or /FMSApps/avchat30 on AMS
    • avchat3.properties on Red5, you will find it in /webapps/avchat30
    • avchat3.properties on Wowza , you will find it in Wowza/conf/avchat30

There are other less important config files (like the video quality .xml file or the logback_avchat30.xml file on Red5 that specifies where the log files should be created) but we will cover them as needed below!

Back to top

1.3 File structure

AVChat ships in an archive that looks like this:
  • Files to upload to your website
    • audio_video_quality_profiles (folder containing audio video quality files in .xml format)
    • codebird-js
    • emoticons (folder containing sets of emote icons)
    • gender_icons
    • m build 2060 (folder containing HTML 5 mobile client files)
    • report_snaps
    • sounds (folder containing sounds used in the video chat in mp3 format)
    • tokens
    • translations (folder containing UI translations in .xml)
    • folderuploadedFiles (folder where files uploaded by users will go)
    • admin.html (html file that embeds admin.swf)
    • admin.swf (admin interface)
    • ajax-loading.gif
    • avc_settings.asp
    • avc_settings.aspx
    • avc_settings.aspx.cs
    • avc_settings.php
    • avc_settings.xml has been added started with build 2060
    • badnicks.xml (xml file containing the bad usernames that are now allowed in the chat)
    • badwords.xml (xml file containing the bad words that are banned in the chat)
    • bg.png
    • channel.html
    • exclamation-mark.png
    • favicon.ico
    • file_types.xml has been added starting with build 2060
    • fonts.xml (list of fonts that can be used in the chat)
    • fullStar.png (default logo image that is shown over all video stream to prevent them from being rebroadcasted)
    • genders.xml
    • gift.png
    • index.html (html file that embeds index.swf)
    • index.swf (user interface)
    • Mobile_Detect.php
    • mobile-icon.png
    • mod_icon.png
    • pattern_061.gif (old background)
    • ppvIcon.png
    • ppvUpdate.aspx
    • ppvUpdate.aspx.cs
    • ppvUpdate.php
    • Preview.swf (old background)
    • report_snapshot_upload.aspx
    • report_snapshot_upload.aspx.cs
    • report_snapshot_upload.php
    • rotate_messages.aspx
    • rotate_messages.aspx.cs
    • rotate_messages.php
    • search-icon.png
    • sendgift.aspx
    • sendgift.aspx.cs
    • sendgift.php
    • sendReport.aspx
    • sendReport.aspx.cs
    • sendReport.php
    • style.aspx
    • style.aspx.cs
    • style.php
    • style.css (old css file that controls the colors and fonts used throughout the video chat). Starting with build 2060 style.css has been replaced with style.xml for users with PHP, style css is still used for users with ASP.NET and ASP
    • style.xml
    • summertime.swf (nice animated background)
    • swfobject.js
    • tinycon.min.js
    • token_request.aspx
    • token_request.aspx.cs
    • token_request.php
    • token_verify.aspx
    • token_verify.aspx.cs
    • token_verify.php
    • upload.asp
    • upload.aspx
    • upload.aspx.cs
    • upload.php
    • uploadclass.asp
    • wall.jpg (old background)
    • wget.aspx
    • wget.aspx.cs
    • wget.php
    • writeuserslist.aspx
    • writeuserslist.aspx.cs
    • writeuserslist.php
  • Files to upload to your media server (FMS/AMS)
  • Files to upload to your media server (Red5 0.8)
  • Files to upload to your media server (Wowza)

Back to top

1.4 How it works

Pretty simple actually:
  1. User goes to your web site and visit the page with the video chat (flash swf file) embedded on it
  2. The swf is downloaded to the users browser, it initializes and it loads avc_settings.xxx from your web server together with other config files: the language file, the emoticons files and some other config files
  3. Once everything is loaded the user is asked for a user name and gender (if it's not integrated)
  4. Once the user provides that info the swf attempts to connect to the media server
  5. Once connected to the media server the user can join rooms, send text message, view other user's streams and start their own audio video stream
  6. All data (audio, video, text) is sent from the user to the media server and from there it's routed as needed to all other users

There are other less important config files (like the video quality .xml file or the logback_avchat30.xml file on Red5 that specifies where the log files should be created) but we will cover them as needed below!

Back to top

1.5 Requirements

To run AVChat 3 on your website you will need:

  1. Web hosting for your website
  2. Your own media server or media server hosting
  3. Your web site users need Flash Player 11.1

1. Web hosting for your website:

Web hosting with PHP or ASP.NET support is needed. This is where the main video chat files will be placed and most probably where your web site is already located.

The mobile version of AVChat (added with build 2060) only works on web servers with PHP 5.3 support.

2. A media server:

AVChat (and all video chat apps including the peer to peer ones) needs a media server to transport data (audio, video and text chat) between your chat users. There are 3 big media servers out there: Red5 (free open source), Wowza and Adobe Media Srerver (former Flash Media Server).

AVChat is compatible with:

  • Adobe Media Server 5 Starter, Professional and Extended (Standard edition is not supported)
  • Flash Media Server 2, 3, 3.5, 4 and 4.5 (Flash Media Streaming Server is not supported)
  • Red5 0.8 and 1.0RC1
  • Wowza 1.7.x to Wowza Streaming Engine 4.0

The mobile version of AVChat only works on Red5 and Adobe Media Server (Flash Media Server).

You have 2 big options for getting a media server:

Option 1: a shared media server hosting account

A shared media server hosting account that will only handle data transfer (audio video text) between your users. You do not have to move your website.

Option 2: your own media server:

There are a few more exotic options too like FMS on Amazon Web Services (starting at $300/month), Wowza on Amazon Ec2 (starting at $108/month) and Wowza has a whole range of editions you can use like a 55$/month leased licenses.

3. End user requirements:

A modern Internet browser with Flash Player 11.1 or above installed. Nothing else! And it looks like at least 95% of the Internet users already have Flash Player 11 installed.

The need for Flash Player 11.1 starts with build 2330 of AVChat which adds H.264 encoding support.

Here's a quick scheme showing how it all works out:

End User Requirements Scheme

Back to top

2.1 Installation Instructions

Before you can install AVChat on your web site you need to download the AVChat archive from the client/trial area on nusofthq.com to your computer and extract its contents. There are 2 sets of files in that archive, one set goes on your media server (Part 2.1.1 below), and one set goes on your web server (Part 2.1.2 below).

Setting up the avchat30 application on the media server
Red5 installed on a dedicated server or VPS

Upload the avchat30 folder from the Files to upload to your media server (Red5) folder to the webapps folder of your Red5 installation (C:\Program Files\Red5\webapps on Win, /opt/red5/webapps/ on Linux)

Chmod the new avchat30 folder to 777.

Starting with build 2060 that supports the mobile client for Red5 ,disable some of the red5 logs, because when someone connects from the mobile client, red5 will generate a lot of logs. To do this go in the installation directory of your Red5 server -> conf – > logback.xml, and here edit the following 2 settings:
<logger name=”org.red5.io”>
<level value=”DEBUG” />
</logger>

Change the level value from “DEBUG” to “INFO”.

<logger name=”org.red5.server.adapter.MultiThreadedApplicationAdapter”>
<level value=”OFF”/>
</logger>

Change the level value from “DEBUG” to “OFF”.

Restart the Red5 server

You're done, move to step below

Wowza installed on a dedicated server or VPS

Upload the applications, lib and conf folders from the Files to upload to your media server (Wowza) folder to the root folder of your Wowza Media Server installation.

Restart the Wowza server

Starting with Wowza Media Server version: Wowza Streaming Engine 4.0, a new GUI has been added that allows you to control the server and individual applications. This can be accessed via browser at the following link http://WOWZA_SERVER_ADDRESS:8088/enginemanager/.

By default this version of Wowza Media Server comes with the default stream prefix mp4. This needs to be changed to flv. Here's how:

  1. Go to http://WOWZA_SERVER_ADDRESS:8088/enginemanager/
  2. From the top menu click the [Server] page
  3. In Server Setup click Edit
  4. Change Default Stream Prefix from mp4 to flv
  5. Save

You're done, move to step below

FMIS installed on a dedicated server or VPS

Upload the avchat30 folder (you will find it in your AVChat archive in the Files to upload to your media server (FMS) folder) to the applications folder of your FMIS installation (C:\Program Files\Macromedia\Flash Media Server\applications on Windows, /opt/macromedia/fms/applications/ on Linux)

Chmod the new avchat30 folder to 777

You're done, move to step below

AMS/FMIS hosting from influxis.com

Connect to your AMS host using a software like Filezilla with the credentials provided by influxis.com

Upload the avchat30 folder (you will find it in your AVChat archive in the Files to upload to your media server (FMS) folder) in the /FMSApps folder.

Login to influxis.com website, click the DevCenter Menu item at the top right, then click the "Launch FMS admin console" green button.

In the page that loads, use your server address and login/password to connect.

Click on the "New instance" select option at the bottom left corner, choose avchat30 and press Enter.

Your application strated and you are ready to connect AVChat.

AMS hosting from AVChat.net

Connect to your AMS host using a software like Filezilla with the credentials provided by us.

Upload the avchat30 folder (you will find it in your AVChat archive in the Files to upload to your media server (FMS) folder) in the /applications folder.

Provide 777 permissions for /avchat30 folder.

Connect to your AMS admin console at http://www.primcast.com/flash/ using your vhost name as "Server Name" and "Server Address".

Click on the "New instance" select option at the bottom left corner, choose avchat30 and press Enter.

Your application strated and you are ready to connect AVChat.

Back to top

Installing AVChat Standalone in a folder on your web site

If your web site is hosted somewhere where there's PHP support (most common):

  1. Using FTP, create a new folder in your web site and upload the contents of Files to upload to your web site (from the AVChat archive received) to it.
  2. Edit avc_settings.xml with a text editor, and set the <value> of the first tag - <connectionstring> like this: <value>rtmp://my-media-server.com/avchat30/_definst_</value> where my-media-server.com is the domain name or ip of the server where your media server is installed.
  3. CHMOD the uploadedFiles folder to 777 (otherwise the upload function might not work)
  4. CHMOD the folder tokens to 777.
  5. Go to http://yoursite.com/your_new_video_chat_folder/, log in using a user name and enter your license key in the dialog box that shows up after you connect. AVChat License key screen
  6. To access the admin interface go to http://yoursite.com/your_new_video_chat_folder/admin.html. We strongly suggest you rename the admin.html and admin.swf files for security reasons.

If your web site does not support PHP but it does support .NET/.aspx:

  1. Using FTP connect tio your website and create a new folder and upload to it the contents of Files to upload to your web site (from the AVChat 3 archive received).
  2. Edit avc_settings.xml with a text editor, and set the <value> of the <connectionstring> tag like this <value>rtmp://my-media-server.com/avchat30/_definst_</value> where my-media-server.com is the domain name or ip of the server where your media server is installed.
  3. Edit avc_settings.xml and set the and set the <value> of the <stylecssurl> tag to style.aspx like this <value>style.aspx</value> : AVChat style edit
  4. By default AVChat uses the PHP set of files (avc_settings.php, token_request.php, etc.) so we need to tell it to use the .aspx set of files. To do that we will use the sscode flash var. Open up index.html and admin.html in a text editor and find the following variable: sscode :"php", and replace with: sscode :"aspx", like this: switching AVChat to asp

    The sscode flash var pretty much tells the swf files what extensions to use for all the files it executs/loads. It defaults to php. You can use any extension you want (like jsp or asp) as long as the respective files are in the video chat folder.

  5. Go to http://yoursite.com/your_new_video_chat_folder/, log in using a user name and enter your license key in the dialog box that shows up after you connect. AVChat License key screen
  6. To access the admin interface go to http://yoursite.com/your_new_video_chat_folder/admin.html. We strongly suggest you rename the admin.html and admin.swf files for security reasons.

Back to top

2.2 Using different media server apps for 2 or more AVChat 3 installations

You might have 2 installations of AVChat, either on the same domain or on different domains that you want to connect to the same media server or to the same media server hosting account (for example from influxis.com). This article will show you how to do it!

Introduction

AVChat is made of 2 parts:

  • the client side files that go on your web server (html, xml, swf files, etc.)
  • the media server application (by default avchat30) that goes on your media server (Red5, FMIS, Wowza)

The connection string inside the avc_settings.xxx is made out of 4 parts and when combined it looks like this: rtmp://my-media-server.com/avchat30/_definst_ .

  • rtmp is the protocol used to communicate between the AVChat client and the media server.
  • my-media-server.com is the address where you host your Media Server (FMIS, RED5, Wowza), it can also be an ip.
  • avchat30 this is the (default) name of the application on the media server to which your users will connect.
  • _definst_ is the instance of the avchat30 app to which we connect (FMIS for example supports multiple instances).

To connect 2 installations of the AVChat client to the same media server, you will basically have to:

  1. duplicate the avchat30 app on the media server
  2. connect the second installation of AVChat to the new avchat30 app by changing the connection string.

On Red5 and Wowza it's slightly more complicated so make sure you read the long versions below.

Long version: Flash Media Interactive Server(FMIS)

On FMIS the process is pretty straight forward.

All the app files for AVChat are placed inside the FMIS/applications/avchat30 folder. To create a new avchat30 app:

  1. duplicate the avchat30 folder and
  2. rename the new one to avchat30_siteX (or to any other name that fits you).

You should now have 2 folders in your FMIS/applications folder:

  • applications/avchat30
  • applications/avchat30_siteX

That's all!

To connect AVChat to the new FMIS app use:
rtmp://my-media-server.com/avchat30_siteX/_definst_ in avc_settings.xxx .

Important Note !!! With this kind of setup 2 different versions of AVChat can be run at the same time by FMS/AMS. Just be carefull to connect the correct client to the correct server side application.

Long version: Red5

All the app files for AVChat are placed inside the Red5/webapps/avchat30 folder. To create a new avchat30 app:

  1. duplicate the avchat30 folder and
  2. rename the new one to avchat30_siteX (or to any other name that fits you).
  3. edit avchat30_siteX/WEB_INF/red5-web.properties and change: webapp.contextPath=/avchat30 to webapp.contextPath=/avchat30_siteX
  4. edit avchat30_siteX/WEB_INF/web.xml and change
    <context-param>
    <param-name>webAppRootKey</param-name>
    <param-value>/avchat30</param-value>

    to

    <context-param>
    <param-name>webAppRootKey</param-name>
    <param-value>/avchat30_siteX</param-value>
    </context-param>
  5. rename this file:
    webapps/avchat30_siteX/WEB-INF/classes/logback_avchat30.xml
    to
    webapps/avchat30_siteX/WEB-INF/classes/logback_avchat30_siteX.xml
  6. edit
    webapps/avchat30_siteX/WEB-INFclasses/logback_avchat30_siteX.xml
    and change:
    <jmxConfigurator contextName="avchat30" />
    to
    <jmxConfigurator contextName="avchat30_siteX" />
    and
    <fileNamePattern>log/avchat30.%d{yyyy-MM-dd}.log</fileNamePattern>
    to
    <fileNamePattern>log/avchat30_siteX.%d{yyyy-MM-dd}.log</fileNamePattern>

Steps 5 and 6 will ensure we will get separate logs for each app.

That's all!

To connect AVChat to the new Red5 app use:
rtmp://my-media-server.com/avchat30_siteX/_definst_ in avc_settings.xxx .

Important Note !!! With this kind of setup 2 different versions of AVChat can be run at the same time by Red5. Just be carefull to connect the correct client to the correct server side application.

Long version: Wowza

This one is very simple!

Just duplicate the Wowza/applications/avchat30 folder and rename it to avchat30_siteX. Do the same thing with the Wowza/conf/avchat30 folder: duplicate it and rename it to avchat30_siteX.

That's all!

To connect AVChat to the initial app/folder use:
rtmp://my-media-server.com/avchat30/_definst_ in avc_settings.xxx .

To connect AVChat to the second app/folder use:
rtmp://my-media-server.com/avchat30_siteX/_definst_ in avc_settings.xxx .

Important Note !!! Wowza does NOT support running of 2 different versions of AVChat at the same time. The steps provided above only allow the setup of multiple apps of the SAME version.

Back to top

2.3 Using different app instances for 2 or more AVChat 3 installations

There is also a 'quick and dirty' version of setting up multiple installations of AVChat to work on the same media server.

This version involves using application instances and can be used the same way with all of the 3 media-servers (FMS/AMS, Wowza and Red5).

To tell the media server to create a new instance of the same application simply edit the connection string of the second AVChat installation by changing _definst_ to any other specific name like newInstance.

So the final result will be:

  • One AVChat installation will have the default connection string type: rtmp://my-media-server.com/avchat30/_definst_
  • The second AVChat installation will have the modified connection string: rtmp://my-media-server.com/avchat30/newInstance

Now each installation will connect to it's own instance of the media server side AVChat application.

Important Note !!! By using this kind of setup both AVChat installations will use the same media server settings files (settings.asc/avchat3.properties). Also it is possible that at least one of the installations won't correctly update the external users list.

Back to top

2.4 Switching between the PHP and ASPX configuration files in AVChat

You have the possibility to switch the type of the configuration files used by AVChat to communicate with the web server (load the settings, request tokens, etc...).

Switching to other types of config files (like the .aspx ones also provided with AVChat) can be done via the sscode flash var explained below.

By default AVChat uses the PHP set of files (avc_settings.php, token_request.php, etc.) so we need to tell it to use the .aspx set of files. To do that we will use the sscode flash var.

Step 1: Open up index.html and admin.html in a text editor and find the following variable: sscode :"php", and replace with:
sscode :"aspx", like this: switching AVChat to asp

Step 2: Edit avc_settings.xml and set the and set the <value> of the <stylecssurl> tag to style.aspx like this <value>style.aspx</value> :
AVChat style edit

The sscode flash var, if not specified, defaults to php.

Instead of aspx you can also use cf or other file extensions as long as the appropriate files exist in the video chat folder.

Back to top

2.5 How to change the license key

Why would I change the license key?

  • Insert a new trial key.
  • Switch from trial to non-trial key.
  • Switch the domain on which the software will be used.
  • Upgrade from Lite (20 users) to Basic (40 users) for example.

What do I have to do?

  1. Log in the video chat using the admin interface (admin.swf)
  2. Click the [Settings] button at the top
  3. In the window that shows up, delete the old key from the text field and insert the new key
  4. Press the [Change Key] button
  5. If successful, you should now see the new limits/expiration date/domain above the license key text field!
AVChat edit license key

Back to top

2.6 Resetting the license key:

Why would I need to reset it?

If something goes awfully wrong and you find yourself locked out of the video chat (you’ve inserted a key for a domain to which you do not have yet access or has not yet been registered ) you can reset the license key.

What do I have to do?

  1. Delete this file
    • on Red5: red5/webapps/avchat30/persistence/SharedObject/_definst_/licensekey.red5
    • on FMIS: fms/applications/avchat30/sharedobjects/_definst_/licensekey.fso
    • on Wowza: wowza/applications/avchat30/sharedobjects/_definst_/licensekey.rso
  2. Restart Red5, FMIS or Wowza
  3. Enter the video chat and you will be asked for the key again!

Back to top

2.7 What AVChat build do I have installed?

To see what AVChat build you have installed you need to right click on the video chat software. The first item in the menu that shows up is the build number: AVChat build number

Why is the build number important?

The build number allows you to check if you have the latest version of our software. If your build number is 3078 and on the blog we announce a new release with the build number 3097, then it means you should consider upgrading your installation!

Each increment in the build number might represent any of the following things:

  • code cleaning
  • bug fix
  • new feature
  • new file
  • new entry in the translation file
  • new setting in the config files
  • etc...

but you should check the release notes for the exact new features and bug fixes in each build.

Build numbers on our demo of AVChat

Our online demo is frequently updated, so even tough the latest build available for download might be 3097, the demo might be 4210 for example. We update the demo more frequently to test new features and UI changes before we release these changes to the customers.

Back to top

2.8 What we need if you want us to install AVChat for you

Here's what we need to install AVChat for you:

  1. FTP access to the web site (or folder) where AVChat will be installed
  2. If you've purchased an integration kit we will need admin acess to the admin area of your CMS (Joomla!, Drupal, etc.).
  3. root ssh access to the vps/dedicated server where the media server (Red5/FMIS/Wowza) is installed (on Windows servers Remote Desktop access will do)
    OR (if you're using media server hosting)
    access to your media server hosting account (influxis.com and uvault.com provide shared FMIS/AMS hosting)

Please send the data to support after purchase.

AVChat installations are generally made in the same day if all the data above is correct and complete.

Back to top

2.9 What we need if you want us to install Red5/FMIS/Wowza for you

We offer Media Sever installation service for $99/one time fee.

Here's what we need to install the Media Server for you:

  1. root ssh access to the vps/dedicated server where you want the media server (Red5/FMIS/Wowza) to be installed if have a Linux Server, or Remote Desktop if you have a Windows server.
  2. If you want FMIS or Wowza installed, we will also need the licence key you received after purchasing them.

Please send the data to support after purchase.

Media server installations are generally made in the same day if all the data above is correct and complete.

Back to top

2.10 Switching from a trial version of AVChat to a licensed version

If you have a trial version of AVChat installed and purchased a licensed version, switching to production is very easy:

  1. Download the licensed version of AVChat
  2. Extract the archive
  3. Copy and replace index.swf and admin.swf from the extracted archive to your trial AVChat installation folder.

Also don't forget to replace the trial license key, with the purchased one.

That's it! You are now running the licensed version of AVChat.

Important note! Be careful that the trial version you had installed and the licensed version you bought correspond.

Back to top

3.1 Looks & design

Changing AVChat's background color

The background color of AVChat is defined in the HMTL web page that embeds the AVChat swf file. By default AVChat ships with 2 HTML pages: index.html (for the user interface, embeds index.swf) and admin.html (for the admin/moderator interface, embeds admin.swf).

In order to change the color of the user interface you will need to open index.html in a text editor and:

  • Find the following lines
    var params = {
    quality : "high",
    bgcolor : "#272727",
    play : "true",
    loop : "false",
    allowFullScreen : "true"
    };
    and replace "#272727" with your desired color.

Hint: you can use a color picker like this

Done.

Now, do not forget to save and upload the modified index.html to your web site.

The same procedure applies to admin.html.

Back to top

3.2 Changing AVChat's background image

AVChat can display an image as it's background.

This image can be specified in the style.css file. The last build's default image is bg.jpg

How to do it

Open the style.xml file with a text editor and at the beginning, you'll see this paragraph:

<backgroundArea>
  <backgroundImageUrl>bg.jpg</backgroundImageUrl>
  <backgroundImageScale>stretch</backgroundImageScale>
  <backgroundImageAlpha>100</backgroundImageAlpha>
</backgroundArea>

Rename the bg.jpg with the name of your image uploaded on your AVChat installation folder.

You can also change the transparency of this background image by changing the value of the backgroundImageAlpha variable. The background color will be seen trough a partially transparent background image!

The image will automatically tile to fit the size of the video chat software.

Done.

Back to top

3.3 Changing the sounds used in AVChat

You can change the sounds used throughout AVChat with your own sounds.

AVChat right now uses six mp3 sounds which you can find in the sounds folder:

  • alert.mp3 (used when a text chat message kicks in)
  • private.mp3 (used when receiving private messages)
  • videorequest.mp3 (used whena request to view your private stream comes in)
  • buzz.mp3 (used when someone gives you a buzz)
  • online.mp3 (used when someone joins a room)
  • offline.mp3 (used when someone leaves a room)

How to change them: Just replace the existing mp3's with your own mp3's. Try to keep their size as small as possible because these sounds are loaded at runtime.

To disable the sounds just delete the mp3's (in the future we will have an option in avc_settings.xxx for this).

Back to top

3.4 Changing the size of the AVChat flash video chat software

You can change the size of the AVChat user/admin Interface to better fit with the design and size of your website.

The size of the AVChat user and admin interfaces is defined in the HMTL pages that embed these swf files. By default AVChat ships with 2 HTML pages: index.html (that embeds the user interface: index.swf) and admin.html ( that embeds the admin interface: admin.swf).

In order to change the size of the AVChat user interface for example, you will need to edit index.html with a text editor and:

  • find the following line:
    swfobject.embedSWF("index.swf", "myContent", "100%", "100%", "10.3.0", "", flashvars, params, attributes);
  • and replace "100%", "100%" with your desired dimensions (first width, second height).

Now, do not forget to save and upload the modified index.html to your web site, and refresh.

The same procedure applies to admin.html.

Back to top

3.5 Changing the looks of the windows inside the video chat

The style.xml file controls (among other things) the looks of the windows inside the video chat. By editing the style.xml file you can change:

  • the color of the windows (backgroundcolor:#123456;)
  • if the windows have rounded corners or not (cornerradius:4 , set to 0 for straight corners)
  • the space between the windows (margin:4)
  • the space between the margin of the windows and its content (padding:4)

Back to top

3.6 Changing the fonts used inside the video chat

The style.xml file controls (among other things) the fonts used throughout the video chat. By editing the style.css file you can change for every group of fonts (like titles, side menu links, etc...):

  • the font face (fontfamily:_sans)
  • the size of the font (fontsize:16)
  • the font weight (fontweight:bold)
  • the color of the text (color:#ffffff)

Back to top

3.7 Changing the male female couple icons

Starting with build 1880 the genders are imported from genders.xml along with attributes like icon image URL's.

How to do it:

  1. Upload your new gender icons in the /gender_icons folder located in your AVChat installation.
  2. Open the genders.xml file and edit the lines, for example:
    <gender id="cat" label="Cheshire Cat" iconUrl="gender_icons/cheshire_cat_32.png" adminOnly="false" sortPriority="b"/>
    rename the id, label and iconUrl corresponding to your new icon and it will become: <gender id="new_icon" label="New Icon" iconUrl="gender_icons/new_icon.png" adminOnly="false" sortPriority="b"/>
    (where "label" represents the gender name displayed in the chat)

As explained in the XML file, the only thing that should not be changed are the ID's of the male, admin and hidden genders.

Back to top

4 Audio Video Quality

AVChat (through Flash Player) captures raw audio and video data from your web cam and microphone, encodes/compresses it, and sends it to the media server from where it is sent to the other users.

For encoding the video data AVChat uses Sorenson Spark H.263. For encoding audio data AVChat uses by default the newer Speex codec (it also supports the older NellyMoser audio codec).

AVChat put no limits on the audio video quality experienced by your users and in that spirit it opens up all the available audio and video settings to you, the web site owner (our client), to play with. You can change the video resolution, picture quality, frame rate and sound quality.

Read below to learn how to play with all those settings and more!

Back to top

4.2 Audio/video quality profile files explained

In the installation folder of AVChat you will find a folder named audio_video_quality_profiles. It contains several .xml files. We call these .xml files audio video quality profiles.

Each .xml file contains the settings (resolution, frames per second, picture and sound quality, etc.) used to encode the video/audio data that's coming from your computer's webcam and microphone. AVChat ships with several such profile files that you can use out of the box each configured to give you the best possible audio and video quality at a certain data rate from 96 to 768kbits/s.

The default audio/video profile used by AVChat is 512k_high_motion_medium_picture_quality_high_sound_quality.xml. This profile will consume (for one stream) maximum 469kbits/s for video and 42 Kbits/s for audio, total: 511kbits/s.

To make AVChat use another audio/video quality profile file for when users start broadcasting their web cam and microphone you need to change the value of the miccamsettingsurl variable inside avc_settings.php (or avc_settings.aspx.cs) to point to the .xml file of your choice.

You can also make your own quality profiles or edit the existing ones.

Back to top

4.2 Editing existing quality profile files :

Each of the quality profile files has the exact same XML structure:

<item>
   <nm>128 ISDN</nm>
   <df>0</df>
   <bytes>16000</bytes>
   <q>0</q>
   <fps>7</fps>
   <kfps>28</kfps>
   <w>200</w>
   <h>150</h>
   <displayWidth>256</displayWidth>
   <displayHeight>192</displayHeight>
   <snd>speex6</snd>
   <sndSilencelevel>0</sndSilencelevel>
   <vcodec>sorenson</vcodec>
</item>

Each node/value pair explained:

  • Video settings
    • <bytes> This is the maximum amount of bytes that the video (not audio) can consume per second. If it is set to 0, the video stream from the user to the media server will consume as much bandwidth as possible to maintain the picture quality. Multiply by 8 to get the value in bits.
    • <q> This is the picture quality. If set to 0 it will use as much quality as possible, without exceeding the <bytes> value. Maximum is 100 but that will consume EXCESSIVE bandwidth. A value between 85-95 will produce really good picture quality!
    • <fps> This defines the video frame rate. 10, 15, 30 fps, etc... . Some old web cams can only capture up to 15fps.
    • <kfps> Key frames. This tells AVChat that every <kfps> frames a full frame will be sent to the media server . The rest of the frames contain just the changes from the previous frame. By default you should set this to <fps>*4
    • <w> The desired width of the captured video in pixels
    • <h> The desired height of the captured video in pixels
    • <displayWidth>The desired width of the video display
    • <displayHeight>The desired height of the video display
    • <vcodec>The video codec used to encode the live stream, with possible values being sorenson or h264. Use the h264 value to encode video with H.264 codec (Main Profile with Level 3_1 are used, for more details click here) (This setting has been added in build 2330)

  • Audio settings:
    • <snd> The sound rate. The higher the better but it also consume more bandwidth.

      The snd tag controls the quality/bandwidth of audio.Flash Player supports encoding sount in 2 codecs: NellyMoser and Speex.

      Speex is newer,better and open source, that's why its used by default.

      Possible values:

      • 44 : NellyMoser, highest quality
      • 22 : NellyMoser, medium high quality
      • 11 : NellyMoser, medium low quality
      • 8 : NellyMoser, low quality
      • 5 : NellyMoser, lowest quality
      • speex10 : Speex, default value for this profile, highest quality, uses 42.2kbits/s of bandwidth
      • speex9 : 34.2kbits/s
      • speex8 : 27.8kbits/s
      • speex7 : 23.8kbits/s
      • speex6 : Speex, uses 20.6kbits/s of bandwidth
      • speex5 : 16.8kbits/s
      • speex4 : 12.8kbits/s
      • speex3 : Speex, low quality, lowest usable quality, uses 9.80kbits/s
      • speex2 : 7.75kbits/s
      • speex1 : 5.75kbits/s
      • speex0 : Speex, lowest quality, not really usable, uses 3.95kbits/s
    • <sndSilencelevel> Takes values from 0 to 100. Flash Player will consider any sound that is lower than the value of this tag as "silence" and thus will not send any data to the media server. Use 100 if you want to never send audio to the FMS server. Use 0 if you always want to send to the FMS server whatever the mic captures (even noise). We recommend using 0 since if you use the default (10) Flash Player will stop broadcasting sound when you stop speaking. Even though this seems like a cool feature that cuts bandwidth in reality the listeners will frequently get the feeling that you've been cut off.

  • Misc settings:
    • <nm> This is the name of the connection type. The value of this tag is not used in AVChat.
    • <df> If set to 1, this will be the connection type that will be used by default. The value of this tag is not used in AVChat.

To edit a quality profile file open it in Notepad or any other text editor, change the value that you want to change, save it back to the web server. Now reload AVChat in the browser and start your webcam, you should see the changes in effect.

Back to top

4.4 Making your own quality profile file

To make your own audio video quality profile, duplicate one of the existing xml files, give it a unique name and edit it with a text editor. To use it, upload it to your web server and set the value of the miccamsettingsurl variable in the avc_settings.php/aspx.cs configuration file to it.

You can also use one quality profile file with higher quality video for "gold" users and one with lower quality video for "free" users.

There is an interesting article on the Macromedia web site regarding best practices for encoding live flash video. Click here to open it.

Back to top

5.1 How to turn on token based authentication in AVChat

Starting with build 900, AVChat 3 introduces a new security feature called “token based authentication”.

When enabled this prevents 3'rd party swf files (hosted on other web sites than your own or by malicious users) to connect to your media server. There are other security measures in place to prevent this however token based authentication is the most secure!

This feature is turned off by default because with it enabled:

  • it takes slightly more time for users to connect to the media server
  • it might cause some connection attempts to the media server over slow Internet connections to fail
  • we only had a few clients that really needed this feature
  • we can't really quite make it work automatically out of the box, it needs to be configured manually

How o turn it on:

Once you have AVChat installed turning this feature on is simple:

  1. Edit the settings file on the media server:
    • on Red5 its Red5/webapps/avchat30/avchat3.properties
    • on Wowza its Wowza/conf/avchat30/avchat3.properties
    • on FMIS its FMIS/applications/avchat30/settings.asc
  2. Set the value of the tokenUrlLocation variable to the absolute url/path to token_verify.php (token_verify.php is in the folder where you installed AVChat on your website). Good example: http://avchat.net/demos/av30/token_verify.php . If you use aspx on your web server put the path to token_verify.aspx instead.
  3. Restart the media server.

Back to top

5.2 Protection against video streams being rebroadcasted (watermarking)

Some of our clients had issues with nasty users staying in their video chat and re-broadcasting streams from their video chat to other sites using screen sharing software.

So to protect against that we ended up putting the logo of our client (a watermark) over all the video streams.

By default AVChat uses a little star (fullStar.png). You can view it in our AVChat demo and on your (default) installation.

To change the star with your own logo edit avc_settings.xxx and change the value of the watermarkForOtherPeoplesStreams variable.

The watermark will be added to the top left of all the video streams.

Back to top

5.3 Rtmps and rtmpe for encrypted communications

AVChat supports both rtmps and rtmpe for encrypted data transfer between the users and the media server but depending on your media server you can use one or both:

  • Red5 supports only rtmps
  • FMIS and Wowza support both rtmps and rtmpe

To enable rtmps or rtmpe check with your media server documentation. We can also enable it for you trough the AVChat Securitization service.

Back to top

5.4 Enabling SWF Verification on FMIS 3.5 and above

FMIS has this very cool security feature called SWF Verification where you can tell it to only accept connections from known swf files. How does he know the swf files? Well... you upload them to the FMIS server. Simple and brilliant!

This feature can protect you from custom made swf files attempting to connect to your media server. Together with token based authentication it would make the most secure setup someone can wish for.

To to turn it on you need to do two things:

  • First, change the <SWFVerification enabled="false"> to "true" in your applications/avchat30/Application.xml file to turn on the feature.
  • Create a new folder: applications/avchat30/SWFs and put the index.swf and admin.swf with which AVChat ships in there
  • Having changed the server configuration, you are going to need to restart your FMS 3.5 server.

If you're passionate about this stuff there's a more detailed article explaining SWF Verification in more depth on the adobe.com web site: adobe.com/devnet/flashmediaserver/articles/

Unfortunately SWF Verification is only available with FMS3 or later. Red5/Wowza do not have this feature.

Back to top

5.5 Limiting ip's from which admins can connect and execute admin functions

Because we give free trials to just about anyone, our script gets into a lot of hands, some of them are not well intended.

One of the easiest ways to protect your AVChat from nasty surprises is to limit the ip's from which admins can connect trough the admin interface (admin.swf) and execute admin functions.

You just have to edit the settings file on the media server:

  • on Red5 its Red5/webapps/avchat30/avchat3.properties
  • on Wowza its Wowza/conf/avchat30/avchat3.properties
  • on FMIS its FMIS/applications/avchat30/settings.asc

And search for the adminsAllowedFromTheseIps variable. Set its value to your ip or to the range of ip's from which admins will be allowed to connect.

Starting with build 1144 the verification is done every time a admin executes an admin function (kick, ban, change license key, etc.) not just on connection.

There are more comments in the above mentioned settings files that will explain exactly how to add individual ips and ip ranges. After editing those files don't forget to restart the media server.

Back to top

5.6 Allowing connections from AVChat files installed on localhost

Because of security reasons you can not connect to the avchat30 application on the media server with AVChat client side files (html/swf) hosted on localhost. When you try to do that you will gen an error on connection.

To allow connections from AVChat installed on localhost you need to edit the settings file on the media server:

  • on Red5 its Red5/webapps/avchat30/avchat3.properties
  • on Wowza its Wowza/conf/avchat30/avchat3.properties
  • on FMIS its FMIS/applications/avchat30/settings.asc

And search for the allowLocalhostConnections variable. Set it to true and restart the media server.

Back to top

5.7 Manually removing the banned ips file

If you've banned yourself out of the video chat you will need to manually delete the ips file and restart the media server.

on Red5 you will need to delete the bannedips.red5 and bannedusernames.red5 file from this folder: webapps\avchat30\persistence\SharedObject\_definst_ and restart Red5.

on FMIS you need to delete the bannedips.fso and bannedusernames.fso file from this folder: applications\avchat30\sharedobjects\_definst_.

Back to top

6.9 Changing emote icons in AVChat

AVChat 3 supports emote icons and you can add your own emote icons if you want to!

By default AVChat 3 uses the emote icons in the emoticons/squarePack folder. The list of available emote icons in this pack is contained in emoticons.xml. You can edit this file to add and remove emote icons.

Adding emote icons to the standard pack

  1. Put the emote icon file (swf, jpg, png, gif) in the emoticons/squarePack folder
  2. Edit emoticons.xml and add a new e element before the final </emoticons> tag like so: <e text=":newemoteicon:" url="emoticons/squarePack/newemoteicon.png" w="18" h="18"></e>
  3. Upload the new emote icon file and the changed emoteicons.xml file to your web site.

In the <e text=":newemoteicon:" url="emoticons/squarePack/newemoteicon.png" w="18" h="18" ></e> XML code:

  • :newemoteicon: is the text that will be replaced in the text chat with the new emote icon
  • emoticons/squarePack/newemoteicon.png is the path to the emote icon
  • w="18" and h="18" represent the width and height of the emote icon

Some things you should know:

  • Multiple entries for the same emote icon is supported. To setup multiple entries just add diferent emote icon codes in the text attribute of the <e> tag separated by spaces like so: <e text=":emoteCode1 emoteCode2 emoteCode3" url="emoticons/squarePack/newemoteicon.png" w="18" h="18"></e>
  • Animated GIF's are not supported (Flash Player limitation)
  • You can also make your own pack with its own emoteicons.xml list file. The path to the emoteicons.xml file used by AVChat 3 can be changed from avc_settings.xml via the emoticonsurl variable.

Back to top

6.10 Where are the text chat transcripts?

AVChat saves a history of all the text chat in all the rooms including private chats on the media server!

On FMS they will be saved in the FMS/applications/avchat30/logs/ folder and they will have this format: _definst__r0_2010_12_20.txt, where _definst_ is the application instance name, r0 is the room id, and 2010_12_20 is the date . To disable it edit FMS/applications/avchat30/settings.asc and set application.loggingEnabled=false

On Red5 they will be saved in Red5/webapps/avchat30/avchat3_transcripts/ folder and they will have this format: _definst__r0_2010_12_19_log.txt . To disable it edit Red5/webapps/avchat30/avchat3.properties and set loggingEnabled=false

On Wowza they will be saved in Wowza\applications\avchat30\avchat3_transcripts folder and they will have this format: _definst__r0_2010_12_19_log.txt . To disable it edit Wowza/conf/avchat30/avchat3.properties and set loggingEnabled=false

Back to top

6.10.1 How to delete the text chat logs?

You have 2 options here.

First of them and the most easier is to access the AVChat admin interface and click the "EALL" button.

This action will delete all the exisiting messages from all rooms instantly.

Erase all button

The second option is to connect to your server by SSH, access the text chat transcripts folder, delete the files manually and restart the media server.

You will find the text chat transcripts by the filename which is in the format r0textchat.
The path to these files is:

  • avchat30/SharedObjects/_definst_ on Red5
  • avchat30/sharedobjects/_definst_ on FMS/AMS
  • applications/avchat30/sharedobjects/_definst_ on Wowza

The files extensions are:

  • .red5 on Red5
  • .fso on FMS/AMS
  • .rso on Wowza

Back to top

6.11 How to delete empty rooms automatically

Starting with build 2160 the delete empty rooms mechanism has been redone:

The media server now constantly checks for empty rooms and if:

  • deleteRoomsWhenTheyBecomeEmpty = true
  • the room is not protected (not included in the doNotDeleteTheseRoomsWhenTheyBecomeEmpty array) and
  • is inactive for more than the number of hours expressed by a new setting ( deleteEmptyInactiveRoomsOlderThan )
  • then the room is deleted.

    [DEPRECATED] AVChat can be set up to remove empty rooms automatically as soon as the last person leaves the room.

    By default this feature is turned off. To turn it on you need to edit the config file on the media server (avchat3.properties on Red5/Wowza and settings.asc on FMS) and set

    deleteRoomsWhenTheyBecomeEmpty=true

    You can also use the doNotDeleteTheseRoomsWhenTheyBecomeEmpty option to protect some rooms (like the main Lobby) from being removed like this:

    Red5 & Wowza:
    doNotDeleteTheseRoomsWhenTheyBecomeEmpty=r1,r2

    FMS: application.doNotDeleteTheseRoomsWhenTheyBecomeEmpty=["r1","r2"]

    More details about each of the above config options and the exact syntax are in the config files. The location of the config files is detailed here.

    Back to top

    6.12 How to edit/add genders

    Starting with build 1880 AVChat import the genders from a genders.xml file. AVChat comes with a couple of predefined genders, but these can be edited or removed, and others can be added. As explained in the xml file, the only thing that should not be changed are the ID's of the male, admin and hidden genders, but other attributes of these genders can be changed such as the iconUrl or the sortPriority.

    To add a new gender, simply add a new line in the xml file specifying all the attributes like so:

    <gender id="female" label="Girl" iconUrl="gender_icons/girl.png" adminOnly="false" sortPriority="c"/>

    And don't forget to add the icon image in the folder that you specified in the iconUrl attribute, otherwise the icon image won't show in the login area, userlist area and statusbar. Also the recommended image icon size is 32x32 px.

    Back to top

    6.13 Login area

    Starting with build 1880 AVChat 3 has a new and more customizable login area,with 2 main screens, which can be activated using the tab at the top : Guest Login and Register & Sign in.

    The default selected tab can be set using the setting in avc_settings.xxx selectedTabInLoginScreen.

    Also if the setting showLoginError is enabled the Guest Login screen and corresponding tab disappear altogether.

    The Guest Login tab contains the textfield for the username, the gender selection that is customizable ( see 6.12 for more details), the connect button and a new zone that allows the use of other existing accounts such as Facebook, for the authentication of users. This zone can also be enabled/disabled with enableOtherAccountOptions from avc_settings.xxx.

    The Register & Sign In tab contains the register and sign in buttons that redirect the users to the respective areas of the site.

    Back to top

    6.14 How to setup AVChat for Facebook authentication

    Starting with build 1880 AVChat 3 supports Facebook authentication.

    This feature allows your users to connect to your AVChat area using their Facebook account.

    Clicking the Facebook logo in the login screen will open a popup asking for user's Facebook credentials. If he is already signed in on that browser, the connection will be done automatically.

    Flash Video Chat Facebook connection

    AVChat 3 will now will use the name, profile picture and profile link from Facebook.

    Flash Video Chat Facebook profile page

    This feature is controlled by the enableOtherAccountOptions setting located in the avc_settings.xml file.
    If set to 0, the feature will be disabled.

    There a few steps needed in order to set this up:

    1. Go to:  http://developers.facebook.com
    2. Create a new Facebook app and enter a name for it
    3. Enter the CAPTCHA if asked for it
    4. In the new screen that shows up enter your domain name in App Domains
    5. Select Disabled for Sandbox Mode
    6. Click Website with Facebook Login and enter your domain name againFacebook API Key
    7. Open up the index.html
    8. Find the line where the app id is specified ( the variable appId) and replace the existing app ID with the Facebook generated one for your personal app.
    9. Save the file.

    Also note that in order for the Facebook based login to work for the admin interface (admin.swf and admin.html) the same modifications need to be made to admin.html

    Back to top

    6.15 Badnicks & Badwords

    AVChat 3 has 2 configuration files containing usernames and words which are not allowed to be used as nicknames or in the text chat.

    We're talking about 2 separate files: badnicks.xml and badwords.xml.
    Both files can be found in the main AVChat 3 installation folder.

    Bad nicks

    badnicks.xml - contains 2 groups of XML elements:

    • <nicks></nicks> - the exact usernames defined there will not be allowed in chat
    • <widcards></widcards> - usernames containing that wildcard string will not be allowed in chat.

    Any username found either in the <nicks> or in the <widcards> tags will not be allowed in chat.

    Bad nick example: <bad>john</bad> - meaning that any user trying to connect with username "john" will not be allowed

    Wildcard example: <bad>adr</bad> - meaning any user trying to connect with an username containing "adr" (adrian, adrienne) will not be allowed.

    Only the user interface (index.swf) will check the member's username against the usernames in badnicks.xml. The admin interface (admin.swf) does not apply the check, so if the "admin" or "administrator" usernames are present in badnicks.xml they can be used in admin.swf but index.swf will not let users with these usernames go past the login screen.

    Bad words

    badwords.xml - contains 2 groups of XML elements as well:

    • <words></words> - words defined there will not be allowed in chat
    • <widcards></widcards> - words containing the wildcard will not be allowed.

    If some user uses in chat a word from that list you have created, it will be replaced with asterisks (***).

    The badwords check also applies to admins.

    Back to top

    6.16 Rotating messages feature

    AVChat 3 has a feature which gives the possibility for the owner to add info messages, text ads with links or any announcements.

    More details in this blog post

    Back to top

    6.18 Report user feature

    Sending a report

    Starting with build 2760 a user can be reported by any other user if necessary. This options is easily accessed by pressing the Report this user button located in a user's side menu.

    report

    The same button can also be accessed directly from the user's web-cam window.

    report from web-cam

    Once pressed a window opens that allows the following:
  • Selecting a report reason
  • Adding more information of why the user is reported in the limit of 200 characters
  • report window

    Pressing Report will send the report, Cancel will cancel the sending.

    Upon sending the report, automatically, two screenshots are taken:

  • A screenshot of the text-chat area
  • A screenshot of the reported user's web-cam
  • These screenshots are sent to the web-server and can be found in the AVChat installation directory in the folder named report_snaps. The filename is composed of the user's siteId and the screenshot type (CAM or TEXT), so a screenshot will be named like so: userSitedId_CAM.jpg and userSitedId_TEXT.jpg

    All of the information of the report is also available through a PHP API, the file sendReport.php. This file can be configured to send an automatic email with the data of the reported user along with links to the two above mentioned screenshots. By default the code for the email sending is commented. It can also be customized to be used in any other way it is seen fit.
    Important: The email address will have to be set manually, by opening the file with any text editor and editing the following line of code:
    $to = "webmaster@example.com";
    The default mail that it is sent will look similar to this:

    reports mail

    Viewing a report

    All of the reports can be seen using the AVChat administrator area -> Reports panel. The number between the parentheses is a notification for the total number of reports.

    reports panel

    The notifications work in the following way:
    Upon entering the chat as admin, the [Reports] button will show the total number of reports like so: Reports (10). When a new reports is received and the reported users window is not opened, the total number of NEW reports will be displayed in the top right corner of the [Reports] button like so:

    reports panel

    Pressing the [Report] button will open a new window and the notifications for the total number of NEW reports disappears.
    The new window displays all of the reports sent. Here you have the following options:

  • View the camera snapshot for a particular report (this is only active if a screenshot of the reported user's webcam was taken).
  • View the text-chat snapshot for a particular report
  • Copy username (copy the username of the reported user)
  • Copy user IP (copy the IP of the reported user)
  • Remove a report
  • Close (closes the window)
  • report list

    Removing a report will permenantly delete it.

    Additionally the report feature can be disabled by setting enableReportSending to 0. Also an admin can be blocked to see the reports by setting adminCanSeeReports to 0. By default they are both enabled (set to 1).

    Back to top

    6.19 Pay Per View API

    The Settings in AVC_Settings.XML Detailed

    Starting with build 3078 the Pay Per View API has been introduced, API that deprecates the old freeVideoTime setting and functionality.

    The API is intended to be used with an integrated version of AVChat and makes use of the following new settings in avc_settings.xml:

    1. PPVEnabled - This setting controls whether or not the PPV feature is enabled, and also depending on that, the status of the PPV button. When disabled the PPV button is not shown in the status bar.
    2. PPVAmount - This setting holds the amount of time or credits, depending on the PPVType setting. The PPVAmount starts to decrease as soon as the user enters the chat or as soon as he starts viewing a webcam (depending on PPVTrigger) with a ratio equal to PPVRatio/second. The remaining PPVAmount is then sent (every second) to the JS function onPPVUpdate which can be usually be found in index.html and admin.html.
    3. PPVType - This setting controls what PPVAmount represents (time, money, credits). When set to time the PPVAmount will be shown in the chat time formated (i.e. 15:32).
    4. PPVTrigger - This setting indicates what triggers the PPVAmount to decrease. When set to viewing_webcams the PPVAmount starts to decrease as soon as you start viewing someone, viewing 2 or more cams will NOT decrease the timer faster. When set to connected the PPVAmount starts to decrease as soon as you enter the chat.
    5. PPVRatio - This setting controls the ratio at which the PPVAmount is decreased every second. When set to 0.5 for example there will be a 0.5 credits or seconds decreased every second.
    6. PPVLink - This setting holds the URL for the page from which more time/credits may be purchased for more video stream access. Pressing the PPV button will open the PPV Link.
    7. PPVIcon - This setting provides the URL to the icon loaded in the PPV button located in the status bar. The icon size should be 16x16.

    The PPV Button mentioned above is a new button added in the status bar that displays dynamically the amount of time/credits left if PPV is enabled. Here's how it looks:

    The JS API Explained

    The JS API is represented by the function onPPVUpdate (found usually in index.html and admin.html).

    Event JavaScript Function Parameters passed to the JS function
    Every second that passes while viewing a stream onPPVUpdate(ppvAmountLeft, ppvInitialAmount, ppvRatio, userSiteId, sessionTimeStamp) ppvAmountLeft: the amount of time/money/credits left for a particular user.

    ppvInitialAmount: the initial amount of time/money/credits that a user had.

    ppvRatio: the rate at which the ppvAmountLeft is decreased.

    userSiteId: the siteId value as sent by avc_settings.xxx

    sessionTimeStamp: the timestamp from the last login.

    The PHP/ASPX API Explained

    Starting with build 3078 PHP and ASPX APIs have been added represented by the files ppvUpdate.php and ppvUpdate.aspx. These files receive the same parameters as the JS function and are also called by AVChat every second.

    All of these parameters will have to further be passed and stored in the site database and based on the stored values the PPVAmount will have to constantly be updated for that particular user (user that has an account on the site with which AVChat is integrated with).

    Controlling the API

    Both APIs are controlled by the setting PPVEnabled.

    Enabling just the JS API
    To only enable with JS API call set it to 1.

    Enabling just the PHP/ASPX API
    To only enable with PHP/ASPX API call set it to 2.

    Enabling both JS and PHP/ASPX APIs
    To enable with both JS and PHP/ASPX API call set it to 3.

    Back to top

    6.20 How to setup AVChat for Twitter authentication

    The Twitter authentication explained

    Starting with build 2915 AVChat supports Twitter authentication.

    This feature allows your users to connect to AVChat using their Twitter account.

    Clicking the Twitter logo in the login screen will open up a popup asking for the user's Twitter credentials in order the authorize the app for that particular account.

    twitter authentication

    Upon given permission AVChat will automatically login using the user's Twitter profile name and profile picture. Opening the user's profile from the user side menu will lead you to the user's Twitter profile.

    Twitter Profile

    This feature is controlled by the setting enableOtherAccountOptions located in the avc_settings.xml file. If set to 0, the feature will be disabled

    Setting it up

    Here are the steps that will guide you on how to set this up:

    1. Go to https://dev.twitter.com/apps
    2. Create a Twitter application by clicking "Create a new application" (you must have a Twitter account, if not create one prior to this).
    3. Enter the Name, Description, Website URL (your website) and the Callback URL (this will be a placeholder for the actual callback URL but it is needed. You can enter the same website URL completed earlier).
    4. Agree with the terms, enter the CAPTCHA and click "Create your Twitter application".
    5. You will receive a message at the top of the page that the application was succesfully created and be redirected to a new page that lists all the details for the created application.
    6. Twitter application details
    7. Open up index.html(that can be found in your AVChat installation folder) with any text editor.
    8. Find the lines similar to this: var consumerKey = "U3yvRmc...."; and var consumerSecret = "YtlvlqRTXjdjmK....."; and replace those values with the ones generated by Twitter for your own application (marked in the image above by the green rectangle).
    9. Find the line similar to this var pathToAVChat = "http://avchat.net/demos/avchat30"; and replace the value with the link to your AVChat installation.
    10. Save and close the file.

    Also note that in order for the Twitter based login to work for the admin interface (admin.swf and admin.html) the same modifications need to be made to admin.html.

    Back to top

    6.21 How to edit columns in the rooms panel

    This feature allows you to edit the info displayed regarding a room in the rooms panel. The values represent the table heads for each column:

    rooms list in AVChat

    In the above image, you can see that small arrow icon annotated with green. Users are able to sort the rooms in the rooms list by that option.

    For example, clicking the name once (as in the example), will sort the rooms alphabetically, by name (from A to Z). Clicking it once again will reverse the sort (from Z to A).

    Same procedure for the rest of the colums.

    Also, you can remove some of the columns so that you will only display the name of the room, having only the "name" label in the <value> node, like:

    <value>name</value>

    How to do it:

    • open avc_settings.xml - you can find it in your AVChat installation folder
    • search for columnsInRoomsPanel (line 1116)
    • based on the values in the <default> node (name users private owner created), set the <value> node (bolded below) to what you need
    • save the file and upload it back to the server
    <columnsInRoomsPanel>
       <title>columnsInRoomsPanel</title>
       <name>Columns in rooms panel</name>
       <type>string</type>
       <desc>a string that allows you to configure and edit the columns shown by the rooms list inside the rooms panel.</desc>
       <default>name users private owner created</default>
       <examples></examples>
       <value>name users private owner created</value>
    </sortRoomListOn>

    Back to top

    6.22 How to make the webcams auto start

    Perhaps you're using AVChat for live conferences where people will use audio/video by default and you want to eliminate some steps, to make AVChat more user friendly.

    In this matter, you can set the webcams to open automatically for each user, after connecting.

    There are 2 possibilities here:

    1. After connecting, each user will start seeing all other public streams automatically.

    How to set this:

    • open avc_settings.xml - you can find it in your AVChat installation folder
    • search for autoStartCameras (line 426)
    • set it's <value> node (bolded below) to 1 which enables it
    • save the file and upload it back to the server
    <autoStartCameras>
       <title>autoStartCameras</title>
       <name>Autostart cameras</name>
       <type>boolean</type>
       <desc>if set to 1 the user will start to view PUBLIC cams automatically as soon as they are started, admins with the permission to view private streams will also view private streams automatically</desc>
       <examples>0 for disabled, 1 for enabled</examples>
       <default>0</default>
       <value>1</value>
    </autoStartCameras>

    2. After connecting, each user will start streaming, with or without microphone.

    How to set this:

    • open avc_settings.xml - you can find it in your AVChat installation folder
    • search for autoStartMyCamera (line 435)
    • set it's <value> node (bolded below) to 1 which enables it
    • save the file and upload it back to the server
    <autoStartMyCamera>
       <title>autoStartMyCamera</title>
       <name>Autostart my camera</name>
       <type>eboolean</type>
       <desc>if set to 2, when a user has a webcam, immediatley after joining the first room, his camera will start broadcasting (the mic will start muted if the user has one).if set to 1, when a user has a webcam/microphone, immediatley after joining the first room, his camera/mic will start broadcasting. If set to 0, the user will have to press the 'Start my camera/mic' buttons to start it . This setting also takes into consideration the allowAudioStreaming and allowVideoStreaming variables</desc>
       <examples>0, 1, 2</examples>
       <default>0</default>
       <value>1</value>
    </autoStartCameras>

    Back to top

    6.23 Allowing/blocking audio and video streaming

    AVChat acts like a group chat with audio and video, but you can disable one of these 2 functionalities anytime, for any of your purposes.

    By default, both features are enabled. Here's how to control both of them:

    Disabling video streaming:

    • open avc_settings.xml with a text editor
    • search for allowVideoStreaming (line 110)
    • set it's <value> node to 0
    • save the file and upload it back to the server

    This way, users will be able to use only the microphone.

    Disabling audio streaming:

    • open avc_settings.xml with a text editor
    • search for allowAudioStreaming (line 119)
    • set it's <value> node to 0
    • save the file and upload it back to the server

    This way, users will be able to use only the webcam, if allowVideoStreaming is enabled.

    Having both disabled will make AVChat work as text chat only.

    Back to top

    6.24 How to disable the mobile version

    AVChat comes by default with a version for mobile devices.

    As any existing feature, this can be disabled as well.

    How to do it:

    • open avc_settings.xml with a text editor
    • search for enableHtmlClientForDesktopBrowser (line 1458)
    • set it's <value> node to 0
    • save the file and upload it back to the server

    When the feature is on, there's one more setting to make.

    On the media server side, inside the settings file, the web server IP needs to be defined.

    Here's how to set it:

    On FMS/AMS

    • open settings.asc file (you will find it in /applications/avchat30 on FMS or /FMSApps/avchat30 on AMS)
    • search for webServerIP
    • replace the existing IP (127.0.0.1) with your website's IP (you can use an online tool for this if you don't know how to find the IP)

    On Red5

    • open avchat3.properties file (you will find it in /your_red5_install_folder/webapps/avchat30)
    • search for webServerIP
    • replace the existing IP (127.0.0.1) with your website's IP (you can use an online tool for this if you don't know how to find the IP)

    Back to top

    6.25 Configure AVChat to function with audio and video only

    AVChat can be set to function in video-only mode (just audio/video streams with no text-chat).

    This feature is intended for users that want to utilize AVChat for specific seminars and presentations. When this is activated only the users-list will be available, and the user’s camera will automatically start.

    Also user-side menu specific text-chat options will be no longer available.

    This feature is controlled by the setting enableAudioVideoOnlyMode also present avc_settings.xml.

    How to set it:

    • open avc_settings.xml with a text editor
    • search for enableAudioVideoOnlyMode (line 1548)
    • set it's <value> node to 1
    • save the file and upload it back to the server

    Back to top

    6.26 How to show hide/show some of the existing rooms

    There might be a situation when you don't want to show all the rooms to your users, but also not delete them, to prevent others joining some of your rooms.

    This is easy, there are 2 possibilities here: hiding rooms or showing only some of them.

    Also user-side menu specific text-chat options will be no longer available.

    How to show only some of the existing rooms:

    • open avc_settings.xml - you can find it in your AVChat installation folder
    • search for showOnlyRooms (line 1702)
    • insert the room ID or rooms IDs you want to be shown in the <value> node (r0 for a single room and [r1,r2,r3] for multiple rooms)
    • save the file and upload it back to the server

    How to hide some of the existing rooms:

    • open avc_settings.xml - you can find it in your AVChat installation folder
    • search for hideTheseRooms (line 1766)
    • insert the room ID or rooms IDs you want to be shown in the <value> node (r0 for a single room and [r1,r2,r3] for multiple rooms)
    • save the file and upload it back to the server

    Back to top

    6.27 Rooms music player

    Every room can have it's own music playlist with music tracks from SoundCloud and Youtube.

    Upon entering the respective room the music player will automatically start to play the songs.

    This feature is controlled by the new setting enableMusicForRooms found in avc_settings.xml

    It comes enabled by default, here's how to disable it:

    • open avc_settings.xml - you can find it in your AVChat installation folder
    • search for enableMusicForRooms (line 1755)
    • set it's <value> node to 0
    • save the file and upload it back to the server

    Back to top

    6.28 How to enable webcam docking

    Webcams can be aligned automatically above the text chat area when other streams are opened, like in the picture below:

    music room in AVChat

    This feature comes disabled by default, here's how to enable it:

    • open avc_settings.xml - you can find it in your AVChat installation folder
    • search for enableWebcamDocking (line 1784)
    • set it's <value> node to 1
    • save the file and upload it back to the server

    Back to top

    7.1 Changing the welcome message

    Edit the welcome message for the desktop version in 5 steps:

    Quick painless way to change the welcome message that shows up in the first room you enter in AVChat:

    1. edit this .xml file on your web server: AVChat installation folder/translations/en.xml
    2. Go to line 416, you will see the welcome message on that line
    3. Change it to whatever you want
    4. Save and upload the en.xml file back to your web server/site
    5. Reload AVChat in the browser (if the old message still shows up refresh a few times or clear your browser cache)

    welcome message

    Back to top

    7.2 Translating AVChat

    AVChat loads the words and phrases used in the admin and user interface from external .xml files. You will find these .xml files in the translations folder. AVChat by default ships only with the English translation: translations/en.xml .

    en.xml is a plain text file that can be edited with any text editor.

    In order to change a word, to translate the entire interface in another language or to change the initial welcome message you just need to edit these files and change whatever you need!

    The languagefile variable in avc_settings.xxx controls which language file will be loaded. You can have several language files (en.xml, es.xml, fr.xml, etc.) and load one or another based on the user's location, ip or language settings in the browser (this is not a feature built in AVChat but it's something that's theoretically possible).

    IMPORTANT: After editing the en.xml file and uploading it back to your web server, make sure you clear your cache so that the browser picks up the new version.

    Where to find and share translations?

    There's a special area in our AVChat forum dedicated to exchanging language files: http://nusofthq.com/forum/index.php?/forum/9-language-files/?s=daa1ebdc00b4ecbe532d8139cd8fe800 . You need to sign up as a user to access the existing uploaded language files.

    Back to top

    7.3 Switching to RTL

    Switching to RTL is very simple. Just edit avc_settings.xxx and change the value of the rightToLeft variable to 1. This will cause all text fields, including the text chat area to become right aligned and part of the UI to be arranged from right to left.

    Back to top

    8.1 Passing the user name and gender from your web site to AVChat (auto login)

    The login screen in AVChat 3 shows up to ask the user for its username and gender. However if you provide these info’s via avc_settings.php (or avc_settings.aspx.cs) and block the user from modifying them the login screen is not needed anymore so it will be skipped!

    So this is what you need to do in order to auto login users:

    1. set $avconfig['username'] to the username of the person logged in the website (you can collect this info from cookies, sessions or from the database).
    2. set $avconfig['gender'] to male, female or couple ( the gender of the person logged in the website, you can collect this info from cookies, sessions or from the database). Starting with build 1880 make sure the genders are the same with the id attribute from the genders.xml file.
    3. set $avconfig['changegender']=0 which means the user will not be given the chance to change its gender
    4. set $avconfig['changeuser']=0 which means the user will not be given the chance to change its username

    If all the 4 steps above are completed, the login screen will be skipped and users will be logged in directly in the video chat without them being asked for a user name or gender (confrmation).

    You can also use $avconfig['disableGenderSelection'] to disable the gender selection altogether (everyone will get the male icon) and $config['coupleGenderEnabled'] to disable the couple gender.

    Back to top

    8.2 Automatically dropping users in a certain room with AVChat

    By default, when a user joins AVChat 3 he is presented with a list of existing rooms. He can choose one and join it! You can however skip that and drop users directly into the room of your choice.

    What you need to do is edit avc_settings.xxx and change the value of the dropInRoom variable with the id of the room you want users to automatically be dropped in.

    Example of the variable: $avconfig['dropInRoom']="r1";

    Starting with build 1880 the dropInRoom variable also supports an array of id's so that the users will automatically join multiple rooms.

    Example of the variable: $avconfig['dropInRoom']="[r2,r3,r4]";

    Every room in AVChat 3 has a unique id. When you log in the AVChat trough the admin interface (admin.swf) the leftmost column in the rooms list shows the id of each room:
    rooms id in avchat 3 rooms list

    Back to top

    8.3 General integration guide

    This is not a step by step guide because user management systems are different from a web site to another and from a CMS to another.

    By integrating AVChat with your users database we understand that the users of your web site will have to login only once (trought he normal login process on your wb site) and have the same user name on the web site and in the video chat. Furthermore if your web site allows for several user levels (like guests, free members & premium members) you can impose restrictions one some user levels in order to incentivise them to purchase a paid plan.

    How AVChat loads username/gender/enabled features information:

    When a user visits your web site and reaches the HMTL page with AVChat embedded in it, the HTML file and the the AVChat Flash .swf file are downloaded to the users computer and displayed in their browser.

    Then, avc_settings.xxx is executed on the web server and returns a string containing many variable/value pairs that are used by the .swf file. There's one variable for the username, one for the background image, etc. .

    You can see an example of what is returned by executing our avc_settings.php file (from our online demo) in the browser: http://avchat.net/demos/avchat30/avc_settings.php.

    All the variables accepted and used by the .swf file are listed and explained in the avc_settings.php files.

    If we were to talk about it in a timely manner, the integration will take place when the avc_settings.xxx file executes on the web server.

    Deep in the problem

    Once a person is logged in on your web site, the user management system will remember (using a cookie, or a session variable) the persons id, username, real name, email, gender and other details. Once the user logs out, the user management system "forgets" him (the cookie saved in the users browser is deleted, session variables are also deleted from the web server).

    You need to look trough the existing code and annalize how the existing management system remembers the person logged in. Either COOKIES or SESSIONS are used. If you have never learned about these before, this is a good time to do it! :)

    Cookies are little bits of information that are stored by your browser and sent with every call to the web site. Session variables are little bits of information that are stored by the web server individually for each visitor of your website.

    Username and gender are automatically recognized

    When the avc_settings.xxx file is executed, it should check for existing cookies (sent by the users browser) or session variables (saved on the web server for that specific user), and should populate the username and gender variables with the corrct values for that user.

    The variable for the username inside the php configuration file is $config['username']. The variable for the gender inside the php configuration file is $config[gender].

    Different settings for different user groups

    If your web site allows for different levels of membership you can impose restrictions on some of them.

    AVChat obeys to whatever values the avc_settings.xxx file returns so you can configure it to return a special set of variables/values when a gues user is executing it (detection based on COOKIES or SESSIONS) and another set of variables/values when a paying user executes it.

    Every variable in the avc_settings.xxx file can be configured according to the level of the user.

    Here are a few ideas of what you can do:

    • allow "gold" users to send higher quality video and audio by pointing the value of miccamsettingsurl to a .xml file with better quality settings
    • limit the amount of time "free" users can see video streams by specifying a value for the freeVideoTime variable
    • allow "gold" users to see more web cams at a time by modifying the value of maxcams when the logged in user is detected as "gold"
    • drop "gold" users in selected rooms, while "free" users gather only in the lobby by modifying the value of dropInRoom according to the level of the user
    • prevent "free" users from creating rooms or initializing private chat or making their video streams private

    Further notes

    • You might want to block the user from changing the username and gender detected by the avc_settings.xxx file in the login screen of the AVChat user interface: to do this set the value of changeuser and changegender to 0 in avc_settings.xxx.
    • When both changeuser andchangegender are set to 0 in the asp/php config file, AVChat will skip the login screen of the user/admin interfaces and jump directly to the chat area.
    • You can test the integration by logging in, loading the avc_settings.xxx file directly in the browser, and checking the variable/value pairs it returns. This way you can also check for any syntax errors that might have slipped in while editing the file.
    • We also provide integration services for a certain fee: http://avchat.net/buy-now#services
    • If you are in need of a good text editor we recommend Notepad2
    • A good introduction on PHP (including Sessions and Cookie variables) can be found here:
      http://www.w3schools.com/php/default.asp
    • A good introduction on ASP (including Sessions and Cookie variables) can be found here:
      http://www.w3schools.com/aspnet/aspnet_pages.asp

    Back to top

    8.4 Placing ads around the video chat

    Placing ads around the video chat is simple. The video chat itself is actually a Flash .swf file embedded in a HTML file. In that HTML file you can place anything: links, images, AdWords ads, banners, etc. .

    The default HTML file embedding the index.swf file (main video chat file) is:
    index.html
    so to add ads around your video chat:

    1. Connect to your web site using FTP
    2. Edit index.html with a text editor
    3. Place your ad code in it
    4. Save and upload back to web server

    A little bit of HTML knowledge might be required tough to properly place the ads above, below or to the sides of the video chat.

    Back to top

    Get personalized help

    Customers with an active Support & Updates Plan can submit support requests to our knowledgeable techs via the client area.

    Enter client area

    Support forums

    Ask other customers for advice on features, customization and running a community in our peer-to-peer support forums.

    Visit Forum

    Installation service

    Should you need help installing the softare we can help you install both AVChat and the Media Server through our Installation Services.

    Find out more