I saw this link about how to modify the metadata of on-demand streams.
I can use that if i wanted to “modify” metadata in beginning of stream. But i need to “add” metadata dynamically on server-side at variable time-intervals( ie. client sends cue-points to server in-middle of playing the vod stream and server has to inject metadata with some custom keys to vod stream).
Below is my code inside cue-point method on server-side to send metadata to vod :
List<IMediaStream> playStreams = client.getAppInstance().getPlayStreamsByName(vodStreamName);
AMFDataObj data = new AMFDataObj();
AMFDataArray parameters = new AMFDataArray();
parameters.add("param1");
parameters.add("param2");
data.put("testMetadata", parameters);
for(IMediaStream streamInstance:playStreams)
{
if(streamInstance != null)
{
streamInstance.sendDirect("onMetaData", data);//working
((MediaStream)streamInstance).processSendDirectMessages();
}
}
I used the same code to send metadata to live(non-vod) streams, it works just fine. It doesn’t work in case of vod stream. Can anyone tell what’s wrong with my code? Any help is appreciated.