mirror of https://github.com/OpenVidu/openvidu.git
Recovered connection event added to openvidu-browser
parent
de27312d1e
commit
6ef7425785
|
@ -658,6 +658,11 @@ export class OpenVidu {
|
||||||
|
|
||||||
private reconnectedCallback(): void {
|
private reconnectedCallback(): void {
|
||||||
console.warn('Websocket reconnected');
|
console.warn('Websocket reconnected');
|
||||||
|
if (this.isRoomAvailable()) {
|
||||||
|
this.session.onRecoveredConnection();
|
||||||
|
} else {
|
||||||
|
alert('Connection error. Please reload page.');
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private isRoomAvailable(): boolean {
|
private isRoomAvailable(): boolean {
|
||||||
|
|
|
@ -869,6 +869,26 @@ export class Session implements EventDispatcher {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @hidden
|
||||||
|
*/
|
||||||
|
onRecoveredConnection(): void {
|
||||||
|
|
||||||
|
/*if (!this.connection) {
|
||||||
|
|
||||||
|
console.warn('Not connected to session: if you are not debugging, this is probably a certificate error');
|
||||||
|
|
||||||
|
const url = 'https://' + this.openvidu.getWsUri().split('wss://')[1].split('/openvidu')[0];
|
||||||
|
if (window.confirm('If you are not debugging, this is probably a certificate error at \"' + url + '\"\n\nClick OK to navigate and accept it')) {
|
||||||
|
location.assign(url + '/accept-certificate');
|
||||||
|
}
|
||||||
|
return;
|
||||||
|
}*/
|
||||||
|
|
||||||
|
console.warn('Recovered connection in Session ' + this.sessionId);
|
||||||
|
this.ee.emitEvent('connectionRecovered', []);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @hidden
|
* @hidden
|
||||||
*/
|
*/
|
||||||
|
|
Loading…
Reference in New Issue