openvidu-server: add IceCandidates only after webEndpoint is available

pull/457/head
pabloFuente 2020-04-30 14:01:55 +02:00
parent bd262257f0
commit a922b95d95
1 changed files with 9 additions and 4 deletions

View File

@ -214,10 +214,10 @@ public abstract class MediaEndpoint {
internalEndpointInitialization(endpointLatch); internalEndpointInitialization(endpointLatch);
} else { } else {
endpointLatch.countDown(); endpointLatch.countDown();
} if (this.isWeb()) {
if (this.isWeb()) { while (!candidates.isEmpty()) {
while (!candidates.isEmpty()) { internalAddIceCandidate(candidates.removeFirst());
internalAddIceCandidate(candidates.removeFirst()); }
} }
} }
return old; return old;
@ -291,6 +291,11 @@ public abstract class MediaEndpoint {
} }
endpointLatch.countDown(); endpointLatch.countDown();
while (!candidates.isEmpty()) {
internalAddIceCandidate(candidates.removeFirst());
}
log.trace("EP {}: Created a new WebRtcEndpoint", endpointName); log.trace("EP {}: Created a new WebRtcEndpoint", endpointName);
endpointSubscription = registerElemErrListener(webEndpoint); endpointSubscription = registerElemErrListener(webEndpoint);