Skip to content

Commit

Permalink
Fix content disapearing in demo when remote video is enabled (#2895)
Browse files Browse the repository at this point in the history
  • Loading branch information
hensmi-amazon authored May 30, 2024
1 parent e0e5217 commit a0af834
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
11 changes: 8 additions & 3 deletions demos/browser/app/meetingV2/video/VideoTileCollection.ts
Original file line number Diff line number Diff line change
Expand Up @@ -152,9 +152,8 @@ export default class VideoTileCollection implements AudioVideoObserver {
for (const source of videoSources) {
this.pagination.add(source.attendee.attendeeId);
}
const localTileId = this.localTileId()
this.pagination.removeIf((value: string) => {
return !videoSources.some((source: VideoSource) => source.attendee.attendeeId === value) && (localTileId && this.tileIdToAttendeeId[localTileId] !== value);
return !videoSources.some((source: VideoSource) => source.attendee.attendeeId === value) && !this.isLocalAttendee(value);
});

// Update the preference manager explicitly as it needs to add default preferences
Expand Down Expand Up @@ -211,7 +210,7 @@ export default class VideoTileCollection implements AudioVideoObserver {
demoVideoTile.attendeeId = tileState.boundAttendeeId;

// We need to add local video or content to pagination from tile updates
const shouldUpdatePagination = tileState.localTile || (tileState.isContent && tileState.boundAttendeeId.startsWith(this.localAttendeeId));
const shouldUpdatePagination = this.isLocalAttendee(tileState.boundAttendeeId);
if (tileState.boundVideoStream) {
if (shouldUpdatePagination) {
this.pagination.add(tileState.boundAttendeeId);
Expand Down Expand Up @@ -246,6 +245,12 @@ export default class VideoTileCollection implements AudioVideoObserver {
this.updateLayout();
}

private isLocalAttendee(attendeeId: string) {
// This covers both the actual local attendee ID and the attendee ID
// of any local content share
return attendeeId.startsWith(this.localAttendeeId);
}

showVideoWebRTCStats(videoMetricReport: { [id: string]: { [id: string]: {} } }): void {
this.logger.info(`showing stats ${JSON.stringify(videoMetricReport)}`)
const videoTiles = this.videoTileController.getAllVideoTiles();
Expand Down
2 changes: 1 addition & 1 deletion demos/browser/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit a0af834

Please sign in to comment.