mirror of https://github.com/OpenVidu/openvidu.git
openvidu-browser: better logging when reconnecting media streams
parent
4ae63984a2
commit
46f0ad564e
|
@ -1034,19 +1034,25 @@ export class Session implements EventDispatcher {
|
||||||
* @hidden
|
* @hidden
|
||||||
*/
|
*/
|
||||||
reconnectBrokenStreams(): void {
|
reconnectBrokenStreams(): void {
|
||||||
console.info('Re-establishing media connections');
|
console.info('Re-establishing media connections...');
|
||||||
|
let someReconnection = false;
|
||||||
// Re-establish Publisher stream
|
// Re-establish Publisher stream
|
||||||
if (!!this.connection.stream && this.connection.stream.streamIceConnectionStateBroken()) {
|
if (!!this.connection.stream && this.connection.stream.streamIceConnectionStateBroken()) {
|
||||||
console.warn('Re-establishing Publisher ' + this.connection.stream.streamId);
|
console.warn('Re-establishing Publisher ' + this.connection.stream.streamId);
|
||||||
this.connection.stream.initWebRtcPeerSend(true);
|
this.connection.stream.initWebRtcPeerSend(true);
|
||||||
|
someReconnection = true;
|
||||||
}
|
}
|
||||||
// Re-establish Subscriber streams
|
// Re-establish Subscriber streams
|
||||||
for (let remoteConnection of Object.values(this.remoteConnections)) {
|
for (let remoteConnection of Object.values(this.remoteConnections)) {
|
||||||
if (!!remoteConnection.stream && remoteConnection.stream.streamIceConnectionStateBroken()) {
|
if (!!remoteConnection.stream && remoteConnection.stream.streamIceConnectionStateBroken()) {
|
||||||
console.warn('Re-establishing Subscriber ' + remoteConnection.stream.streamId);
|
console.warn('Re-establishing Subscriber ' + remoteConnection.stream.streamId);
|
||||||
remoteConnection.stream.initWebRtcPeerReceive(true);
|
remoteConnection.stream.initWebRtcPeerReceive(true);
|
||||||
|
someReconnection = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (!someReconnection) {
|
||||||
|
console.info('There were no media streams in need of a reconnection');
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Reference in New Issue