Get Status of Recordings

You can check the status of a recording by leveraging the HTTP provider provided here and adding a bit of code as follows:

int recordState = recorder.getRecorderState();
switch(IStreamRecorderConstants.RECORDER_STATE_ERROR){
case IStreamRecorderConstants.RECORDER_STATE_ERROR:
//do something
break;
case IStreamRecorderConstants.RECORDER_STATE_PENDING:
//do something
break;
case IStreamRecorderConstants.RECORDER_STATE_WAITING:
//do something
break;
case IStreamRecorderConstants.RECORDER_STATE_RECORDING:
//do something
break;
}

This would be in the midst of looping through the recorders (in the previous code) as follows:

Map<String, IStreamRecorder> recordingMap = vhost.getLiveStreamRecordManager().getRecordersMap(appInstance);
Set<String> recorders = recordingMap.keySet();

for(String key : recorders){

IStreamRecorder recorder = recordingMap.get(key);
int recordState = recorder.getRecorderState();
switch(IStreamRecorderConstants.RECORDER_STATE_ERROR){
case IStreamRecorderConstants.RECORDER_STATE_ERROR:
//do something
break;
case IStreamRecorderConstants.RECORDER_STATE_PENDING:
//do something
break;
case IStreamRecorderConstants.RECORDER_STATE_WAITING:
//do something
break;
case IStreamRecorderConstants.RECORDER_STATE_RECORDING:
//do something
break;
}

// …. etc

 


Comments are closed.