clone localMedia in Member when connection, like we do for setMedia
This commit is contained in:
parent
f187a51c97
commit
2f08cd8984
2 changed files with 3 additions and 4 deletions
|
@ -510,8 +510,7 @@ export class GroupCall extends EventEmitter<{change: never}> {
|
||||||
const logItem = joinedData.membersLogItem.child({l: "member", id: memberKey});
|
const logItem = joinedData.membersLogItem.child({l: "member", id: memberKey});
|
||||||
logItem.set("sessionId", member.sessionId);
|
logItem.set("sessionId", member.sessionId);
|
||||||
log.wrap({l: "connect", id: memberKey}, log => {
|
log.wrap({l: "connect", id: memberKey}, log => {
|
||||||
// Safari can't send a MediaStream to multiple sources, so clone it
|
const connectItem = member.connect(joinedData.localMedia, joinedData.localMuteSettings, logItem);
|
||||||
const connectItem = member.connect(joinedData.localMedia.clone(), joinedData.localMuteSettings, logItem);
|
|
||||||
if (connectItem) {
|
if (connectItem) {
|
||||||
log.refDetached(connectItem);
|
log.refDetached(connectItem);
|
||||||
}
|
}
|
||||||
|
|
|
@ -116,7 +116,8 @@ export class Member {
|
||||||
if (this.connection) {
|
if (this.connection) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
const connection = new MemberConnection(localMedia, localMuteSettings, memberLogItem);
|
// Safari can't send a MediaStream to multiple sources, so clone it
|
||||||
|
const connection = new MemberConnection(localMedia.clone(), localMuteSettings, memberLogItem);
|
||||||
this.connection = connection;
|
this.connection = connection;
|
||||||
let connectLogItem;
|
let connectLogItem;
|
||||||
connection.logItem.wrap("connect", async log => {
|
connection.logItem.wrap("connect", async log => {
|
||||||
|
@ -293,7 +294,6 @@ export class Member {
|
||||||
async setMedia(localMedia: LocalMedia, previousMedia: LocalMedia): Promise<void> {
|
async setMedia(localMedia: LocalMedia, previousMedia: LocalMedia): Promise<void> {
|
||||||
const {connection} = this;
|
const {connection} = this;
|
||||||
if (connection) {
|
if (connection) {
|
||||||
// TODO: see if we can simplify this
|
|
||||||
connection.localMedia = localMedia.replaceClone(connection.localMedia, previousMedia);
|
connection.localMedia = localMedia.replaceClone(connection.localMedia, previousMedia);
|
||||||
await connection.peerCall?.setMedia(connection.localMedia, connection.logItem);
|
await connection.peerCall?.setMedia(connection.localMedia, connection.logItem);
|
||||||
}
|
}
|
||||||
|
|
Reference in a new issue