forked from mystiq/hydrogen-web
prevent localMedia being disposed when disconnecting on session change
this would cause us to not send any media anymore and a black screen on the other side that just refreshed
This commit is contained in:
parent
beeb191588
commit
6b22078140
1 changed files with 9 additions and 3 deletions
|
@ -112,8 +112,8 @@ export class Member {
|
||||||
}
|
}
|
||||||
|
|
||||||
/** @internal */
|
/** @internal */
|
||||||
disconnect(hangup: boolean, log?: ILogItem) {
|
disconnect(hangup: boolean) {
|
||||||
(log ?? this.logItem).wrap("disconnect", log => {
|
this.logItem.wrap("disconnect", log => {
|
||||||
if (hangup) {
|
if (hangup) {
|
||||||
this.peerCall?.hangup(CallErrorCode.UserHangup);
|
this.peerCall?.hangup(CallErrorCode.UserHangup);
|
||||||
} else {
|
} else {
|
||||||
|
@ -136,7 +136,13 @@ export class Member {
|
||||||
oldSessionId: this.sessionId,
|
oldSessionId: this.sessionId,
|
||||||
newSessionId: callDeviceMembership.session_id
|
newSessionId: callDeviceMembership.session_id
|
||||||
}, log => {
|
}, log => {
|
||||||
this.disconnect(false, log);
|
// prevent localMedia from being stopped
|
||||||
|
// as connect won't be called again when reconnecting
|
||||||
|
// to the new session
|
||||||
|
const localMedia = this.localMedia;
|
||||||
|
this.localMedia = undefined;
|
||||||
|
this.disconnect(false);
|
||||||
|
this.localMedia = localMedia;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
this.callDeviceMembership = callDeviceMembership;
|
this.callDeviceMembership = callDeviceMembership;
|
||||||
|
|
Loading…
Reference in a new issue