mirror of https://github.com/OpenVidu/openvidu.git
openvidu-browser: sessionDisconnected event on failed reconnection with no Connection
parent
219d45bfe9
commit
6b6d6c2ba4
|
@ -19,6 +19,7 @@ import { LocalRecorder } from './LocalRecorder';
|
||||||
import { Publisher } from './Publisher';
|
import { Publisher } from './Publisher';
|
||||||
import { Session } from './Session';
|
import { Session } from './Session';
|
||||||
import { Stream } from './Stream';
|
import { Stream } from './Stream';
|
||||||
|
import { SessionDisconnectedEvent } from '../OpenViduInternal/Events/SessionDisconnectedEvent';
|
||||||
import { StreamPropertyChangedEvent } from '../OpenViduInternal/Events/StreamPropertyChangedEvent';
|
import { StreamPropertyChangedEvent } from '../OpenViduInternal/Events/StreamPropertyChangedEvent';
|
||||||
import { Device } from '../OpenViduInternal/Interfaces/Public/Device';
|
import { Device } from '../OpenViduInternal/Interfaces/Public/Device';
|
||||||
import { OpenViduAdvancedConfiguration } from '../OpenViduInternal/Interfaces/Public/OpenViduAdvancedConfiguration';
|
import { OpenViduAdvancedConfiguration } from '../OpenViduInternal/Interfaces/Public/OpenViduAdvancedConfiguration';
|
||||||
|
@ -1039,6 +1040,10 @@ export class OpenVidu {
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
logger.warn('There was no previous connection when running reconnection callback');
|
logger.warn('There was no previous connection when running reconnection callback');
|
||||||
|
// Make Session object dispatch 'sessionDisconnected' event
|
||||||
|
const sessionDisconnectEvent = new SessionDisconnectedEvent(this.session, 'networkDisconnect');
|
||||||
|
this.session.ee.emitEvent('sessionDisconnected', [sessionDisconnectEvent]);
|
||||||
|
sessionDisconnectEvent.callDefaultBehavior();
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
alert('Connection error. Please reload page.');
|
alert('Connection error. Please reload page.');
|
||||||
|
|
Loading…
Reference in New Issue