openvidu-server: add media_node_id property on Recording objects

pull/609/head
pabloFuente 2021-03-03 14:31:31 +01:00
parent a7918ba174
commit c36ad3e282
4 changed files with 13 additions and 2 deletions

View File

@ -56,6 +56,9 @@ public class CDREventRecording extends CDREventEnd {
&& this.recording.getCustomLayout() != null && !this.recording.getCustomLayout().isEmpty()) { && this.recording.getCustomLayout() != null && !this.recording.getCustomLayout().isEmpty()) {
json.addProperty("customLayout", this.recording.getCustomLayout()); json.addProperty("customLayout", this.recording.getCustomLayout());
} }
if (this.recording.getRecordingProperties().mediaNode() != null) {
json.addProperty("media_node_id", this.recording.getRecordingProperties().mediaNode());
}
} }
json.addProperty("hasAudio", this.recording.hasAudio()); json.addProperty("hasAudio", this.recording.hasAudio());
json.addProperty("hasVideo", this.recording.hasVideo()); json.addProperty("hasVideo", this.recording.hasVideo());

View File

@ -51,6 +51,9 @@ public class CDREventRecordingStatus extends CDREventEnd {
&& this.recording.getCustomLayout() != null && !this.recording.getCustomLayout().isEmpty()) { && this.recording.getCustomLayout() != null && !this.recording.getCustomLayout().isEmpty()) {
json.addProperty("customLayout", this.recording.getCustomLayout()); json.addProperty("customLayout", this.recording.getCustomLayout());
} }
if (this.recording.getRecordingProperties().mediaNode() != null) {
json.addProperty("media_node_id", this.recording.getRecordingProperties().mediaNode());
}
} }
json.addProperty("hasAudio", this.recording.hasAudio()); json.addProperty("hasAudio", this.recording.hasAudio());
json.addProperty("hasVideo", this.recording.hasVideo()); json.addProperty("hasVideo", this.recording.hasVideo());

View File

@ -208,6 +208,9 @@ public class Recording {
if (withUniqueSessionId) { if (withUniqueSessionId) {
json.addProperty("uniqueSessionId", this.uniqueSessionId); json.addProperty("uniqueSessionId", this.uniqueSessionId);
} }
if (this.recordingProperties.mediaNode() != null) {
json.addProperty("mediaNode", this.recordingProperties.mediaNode());
}
json.addProperty("createdAt", this.createdAt); json.addProperty("createdAt", this.createdAt);
json.addProperty("size", this.size); json.addProperty("size", this.size);
json.addProperty("duration", this.duration); json.addProperty("duration", this.duration);

View File

@ -299,9 +299,10 @@ public class RecordingManager {
} }
this.recordingFromStartingToStarted(recording); this.recordingFromStartingToStarted(recording);
this.cdr.recordRecordingStarted(recording);
this.cdr.recordRecordingStatusChanged(recording, null, recording.getCreatedAt(), this.cdr.recordRecordingStatusChanged(recording, null, recording.getCreatedAt(),
Status.started); Status.started);
// TODO: remove deprecated "recordingStarted" event
this.cdr.recordRecordingStarted(recording);
if (!(OutputMode.COMPOSED.equals(properties.outputMode()) && properties.hasVideo())) { if (!(OutputMode.COMPOSED.equals(properties.outputMode()) && properties.hasVideo())) {
// Directly send recording started notification for all cases except for // Directly send recording started notification for all cases except for
@ -363,7 +364,8 @@ public class RecordingManager {
final long timestamp = System.currentTimeMillis(); final long timestamp = System.currentTimeMillis();
this.cdr.recordRecordingStatusChanged(recording, reason, timestamp, Status.stopped); this.cdr.recordRecordingStatusChanged(recording, reason, timestamp, Status.stopped);
cdr.recordRecordingStopped(recording, reason, timestamp); // TODO: remove deprecated "recordingStopped" event
this.cdr.recordRecordingStopped(recording, reason, timestamp);
switch (recording.getOutputMode()) { switch (recording.getOutputMode()) {
case COMPOSED: case COMPOSED: