fix(room): preserve Viewer capacity across sharing generations (#307)
This commit is contained in:
1 parent
a39b597396
commit
42e756e00a
7 files changed
+60
-16
No files matched your search
@@ -918,11 +918,22 @@ export class HybridMediaRouter {
|
||||
this.options.deleteConnectionId(roomId, peerId);
|
||||
if (room?.controller?.confirmDeparture(peerId, this.now())) {
|
||||
this.requestPump(roomId);
|
||||
} else if (room && !room.controller && room.advertisedCapacityByViewer.size === 0) {
|
||||
this.rooms.delete(roomId);
|
||||
}
|
||||
}
|
||||
|
||||
stopRoom(roomId: string): void {
|
||||
const capacities = new Map(
|
||||
this.rooms.get(roomId)?.advertisedCapacityByViewer ?? [],
|
||||
);
|
||||
this.clearRoom(roomId);
|
||||
if (capacities.size > 0) {
|
||||
const room = this.room(roomId);
|
||||
for (const [peerId, capacity] of capacities) {
|
||||
room.advertisedCapacityByViewer.set(peerId, capacity);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
deleteRoom(roomId: string): void {
|
||||
|
||||
Reference in new issue
Block a user