mirror of https://github.com/OpenVidu/openvidu.git
openvidu-server: fix receiveVideoFrom IPCAM
parent
78deea7f3b
commit
2f397c42c0
|
@ -104,7 +104,7 @@ public class KurentoParticipant extends Participant {
|
||||||
String type = mediaOptions.hasVideo() ? mediaOptions.getTypeOfVideo() : "MICRO";
|
String type = mediaOptions.hasVideo() ? mediaOptions.getTypeOfVideo() : "MICRO";
|
||||||
final String publisherStreamId = IdentifierPrefixes.STREAM_ID + type.substring(0, Math.min(type.length(), 3))
|
final String publisherStreamId = IdentifierPrefixes.STREAM_ID + type.substring(0, Math.min(type.length(), 3))
|
||||||
+ "_" + RandomStringUtils.randomAlphabetic(1).toUpperCase() + RandomStringUtils.randomAlphanumeric(3)
|
+ "_" + RandomStringUtils.randomAlphabetic(1).toUpperCase() + RandomStringUtils.randomAlphanumeric(3)
|
||||||
+ "_" + this.getParticipantPublicId().substring(4, this.getParticipantPublicId().length());
|
+ "_" + this.getParticipantPublicId();
|
||||||
publisher.setStreamId(publisherStreamId);
|
publisher.setStreamId(publisherStreamId);
|
||||||
publisher.setEndpointName(publisherStreamId);
|
publisher.setEndpointName(publisherStreamId);
|
||||||
publisher.setMediaOptions(mediaOptions);
|
publisher.setMediaOptions(mediaOptions);
|
||||||
|
|
|
@ -326,9 +326,19 @@ public class RpcHandler extends DefaultJsonRpcHandler<JsonObject> {
|
||||||
}
|
}
|
||||||
|
|
||||||
String senderPublicId = getStringParam(request, ProtocolElements.RECEIVEVIDEO_SENDER_PARAM);
|
String senderPublicId = getStringParam(request, ProtocolElements.RECEIVEVIDEO_SENDER_PARAM);
|
||||||
|
|
||||||
// Parse sender public id from stream id
|
// Parse sender public id from stream id
|
||||||
senderPublicId = IdentifierPrefixes.PARTICIPANT_PUBLIC_ID
|
if (senderPublicId.startsWith(IdentifierPrefixes.STREAM_ID + "IPC_")
|
||||||
+ senderPublicId.substring(senderPublicId.lastIndexOf("_") + 1, senderPublicId.length());
|
&& senderPublicId.contains(IdentifierPrefixes.IPCAM_ID)) {
|
||||||
|
// If IPCAM
|
||||||
|
senderPublicId = senderPublicId.substring(senderPublicId.indexOf("_" + IdentifierPrefixes.IPCAM_ID) + 1,
|
||||||
|
senderPublicId.length());
|
||||||
|
} else {
|
||||||
|
// Not IPCAM
|
||||||
|
senderPublicId = senderPublicId.substring(
|
||||||
|
senderPublicId.lastIndexOf(IdentifierPrefixes.PARTICIPANT_PUBLIC_ID), senderPublicId.length());
|
||||||
|
}
|
||||||
|
|
||||||
String sdpOffer = getStringParam(request, ProtocolElements.RECEIVEVIDEO_SDPOFFER_PARAM);
|
String sdpOffer = getStringParam(request, ProtocolElements.RECEIVEVIDEO_SDPOFFER_PARAM);
|
||||||
|
|
||||||
sessionManager.subscribe(participant, senderPublicId, sdpOffer, request.getId());
|
sessionManager.subscribe(participant, senderPublicId, sdpOffer, request.getId());
|
||||||
|
|
Loading…
Reference in New Issue