Results 1 to 3 of 3

Thread: Is ApplicationInstance.BroadcastMsg the same as Stream.sendDirect ?

  1. #1

    Default Is ApplicationInstance.BroadcastMsg the same as Stream.sendDirect ?

    Hi,

    I`m trying to send messages from WMS-Server to the Client. Maybe my clientedside code is wrong!
    Is there a difference between adding "sendDirect" to a Stream and "BroadcastMsg" for an ApplicationInstance!
    Is there a difference between this two messages?

    Working:
    AMFDataMixedArray data = new AMFDataMixedArray();
    data.put(command, new AMFDataItem(value));
    stream.sendDirect("onDataEvent", data);

    Not working:
    AMFDataMixedArray data = new AMFDataMixedArray();
    data.put("command", new AMFDataItem("testvalue"));
    vhost.getApplication(app).getAppInstance("_definst_").broadcastMsg("onDataEvent", data);


    Client Side Code is StrobeMediaPlayback-Plugin:

    .....
    myMediaElement.getTrait(MediaTraitType.LOAD).addEventListener(LoaderEvent.LOAD_STATE_CHANGE, onload);
    ......

    public function onload(event:LoadEvent):void {
    if(event.loadState == LoadState.READY){
    myMediaElement.client.addHandler("onDataEvent",onWzwEventData);
    }
    }
    ....
    public function onWzwEventData(wzwMetaObj:Object):void {
    trace (wzwMetaObj["command"])
    }

  2. #2
    Join Date
    Nov 2011
    Posts
    14

    Default

    did something similar. Think broadcastMsg posts events to NetConnection while sendDirect posts to NetStream.

  3. #3
    Join Date
    Dec 2007
    Posts
    21,962

    Default

    Right, appInstance.broadcastMsg sends data to all clients using NetConnection. IMediaStream.send and .sendDirect send data to one client in the NetStream.

    Take a look at the ServerSideModules example that ships with Wowza for a working reference of Flash/Wowza communications

    Richard

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •