Wowza Community

Wowza/Flex AV Chat example

Hi guys,

Many thanks for this usefull example!

I am trying to play with it in Flex 3 and Wowza Media Server 2 (trial).

But I cannot run it from Flex, I am getting the following error:

“A file found in a source-path must have an externally visible definition. If a definition in the file is meant to be externally visible, please put the definition in a package.”

Path: AVChat/src/com/meychi/ascrypt

Source: TEA.as

I put the com folder under the Flex source (src) folder where file AVChatApp.as is located. But on run I am getting this error that blocks the execution.

Any idea?

thanks in advance,

Sincerely,

Alain

Hi Richard, thank you so much for the video chat example.I have several questions though;

in AVChatApp.as class what does streamSynch and connectedUsersSynch methods actually do?

The rest of the code looks %75 the same with the shipped VideoChat example except that arrayList and these methods.

Where do you actually reduce the latency?

Thank you.

Hi richard,

First of all i must say you did an excellent work with posting a video chat that is testing the performence of combining flex and wowza.

im trying to get into the source of the chat for studying using the Flash Builder 4.5 but unable to load it as a project because there is no fxp file and the file’s foldair does not recognized as a project container.

any suggestions? perhaps i can have the fxp file from you via email?

This is a Flex version of the Wowza videoChat example, with application module to track users and streams in shared objects.

You can download including WMS and Flex source files here.

Steps:

  • Copy the jar file from the package /lib folder to Wowza lib folder.

  • Create an application named “avchat”, then add this Module /conf/avchat/Application.xml /Modules list. Make it the last one:

      		
    <Module>
    	  <Name>avchat</Name>
              <Description>AV Chat support</Description>
              <Class>com.lakesidetechnical.AVChat</Class>
    </Module> 
    
  • Restart Wowza

  • Double click [package]\client\avchat.html. Click Connect, click Publish, then click Play

  • Copy the files in the [package]\client folder to a web server so that they can be reached by others to chat with.

    NOTES:

    You need Flex and basic Actionscript 3 skills to work with this example. This example is free to use and modify however you want

    Richard

HI Richard,

Hope you are well.

I have gone through your (Wowza/Flex AV Chat example) application code. I have set up all but a scenario is happening that I mention below…

Lets suppose with user1 and user2. If user1 1st publish the a steam " steam1" and user2 publish another steam is “steam2”. But now if user2 select the user1 steam “steam1” then he/she can able to see the user1 video/audio and his own video. But user1 who 1st the create the steam he never see the user2 video/audio he(user1) .

Please tell me what is the problem, I am unable to replicate the problem source. Please help me ASAP.

This is a Flex version of the Wowza videoChat example, with application module to track users and streams in shared objects.

You can download including WMS and Flex source files here.

Steps:

  • Copy the jar file from the package /lib folder to Wowza lib folder.

  • Create an application named “avchat”, then add this Module /conf/avchat/Application.xml /Modules list. Make it the last one:

      		
    <Module>
    	  <Name>avchat</Name>
              <Description>AV Chat support</Description>
              <Class>com.lakesidetechnical.AVChat</Class>
    </Module> 
    
  • Restart Wowza

  • Double click [package]\client\avchat.html. Click Connect, click Publish, then click Play

  • Copy the files in the [package]\client folder to a web server so that they can be reached by others to chat with.

    NOTES:

    You need Flex and basic Actionscript 3 skills to work with this example. This example is free to use and modify however you want

    Richard

Hi rrlanham ,

Can you contact with me…

hi,

how can i test this example with 2 computers ??

Jim,

Yes, feel free to use it on your website. I include a flash swf and jar file, so you should be able to get it to work as is, see readme.html file in the download.

To modify you need the Wowza IDE for the server-side and Flex Builder for the client-side code, which is not free but it is pretty cheap. And there are free options, but this is very good:

http://www.adobe.com/products/flex/

Richard

It looks like you didn’t copy the included jar file to [wowza_install]\lib

Or if you did, also restart Wowza.

It is in a Flex file, sorry. Maybe I will add xml loader next time.

Richard

Also, I corrected that in the swf, so please download that package again and use the current client/AVChat.swf : AVChat

Note that I am using “rtmp:/avchat” which means it is looking for this app on the same machine as it is running. So it will work if the server you are running wowza also has a webserver, and if you serve the Flash from that webserver.

Richard

Josh,

This is a Flex app, which doesn’t use FLA. You can use Flex Builder to modify the example.

Richard

That is source for a server-side Wowza module that supports the AV Chat. You need the Wowza IDE to compile that to a jar file in your local wowza/lib folder, then you can add a reference to it in your Application.xml, in the Modules section. The download includes a guide.

Richard

Sun,

Read the Quickstart Guide and at least the first 6 chapters of the User Guide.

Richard

Looks interesting. I wouldn’t invest time in it myself because of the limitations of beta, no pricing info, not sure if it will last, and I am using Wowza for that.

Richard

Oh, no problem. It is definitely interesting, part of the landscape of streaming and real-time application platforms.

Richard

The TEA.as file is missing, sorry about that. You can grab it from the Flex SimpleVideoStreaming example.

examples\SimpleVideoStreaming\clientFlex\src\com\meychi\ascrypt\TEA.as

Create this folder structure below the src folder of you Flex project:

com\meychi\ascrypt\

And copy the TEA.as file to there.

Rchard

Sounds like there is an issue with the client-side sync method.

Richard

I don’t think you will be able to do that, because there are sharedObjects and the many to many audio/video streaming.

You could have an application where users watched a live video on one netconnection from edge servers, and synced with sharedObjects using another netconnection connected to a dedicated sharedObject server. But many to many chat, everyone has to connected to the same server, application and application instance per session.

Richard

If you connect like this, with a username:

netconnection.connect("rtmp://[wowza-address]:1935/[appName] "richard");

You can extract the username and attach it to the client in a property, like this:

package com.wowza.wms.example.module;
import com.wowza.wms.amf.*;
import com.wowza.wms.client.*;
import com.wowza.wms.module.*;
import com.wowza.wms.request.*;
public class ModuleTrackUserData extends ModuleBase {
	
	public void onConnect(IClient client, RequestFunction function,
			AMFDataList params) {
		getLogger().info("onConnect: " + client.getClientId());		
		String user = getParamString(params, PARAM1);
		client.getProperties().setProperty("username", user);
	}
	public void onConnectAccept(IClient client) {
		String username = client.getProperties().getPropertyStr("username");
		getLogger().info("onConnectAccept username: " + username + " ID: " + client.getClientId());
		
	}
}

Richard

Take a look at this Flex example that does that:

http://www.wowza.com/community/t/-/234

Richard