To develop client side applications that work with the Wowza Pro server you must set the objectEncoding parameter to ObjectEncoding.AMF0 on the NetConnection2 object before connecting to the Wowza Pro server.
The Flex client side code looks like this:
var wowzaURL:String = "rtmp://localhost/myapplication";
wowza_conn = new NetConnection2();
wowza_conn.objectEncoding = ObjectEncoding.AMF0;
wowza_conn.connect(wowzaURL);
the NetConnection2 class is that a class which extends NetConnection and has some added methods which Wowza requires?
We’re trying to migrate from FMS to Wowza, but I get an error when I try streaming audio saying:
AsyncErrorEvent type=“asyncError” bubbles=false cancelable=false eventPhase=2 text=“Error #2095: flash.net.NetStream was unable to invoke callback onMetaData.” error=ReferenceError: Error #1069: Property onMetaData not found on xxxx
Here’s a complete mxml file for a simple app. It will run against the VideoChat example included with the Wowza server, though it only uses the audio channels.
Hi Charlie, at the beginnign of this you had talked about NetConnection2 being used by Wowza and seemed to suggest that Flex clients use that. Can you please tell me what Wowza uses NetConnection2 for and is it better that I use that instead of NetConnection? Thanks
I don’t know Flex2 but from the error message it looks like you need to add the onMetaData handler to your NetStream object. In Flash you do something like…
var ns:NetStream = new NetStream(nc);
ns.onMetaData = function(infoObj)
{
trace("onMetaData: "+infoObj);
};
// in your init method
ns.onMetaData = Delegate.create(this, onMetaDataHandler);
// then define the onMetaDataHandler
public function onMetaDataHandler(obj:Object):Void
{
}