mirror of https://github.com/OpenVidu/openvidu.git
openvidu-browser: fix log for getRemoteConnection
parent
d320da622c
commit
b4c6c2b4a7
|
@ -781,7 +781,7 @@ export class Session extends EventDispatcher {
|
||||||
onParticipantLeft(msg): void {
|
onParticipantLeft(msg): void {
|
||||||
|
|
||||||
if (this.remoteConnections.size > 0) {
|
if (this.remoteConnections.size > 0) {
|
||||||
this.getRemoteConnection(msg.connectionId).then(connection => {
|
this.getRemoteConnection(msg.connectionId, 'onParticipantLeft').then(connection => {
|
||||||
if (!!connection.stream) {
|
if (!!connection.stream) {
|
||||||
const stream = connection.stream;
|
const stream = connection.stream;
|
||||||
|
|
||||||
|
@ -823,7 +823,7 @@ export class Session extends EventDispatcher {
|
||||||
// Get the existing Connection created on 'onParticipantJoined' for
|
// Get the existing Connection created on 'onParticipantJoined' for
|
||||||
// existing participants or create a new one for new participants
|
// existing participants or create a new one for new participants
|
||||||
let connection: Connection;
|
let connection: Connection;
|
||||||
this.getRemoteConnection(response.id)
|
this.getRemoteConnection(response.id, 'onParticipantPublished')
|
||||||
|
|
||||||
.then(con => {
|
.then(con => {
|
||||||
// Update existing Connection
|
// Update existing Connection
|
||||||
|
@ -848,7 +848,7 @@ export class Session extends EventDispatcher {
|
||||||
// Your stream has been forcedly unpublished from the session
|
// Your stream has been forcedly unpublished from the session
|
||||||
this.stopPublisherStream(msg.reason);
|
this.stopPublisherStream(msg.reason);
|
||||||
} else {
|
} else {
|
||||||
this.getRemoteConnection(msg.connectionId)
|
this.getRemoteConnection(msg.connectionId, 'onParticipantUnpublished')
|
||||||
|
|
||||||
.then(connection => {
|
.then(connection => {
|
||||||
|
|
||||||
|
@ -965,7 +965,7 @@ export class Session extends EventDispatcher {
|
||||||
// Your stream has been forcedly changed (filter feature)
|
// Your stream has been forcedly changed (filter feature)
|
||||||
callback(this.connection);
|
callback(this.connection);
|
||||||
} else {
|
} else {
|
||||||
this.getRemoteConnection(msg.connectionId)
|
this.getRemoteConnection(msg.connectionId, 'onStreamPropertyChanged')
|
||||||
.then(connection => {
|
.then(connection => {
|
||||||
callback(connection);
|
callback(connection);
|
||||||
})
|
})
|
||||||
|
@ -1411,7 +1411,7 @@ export class Session extends EventDispatcher {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
private getRemoteConnection(connectionId: string): Promise<Connection> {
|
private getRemoteConnection(connectionId: string, operation: string): Promise<Connection> {
|
||||||
return new Promise<Connection>((resolve, reject) => {
|
return new Promise<Connection>((resolve, reject) => {
|
||||||
const connection = this.remoteConnections.get(connectionId);
|
const connection = this.remoteConnections.get(connectionId);
|
||||||
if (!!connection) {
|
if (!!connection) {
|
||||||
|
@ -1419,9 +1419,8 @@ export class Session extends EventDispatcher {
|
||||||
resolve(connection);
|
resolve(connection);
|
||||||
} else {
|
} else {
|
||||||
// Remote connection not found. Reject with OpenViduError
|
// Remote connection not found. Reject with OpenViduError
|
||||||
const errorMessage = 'Remote connection ' + connectionId + " unknown when 'onParticipantLeft'. " +
|
const errorMessage = 'Remote connection ' + connectionId + " unknown when '" + operation + "'. " +
|
||||||
'Existing remote connections: ' + JSON.stringify(this.remoteConnections.keys());
|
'Existing remote connections: ' + JSON.stringify(this.remoteConnections.keys());
|
||||||
|
|
||||||
reject(new OpenViduError(OpenViduErrorName.GENERIC_ERROR, errorMessage));
|
reject(new OpenViduError(OpenViduErrorName.GENERIC_ERROR, errorMessage));
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in New Issue