Results 1 to 6 of 6

Thread: a call from my Module to Flash AS3 is NOT working while publishing

  1. #1

    Default a call from my Module to Flash AS3 is NOT working while publishing

    inside my java module I call to flash:

     
    IMediaStream stream = client.getAppInstance().getStreams().getStream("mystream");		
    AMFDataMixedArray data = new AMFDataMixedArray();
    data.put("caption", new AMFDataItem(caption));
    stream.sendDirect("setCaption", data);
    in my flash the code is:

     
    var nsClient:Object = new Object();
    nsStream.client = nsClient;
    nsClient.setCaption = function(obj:Object):void
    {
    	trace("got it! caption: " + obj.caption);
    };
    if my nsStream (NetStream class) is doing streaming - playing video like: nsStream.play("myMovie");
    this works fine. the call arrive the flash functions
    but, if nsStream is doing publishing, like: nsPublish.publish("myRecording", "record");
    the call never gets to Flash function "setCaption"

    why is that ?

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

    Default

    The NetStream that is publishing the stream is upstream from the injection, and you only listen for these events in the playback client anyway

    Richard

  3. #3

    Default

    Quote Originally Posted by rrlanham View Post
    The NetStream that is publishing the stream is upstream from the injection, and you only listen for these events in the playback client anyway

    Richard
    Hi
    I didn't understand what you mean by "...is upstream from the injection..."
    what do you mean by "injection" ?
    I am just trying to call a method from the Module to Flash

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

    Default

    You are "injecting" cuepoints as in the following guide, right?
    http://www.wowza.com/forums/content....point-MetaData

    Is this correct?
    1. You publish a stream with Flash application doing NetStream.publish
    2. You inject a cuepoint server-side into above stream (perhaps you have another Flash app you use as a controller to call the server-side function)
    3. You playback the stream and listen for cuepoints in an RTMP playback client.


    If so, the Flash application that is doing NetStream.publish is upstream, i.e., before cuepoints are injected and does not know about them.

    Richard

  5. #5

    Default regarding the cuepoints example

    hi
    regarding the cuepoints example, I have few questions

    • "cuepoints" are marks that I inject into a recorded stream, am I right ?
    • when I inject cuepoints into the stream, the output movie file will have increased size, am I right ?
    • do "cuepoints" have any meaning if I am NOT recording the stream ?
    • in the example module "ModuleInjectData" there are two functions:
      setCaption(...)
      injectMetaData(...)
      how "setCaption" function is relevant for the injection of cuepoints?
      all I see it does is calling flash code function "setCaption", here:
      stream.sendDirect("setCaption", data);
      am I right ? (is this what "sendDirect" call doing?)
    • who exactly suppose to call injectMetaData(...) function ?
      in the example as3 code, the only function that is called there is "setCaption"

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

    Default

    Cuepoints is data injected into a stream with a name and optional data that is associated with time, which is when it is sent to clients. The client has to listen for cuepoint by that name and know what kind of data it has to be of any use. "setCaption" in the example is the name of the cuepoint that is being injected. This is the name you will have to use to listen for the cuepoint in the client.

    I doubt they increase file size noticeably.

    A client can listen for cuepoints on a live stream or vod. If you use stream.sendDirect and are recording the live stream, the cuepoint is recorded too. If you use stream.send it is not recorded.

    You could have a Flash application that calls server-side code, probably as you are watching the stream you are injecting cuepoints

    Richard
    Last edited by rrlanham; 08-28-2012 at 11:24 AM.

Posting Permissions

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