openvidu-testapp: ExceptionEvent support

pull/630/head
pabloFuente 2021-05-26 17:31:47 +02:00
parent 36906e84e0
commit 3a03409617
1 changed files with 19 additions and 6 deletions

View File

@ -6,7 +6,7 @@ import {
import { import {
OpenVidu, Session, Subscriber, Publisher, Event, StreamEvent, ConnectionEvent, OpenVidu, Session, Subscriber, Publisher, Event, StreamEvent, ConnectionEvent,
SessionDisconnectedEvent, SignalEvent, RecordingEvent, SessionDisconnectedEvent, SignalEvent, RecordingEvent,
PublisherSpeakingEvent, PublisherProperties, StreamPropertyChangedEvent, ConnectionPropertyChangedEvent, OpenViduError, NetworkQualityLevelChangedEvent PublisherSpeakingEvent, PublisherProperties, StreamPropertyChangedEvent, ConnectionPropertyChangedEvent, OpenViduError, NetworkQualityLevelChangedEvent, ExceptionEvent
} from 'openvidu-browser'; } from 'openvidu-browser';
import { import {
OpenVidu as OpenViduAPI, OpenVidu as OpenViduAPI,
@ -138,7 +138,8 @@ export class OpenviduInstanceComponent implements OnInit, OnChanges, OnDestroy {
publisherStartSpeaking: false, publisherStartSpeaking: false,
publisherStopSpeaking: false, publisherStopSpeaking: false,
reconnecting: true, reconnecting: true,
reconnected: true reconnected: true,
exception: true
}; };
// Session properties dialog // Session properties dialog
@ -247,8 +248,9 @@ export class OpenviduInstanceComponent implements OnInit, OnChanges, OnDestroy {
signal: false, signal: false,
publisherStartSpeaking: true, publisherStartSpeaking: true,
publisherStopSpeaking: true, publisherStopSpeaking: true,
reconnecting: true, reconnecting: false,
reconnected: true reconnected: false,
exception: false
}, true); }, true);
this.session.connect(token, this.clientData) this.session.connect(token, this.clientData)
@ -508,6 +510,15 @@ export class OpenviduInstanceComponent implements OnInit, OnChanges, OnDestroy {
} }
} }
if (this.sessionEvents.exception !== oldValues.exception || firstTime) {
this.session.off('exception');
if (this.sessionEvents.exception) {
this.session.on('exception', (event: ExceptionEvent) => {
this.updateEventList('exception', event.name, event);
});
}
}
} }
syncInitPublisher() { syncInitPublisher() {
@ -665,7 +676,8 @@ export class OpenviduInstanceComponent implements OnInit, OnChanges, OnDestroy {
publisherStartSpeaking: this.sessionEvents.publisherStartSpeaking, publisherStartSpeaking: this.sessionEvents.publisherStartSpeaking,
publisherStopSpeaking: this.sessionEvents.publisherStopSpeaking, publisherStopSpeaking: this.sessionEvents.publisherStopSpeaking,
reconnecting: this.sessionEvents.reconnecting, reconnecting: this.sessionEvents.reconnecting,
reconnected: this.sessionEvents.reconnected reconnected: this.sessionEvents.reconnected,
exception: this.sessionEvents.exception
}; };
const dialogRef = this.dialog.open(EventsDialogComponent, { const dialogRef = this.dialog.open(EventsDialogComponent, {
@ -699,7 +711,8 @@ export class OpenviduInstanceComponent implements OnInit, OnChanges, OnDestroy {
publisherStartSpeaking: result.publisherStartSpeaking, publisherStartSpeaking: result.publisherStartSpeaking,
publisherStopSpeaking: result.publisherStopSpeaking, publisherStopSpeaking: result.publisherStopSpeaking,
reconnecting: result.reconnecting, reconnecting: result.reconnecting,
reconnected: result.reconnected reconnected: result.reconnected,
exception: result.exception
}; };
document.getElementById('session-events-btn-' + this.index).classList.remove('cdk-program-focused'); document.getElementById('session-events-btn-' + this.index).classList.remove('cdk-program-focused');
}); });