Skip to content

Commit

Permalink
Fix the demo to display thunderbolt when paused by policy (#1780)
Browse files Browse the repository at this point in the history
Co-authored-by: Venkatesh Devale <61809205+devalevenkatesh@users.noreply.github.com>
  • Loading branch information
2 people authored and xuesichao committed Nov 11, 2021
1 parent 9985d57 commit cb4548d
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 5 deletions.
6 changes: 2 additions & 4 deletions demos/browser/app/meetingV2/meetingV2.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3149,14 +3149,12 @@ export class DemoMeetingApp

tileWillBePausedByDownlinkPolicy(tileId: number): void {
this.log(`Tile ${tileId} will be paused due to insufficient bandwidth`);
const attendeeId = this.audioVideo.getVideoTile(tileId)?.state().boundAttendeeId;
this.roster[attendeeId].bandwidthConstrained = true;
this.videoTileCollection.bandwidthConstrainedTiles.add(tileId);
}

tileWillBeUnpausedByDownlinkPolicy(tileId: number): void {
this.log(`Tile ${tileId} will be resumed due to sufficient bandwidth`);
const attendeeId = this.audioVideo.getVideoTile(tileId)?.state().boundAttendeeId;
this.roster[attendeeId].bandwidthConstrained = false;
this.videoTileCollection.bandwidthConstrainedTiles.delete(tileId);
}
}

Expand Down
9 changes: 8 additions & 1 deletion demos/browser/app/meetingV2/video/VideoTileCollection.ts
Original file line number Diff line number Diff line change
Expand Up @@ -103,14 +103,16 @@ export default class VideoTileCollection implements AudioVideoObserver {
tileArea = document.getElementById('tile-area') as HTMLDivElement;
tileIndexToDemoVideoTile = new Map<number, DemoVideoTile>();

bandwidthConstrainedTiles = new Set<number>();

_activeSpeakerAttendeeId = "";
public set activeSpeakerAttendeeId(id: string) {
this.logger.info(`setting act spk to ${id}`)
this._activeSpeakerAttendeeId = id;
this.layoutFeaturedTile();
}

constructor(private videoTileController: VideoTileControllerFacade,
constructor(private videoTileController: VideoTileControllerFacade,
private logger: Logger,
private videoPreferenceManager?: VideoPreferenceManager) {
this.setupVideoTiles();
Expand Down Expand Up @@ -160,6 +162,11 @@ export default class VideoTileCollection implements AudioVideoObserver {
if (tileState.boundExternalUserId) {
demoVideoTile.nameplate = tileState.boundExternalUserId.split('#').slice(-1)[0];
}
if (tileState.paused && this.bandwidthConstrainedTiles.has(tileState.tileId)) {
demoVideoTile.pauseState = '⚡';
} else {
demoVideoTile.pauseState = '';
}
demoVideoTile.attendeeId = tileState.boundAttendeeId;
demoVideoTile.show(tileState.isContent);
this.updateGridClasses();
Expand Down

0 comments on commit cb4548d

Please sign in to comment.