Attach external API listeners early

This avoids any problems caused by the initialization of any of the
extra services initialization failures.
This commit is contained in:
Saúl Ibarra Corretgé 2020-06-04 10:53:32 +02:00
parent a1ec905ff3
commit 328ff76016
1 changed files with 10 additions and 9 deletions

View File

@ -270,6 +270,16 @@ class Conference extends Component<Props, State> {
...urlParameters
});
this._api.on('suspendDetected', this._onVideoConferenceEnded);
this._api.on('readyToClose', this._onVideoConferenceEnded);
this._api.on('videoConferenceJoined',
(conferenceInfo: Object) => {
this.props.dispatch(conferenceJoined(this._conference));
this._onVideoConferenceJoined(conferenceInfo);
}
);
const { RemoteControl,
setupScreenSharingRender,
setupAlwaysOnTopRender,
@ -292,15 +302,6 @@ class Conference extends Component<Props, State> {
setupWiFiStats(iframe);
setupPowerMonitorRender(this._api);
this._api.on('suspendDetected', this._onVideoConferenceEnded);
this._api.on('readyToClose', this._onVideoConferenceEnded);
this._api.on('videoConferenceJoined',
(conferenceInfo: Object) => {
this.props.dispatch(conferenceJoined(this._conference));
this._onVideoConferenceJoined(conferenceInfo);
}
);
}
_onVideoConferenceEnded: (*) => void;