Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Demo] Fix the demo to display thunderbolt when paused by policy #1780

Merged
merged 2 commits into from
Nov 10, 2021
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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