Wowza/Flex AV Chat example

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://community.wowza.com/t/-/234

Richard

Oh, sorry, that’s the thread we are in. I’m not sure what to tell you. These are the examples we have. You have to work with this.

Richard

No, it’s not doing that. As you can see, the Flash interface has no input for username. On the server-side, clients are distinguished by clientid, the identifier generated by Wowza. You have to modify the Flash interface to accept a username, and the server-side to use it like the example I showed earlier.

Richard

The path has changed, but functionally TEA.as is the same. You just have to reconcile the path. You can change it in Flex if you are building the source. Or change it i TEA.as, change this to old path:

package com.wowza.encryptionAS3 {

And you have to change the folder structure to match.

Richard

This is a Flex (SDK 3.5) application. The source is here

Flex (Flash Builder) uses text files with .as and .mxml extensions for source code. There is no .fla

Richard

You will have to learn how to use Flex.

Richard

I updated this. Re-download the source

Richard

Here is Flex version of Wowza TextChat. You can put together easily:

https://www.wowza.com/forums/showthread.php?1480-textchat-with-Flex#4

Richard

Do you want a Flex developer to help with this? We have a list of independent consultants. Send email to support@wowza.com to request if you do.

Combining these two examples should be fairly easy.You could use two NetConnections if that makes it easier.

Richard

I appended clientID in that simple example to avoid name collisions or having a real authentication system. It’s a fairly accessible example, good starting place for Flex and Wowza.

Richard

This example includes a jar file that needs to be copied to Wowza /lib folder, then Wowza must be restarted.

If you running Wowza as a server, stop the service then run Wowza in stand-alone mode: /bin/startup.bat, so you can see Wowza log output while you test. It is very helpful.

Richard

Removed, posted to wrong thread.

Previous post was to wrong thread.

This is the issue:

ERROR server comment - loadModFunctions: java.lang.ClassNotFoundException: com.w

owza.wms.example.module.AVChat

This means the jar is not in the Wowza lib folder or you didn’t restart Wowza after adding it.

Richard

You can ignore those Warnings. Or change to:

for (var p:Number = n-1; p >= 0; p--) 

Richard

Yes, it is at least 75% the VideoChat example that ships with Wowza. Please trace these functions to see what they do. It’s a starting place.

Richard

Try setting the project to use SDK 3.5 in the Project Properties, Actionscript Compiler tab.

Richard

There is a .jar file included with this example. Make sure you have have copied that to your Wowza /lib folder, and added the Module to the Application.xml, and re-started Wowza. Then each user should see the stream the other has published.

Richard