It looks like you are using the wrong example as a starting place. For cuepoints you want to follow the setCaption example. This injects timed-text. It happens to show how to inject a cuepoint that is widely recognized by many players to display captions, these players have listeners for a cuepoint of that name and signature. You can use that method to create cuepoints of any name, with any parameters. Then you use your Flash RTMP client to listen for and process cuepoints as they come through in the stream, as they are associated with a timecode in that stream. You seem to be following the metadata injection example.
The example you want to modify is this one:
public void setCaption (IClient client, RequestFunction function, AMFDataList params)
{
String streamname = params.getString(PARAM1);
String text = params.getString(PARAM2);
String language = params.getString(PARAM3);
String trackid = params.getString(PARAM4);
IMediaStream stream = client.getAppInstance().getStreams().getStream(streamname);
//essential code
AMFDataMixedArray data = new AMFDataMixedArray();
data.put("text", new AMFDataItem(text));
data.put("language", new AMFDataItem(language));
data.put("trackid", new AMFDataItem(trackid));
stream.sendDirect("onTextData", data);
getLogger().info("Caption: " + text);
}
The injects a cuepoint named “onTextData” which includes an AMFDataMixedArray with 3 fields. In Flash, you need something like this to process this cuepoint:
var clientObj:Object = new Object();
clientObj.onTextData = function(data:Object):void
{
trace(data.text);
});
netstream.client = clientObj;
netstream.play("myStream");
Note that the AMFDataMixedArray you send on the server-side corresponds with the data:Object of the client-side callback function.
Richard