Audio / Video Module

Return to the Module Documentation Index

Need more Audio/Video options for FlashChat? TUFaT.com is now offering an Audio/Video module pack, with 5 skins, 3 "views" per skin, and (as always!) 100% of the Flash source code.

DISCLAIMER: This module is currently considered ALPHA software... i.e, it is very new, hasn't been tested rigorously, is likely to change in the coming weeks and months. Remember: upgrades are free at TUFaT.com, so your purchase of the FlashChat Module Pack will include any upgrades that are made to this module and all other modules.

The Idea

This module will allow chatters with webcams and microphones to engage in a real-time video chat! This module requires Flash Communication Server MX (also known as "FlashComm"). You can acquire a free copy from Macromedia.com (the free version limits you to 5 connections, however). You should have a dedicated server.

Setup

There are two parts of the Audio/Video module setup, one within Flash Communication Server, and the other within FlashChat's config.php file.

Flash Communication Server

To use the Audio / Video Module, you must locate the Flash Communication Server "applications" folder. On my Windows 2000 Server system, this is located at:

C:\Program Files\Macromedia\Flash Communication Server MX\applications\

This will likely be different for you. Create a sub-folder called "audio_video_module", and copy the "main.asc" file, which comes with this module, to this new folder. In other words, something like this:

To help get us started, we'll monitor the connections from the module. Open the "flashcom_help" folder, then open the "html" subfolder, then the "admin" folder, then "admin.html". This will show the login page. Login using the administrative login which you established when installing Flash Communication Server (this is NOT the FlashChat login).

Once logged in, you'll be able to monitor the module connections. We'll revisit this screen after we get the module started.

FlashChat

Within FlashChat 4.3.3 or higher, there is a "modules" folder. Within this folder, create a sub-folder called "audio_video_module", and within that folder copy the file "audio_video_module.swf" and the "config.xml" file. In other words, you should now have something like this (the path to your FlashChat instance may differ, of course, based on where you uploaded it to):

http://yourdomain.net/chat/modules/audio_video_module/audio_video_module.swf

and

http://yourdomain.net/chat/modules/audio_video_module/config.xml

Open config.xml with a good text editor, and change this line to match your server:

<server>rtmp://yourdomain.net:1935/audio_video_module/chat</server>

Of course, you should change "yourdomain.net" to your domain, and "1935" to the Flash Communication port. The format of this line is:

protocol:[//host][:port]/appname/[instanceName]

Your "appname" should remain "audio_video_module", and the instance name should remain "chat'.

Locate the 'config.php' file within FlashChat's 'inc' folder. Open this file with a good text editor, like Textpad, and be very careful not to introduce PHP errors while editing. Be sure to backup your original config.php file, just in case you need to restore it.

Scroll down to the 'module' settings, and change the 'path' property to match the SWF path of the new AV module. For example, like this:

	 'module' => array(
		'anchor'  => 0,
		'path'    => 'modules/audio_video_module/audio_video_module.swf',
		'stretch' => true,
		'float_x' => 300,
		'float_y' => 200,
		'float_w' => 100,
		'float_h' => 100,
	 ),

Setting 'anchor' to 0 will position the module directly below the room list. The important thing is to ensure that 'path' is set correctly. I also recommend that you set 'stretch' to true, so that your users can easily expand the video display as needed. Expanding the room list area will cause the module viewable area to expand, since the module will stretch to fill all available space.

Startup

Now, start FlashChat by logging in using your normal method of login. Be sure that the Flash Communication Server service has been started on the server, too. Of course, you should check your webcam, microphone, and speaker settings to ensure that your hardware is working correctly.

When FlashChat starts, you should receive an alert message, similar to the one below, from the Flash player:

You should click "Allow" to permit access to your computer's camera and microphone. A list of chat users who have also established connections will now appear in the combo list. You may now choose who you would like to conference with.

As the final step, click on the green "Play" button at the bottom of the module, adjust the sound settings as appropriate, and ensure that the Camera icon are Microphone icon are on. If your microphone or camera icon has a red line through it, that means that your camera or microphone is off or non-functional. You may still see and hear the other user, however. For example, in the screenshot below my microphone was disconnected, but I could still see and hear the user I was chatting with.

The 3 green bars to the left of the camera icon indicates my connection strength. In this case, I was testing the system on a local network, so the connection strength was very good. The mute and volume icons at the bottom right side of the screen are self-explanatory, I think.

If you observe that your camera is working but no video output is shown, this indicates that the camera of the person who you are chatting with is probably non-functional or off.

You can start and stop the audio/video stream using the buttons at the bottom of the module. Remember that to start the conversation after establishing connection with FlashComm, you must click the green "play" button. The stop and play buttons can be used to start/pause the AV stream, without disconnecting with the other user completely.

If you have the FlashComm admin panel open, you should see the connections that have been opened to the module.

XML Configuration

The config.xml file includes a few other parameters other than <server>. Here's a quick summary of what thes settings mean:

width: The default module width, when the 'stretch' parameter is set to false (in config.php).

height: The default module height, when the 'stretch' parameter is set to false.

volume: The default microphone volume.

cam: Default camera setting (on/off).

mic: Default microphone setting (on/off).

sound: Default sound setting (on/off).

nousersmsg: The default combo list value when no users are connected.

Thanks for your patronage of TUFaT.com, and enjoy the Audio/Video module! If you have any suggestions for improvement, please feel free to post them on the forum.

This audio/video module is sold as part of the FlashChat Module Pack, which is available exclusively at TUFaT.com. Re-distribution or re-sale of this module is not permitted under any circumstances, and you should not take credit for the development of this module. Please help me keep the cost of this module low by not re-distributing it. :)

The module includes 100% of the Flash 2004 Professional source code, so you are welcome to make any modifications that you wish. The module is provided "as-is" without formal technical support (this is $5 software, after all). You may be able to get your questions answered by other members of the FlashChat community on the TUFaT.com support forum.

Enjoy!
Darren