mirror of https://github.com/OpenVidu/openvidu.git
openvidu-testapp: reconnecting and reconnected Session events
parent
aee989c7d5
commit
5b40b7d5e1
|
@ -118,7 +118,9 @@ export class OpenviduInstanceComponent implements OnInit, OnChanges, OnDestroy {
|
|||
recordingStopped: true,
|
||||
signal: true,
|
||||
publisherStartSpeaking: false,
|
||||
publisherStopSpeaking: false
|
||||
publisherStopSpeaking: false,
|
||||
reconnecting: true,
|
||||
reconnected: true
|
||||
};
|
||||
|
||||
// Session properties dialog
|
||||
|
@ -222,7 +224,9 @@ export class OpenviduInstanceComponent implements OnInit, OnChanges, OnDestroy {
|
|||
recordingStopped: false,
|
||||
signal: false,
|
||||
publisherStartSpeaking: true,
|
||||
publisherStopSpeaking: true
|
||||
publisherStopSpeaking: true,
|
||||
reconnecting: true,
|
||||
reconnected: true
|
||||
}, true);
|
||||
|
||||
this.session.connect(token, this.clientData)
|
||||
|
@ -445,6 +449,25 @@ export class OpenviduInstanceComponent implements OnInit, OnChanges, OnDestroy {
|
|||
});
|
||||
}
|
||||
}
|
||||
|
||||
if (this.sessionEvents.reconnecting !== oldValues.reconnecting || firstTime) {
|
||||
this.session.off('reconnecting');
|
||||
if (this.sessionEvents.reconnecting) {
|
||||
this.session.on('reconnecting', () => {
|
||||
this.updateEventList('reconnecting', '', undefined);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
if (this.sessionEvents.reconnected !== oldValues.reconnected || firstTime) {
|
||||
this.session.off('reconnected');
|
||||
if (this.sessionEvents.reconnected) {
|
||||
this.session.on('reconnected', () => {
|
||||
this.updateEventList('reconnected', '', undefined);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
syncInitPublisher() {
|
||||
|
@ -596,7 +619,9 @@ export class OpenviduInstanceComponent implements OnInit, OnChanges, OnDestroy {
|
|||
recordingStopped: this.sessionEvents.recordingStopped,
|
||||
signal: this.sessionEvents.signal,
|
||||
publisherStartSpeaking: this.sessionEvents.publisherStartSpeaking,
|
||||
publisherStopSpeaking: this.sessionEvents.publisherStopSpeaking
|
||||
publisherStopSpeaking: this.sessionEvents.publisherStopSpeaking,
|
||||
reconnecting: this.sessionEvents.reconnecting,
|
||||
reconnected: this.sessionEvents.reconnected
|
||||
};
|
||||
|
||||
const dialogRef = this.dialog.open(EventsDialogComponent, {
|
||||
|
@ -626,7 +651,9 @@ export class OpenviduInstanceComponent implements OnInit, OnChanges, OnDestroy {
|
|||
recordingStopped: result.recordingStopped,
|
||||
signal: result.signal,
|
||||
publisherStartSpeaking: result.publisherStartSpeaking,
|
||||
publisherStopSpeaking: result.publisherStopSpeaking
|
||||
publisherStopSpeaking: result.publisherStopSpeaking,
|
||||
reconnecting: result.reconnecting,
|
||||
reconnected: result.reconnected
|
||||
};
|
||||
document.getElementById('session-events-btn-' + this.index).classList.remove('cdk-program-focused');
|
||||
});
|
||||
|
|
Loading…
Reference in New Issue