Good day.
In 5.2 builds, stream recording is significally changed under the hoods to provide more stability and performance. Now, recording file name is known only when recording is finished, because
recording file name template can contain timestamp fields. So stream.getRecordName() returns a valid file name only when
STREAM_STATUS.UNPUBLISHED
event is received. You have to modify your code as follows:
Java:
publishStream.on(new StreamStatusEvent() {
@Override
public void onStreamStatus(final Stream stream, final StreamStatus streamStatus) {
runOnUiThread(new Runnable() {
@Override
public void run() {
if (StreamStatus.PUBLISHING.equals(streamStatus)) {
...
} else if (StreamStatus.FAILED.equals(streamStatus)) {
...
} else if (StreamStatus.UNPUBLISHED.equals(streamStatus)) {
recordFilename = stream.getRecordName();
}
mStatusView.setText(streamStatus.toString());
}
});
}
});
Or, if you want to know recording file name before stream recording is finished,
file name template should be formed from parameters which can be obtained by REST API, for example
Code:
stream_record_policy_template={streamName}-{mediaSessionId}
In this case, you should get media session Id by
REST API query /stream/find