We had older version of wowza with application using ILiveStreamRecord . We are planning on upgrading to Wowza Streaming Engine 4.0 . Following is code for onPublish . As we have multiple stream recordings we maintain a list of recorders so that if exists we can stop on republish . Recording is fine but when reconnecting nothing happens , no log in wowza and Flash encoder just cant connect to wowza app . Is there anything I am doing wrong here ?
private HashMap<String, ILiveStreamRecordManager> recorders = new HashMap<String, ILiveStreamRecordManager>();
public void onPublish(final IMediaStream stream, String streamName, boolean isRecord, boolean isAppend) {
String streamName = stream.getName();
IApplicationInstance appInstance = stream.getClient().getAppInstance();
IVHost vhost = null;
vhost = appInstance.getVHost();
ILiveStreamRecordManager recorder = recorders.get(streamName);
if (recorder != null) {
getLogger().info("Recorder already existed");
recorder.stopRecording(stream.getClient().getAppInstance());
}
recorder = vhost.getLiveStreamRecordManager();
StreamRecorderParameters srp = new StreamRecorderParameters(stream.getClient().getAppInstance());
srp.outputPath = outputPath;
srp.outputFile = outputFile;
srp.segmentationType = IStreamRecorderConstants.SEGMENT_NONE;
srp.versioningOption = IStreamRecorderConstants.APPEND_FILE;
getLogger().info("Befre Recording: " + srp.outputPath + ":" + srp.outputFile);
recorder.startRecording(appInstance, srp);
getLogger().info("Started Recording: ");
synchronized (recorders) {
recorders.put(streamName, recorder);
}
}