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.

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!

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

User goes to your web site and visit the page with the video chat (flash swf file) embedded on it

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

Once everything is loaded the user is asked for a user name and gender (if it's not integrated)

Once the user provides that info the swf attempts to connect to the media server

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

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!

Starting with AVChat 3.6 it will only be compatible with Red5 1.0.5 and newer. Older versions of AVChat will still work with Red5 0.8 and 1.0 RC1.

Wowza 1.7.x to Wowza Streaming Engine 4

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

Starting with AVChat 3.6 the mobile version of AVChat will only work on Red5 1.0.5 and up, due to being the only server that supports Web Sockets technology at the time.
Red5 1.0.5 specifically needs at least Java JDK version 1.8.

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.

2. Installation instructions

2.1 AVChat 3 Standalone 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).

2.1.1 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.

Important !!! The following modifcations for the Red5 logs are only necessary if you have a version of AVChat older than 3.6 ( build 3632)

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&gt

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:

Go to http://WOWZA_SERVER_ADDRESS:8088/enginemanager/

From the top menu click the [Server] page

In Server Setup click Edit

Change Default Stream Prefix from mp4 to flv

Save

You're done, move to step below

AMS/FMS 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)

2.1.2 Installing AVChat Standalone in a folder on your web site

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

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.

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.

CHMOD the uploadedFiles folder to 777 (otherwise the upload function might not work)

CHMOD the folder tokens to 777.

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.

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:

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).

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.

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

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:

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.

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.

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.

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!

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.

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?

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

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:

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.

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.

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:

Starting with build insert build number here AVChat ships with 2 themes: one with light and one dark. Both themes are located in the
new themes folder located in your AVChat installation directory. By default the light one is selected. You can also make your own theme by simply creating a new folder inside the themes folder and putting a customized
style.xml inside of it.

To switch between themes, either the default ones or your custome created theme you need to take the following steps:

Open style.php or style.aspx.cs depending on the webserver you are running.

Edit the path to theme. By default it will look like this "themes/light/style.xml".

Change the name of the folder, in this case light to dark or your custome made folder name resulting in this: "themes/dark/style.xml".

Save and exit.

Next we need to change the background color of the SWF file and this can only be done where it is embeded in the webpage, by default in index.html and admin.html.

Search for var params variable and change the bgcolor parameter which by default will be bgcolor : "#F1F1F1", to the #101622 color which is the corespondent dark theme color.

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.

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.

<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.

<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.

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.

5. Security

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:

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

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.

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.

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.

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.

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

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:

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.

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.

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 (***).

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.

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

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

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:

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.

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:

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)

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).

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:

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.

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.

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).

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.

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.

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.

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).

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.

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.

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.

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

Create a Twitter application by clicking "Create a new application" (you must have a Twitter account, if not create one prior to this).

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).

Agree with the terms, enter the CAPTCHA and click "Create your Twitter application".

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.

Open up index.html(that can be found in your AVChat installation folder) with any text editor.

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).

Find the line similar to this var pathToAVChat = "http://avchat.net/demos/avchat30"; and replace the value with the link to your AVChat installation.

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.

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>

Starting with AVChat 3.6 the mobile version of AVChat only works on Red5 versions 1.0.5 and up. This is due to the fact that the mobile HTML 5 client uses WebSockets
technology, and Red5 media server is the only one supporting this technology at the time being. The server side setup required for the mobile client has changed also:

This setting has been deprecated starting with AVChat 3.5.2 build 3542. For more details on what has been changed you can read the blogpost.

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.

Starting with AVChat build 3396 we have implemented a mechanism that permits AVChat to detect
the language the browser is setup for. Based on this and using Google’s Translate API you can now translate on the fly messages from another language,
from a user that has the browser setup in french for example, to your preferred language, assuming as well that your browser is setup in your particular language.

A small translate link will appear on the side of the text message, pressing it will show the translation for that particular message in a smaller grey font beneath the original text, as shown in the images below:

French user's view

English user's view

But in order to achieve this you must first have a Google API Key. Here are the steps needed to obtain one:

After creating you account go to the Projects page by clicking on the Projects link in the left-side menu.

Create a new project by clicking on the Create Project button and name it however you wish.

Wait for a couple of seconds while the project is created. After it finished creating it's name will show up in the list like so:

Now that you've setup your project it's time to enable the Translate API for it:

Select the project.

In the sidebar on the left, select APIs & auth.

In the list of APIs, make sure the status is ON for the Google Translate API.

In the sidebar on the left, select Credentials.

In this page click on the Create new Key button.

In the dialog box that opens up select Browser key.

Http referers can also be setup like mentioned in the next window:
.

An API Key will be generated. Copy it and set it in the avc_settings.xml setting googleAPIkey.

Save and close avc_settings.xml.

There is one more thing that needs to be done before the setup is ready. Google Translate API v2 requires billing information for your account before you can start using the service.
To enable billing for your project, do the following:

With the project selected, in the sidebar on the left, select Billing & settings.

Select Enable billing

Select your location and then fill in the form.

That's it, now AVChat will translate text messages on the fly, provided the user's browsers are setup in different languages.

6.30 How to setup AVChat for Live streaming

AVChat can be setup for live streaming of events or interactive courses for example. This is easily done when you have AVChat integrated with a CMS like Wordpress or Joomla, where
you can setup a particular user group to be able to broadcast, and another "viewers" user group to only be able to view other streams. The particular settings you would need to setup will be detailed
later.

In case you have a standalone installation of AVChat, the same effect can be achieved by having two different installation folders (two instances of AVChat installed on the webserver, connected
to the same instance on the media server. One installation will fill the role of the broadcaster and the other of the viewer.

The following settings apply in both of the cases (intergrated AVChat and standalone)

The broadcaster role will have the following setup:

allowVideoStreaming set to 1

allowAudioStreaming set to 1

autoStartMyCamera set to 1

autoStartCameras set to 0

allowPrivateStreaming set to 0

The viewer role will have the following setup:

allowVideoStreaming set to 0

allowAudioStreaming set to 0

autoStartMyCamera set to 0

autoStartCameras set to 1

It is recommended that the cameras are set to be docked: enableWebcamDocking set to 1

Additional changes can be made. You can hide the users list for both broadcaster and viewer role by setting hideUsersList to 1.

Starting with AVChat 3.5.2. The entire text chat area can be hidden as well separately using the setting hideTextChat.

When recording using the Red5 media server the video files are created in Red5/webapps/avchat30/streams/_definst_. Starting with AVChat 3.6 the streams folder can be exposed - via Red5's Tomcat web server - to be accessible via http (from the browser) at http://RED5_SERVER_ADDRESS:5080/avchat30/streams/

This will help you greatly if you want to:

Play the files through HTML5 or progressive download

Download the files locally

Move the files to a different server

You will need to do the following steps:

Go to Red5/webapps/avchat30/WEB-INF/ on your media server.

Open web.xml with a text editor.

Delete the tag <security-constraint> along with it's contents.

Uncomment the other <security-constraint> tag, where it reads.

Save and exit.

Restart Red5.

If you now go to http://RED5_SERVER_ADDRESS:5080/avchat30/streams/ in your web browser you will see a list of all the video files. Clicking them will download them or play them in the browser.

This open directory listing can be a security issue (you don't want to expose all the recorded videos to anyone snooping around). To turn off the directory listing do the following:

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.

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.

8. Integration

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:

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).

set $avconfig['gender'] to male or female ( 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.

set $avconfig['changegender']=0 which means the user will not be given the chance to change its gender

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 Unspecified gender and will have no icon displayed).

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. .

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 andchangegender 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.

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. .