AWS Chime videoTileDidUpdate loops through tiles too many times

381 Views Asked by At

Why does videoTileDidUpdate loop through each tile 4 times?

This is the basic demo hook up for AWS Chime SDK js.

const observer = {
    audioVideoDidStart () => {
        //Start our local user video
        var localTileId = meetingSession.audioVideo.startLocalVideoTile();
        meetingSession.audioVideo.bindVideoElement(localTileId, notaryVideoElement);
    },

    videoTileDidUpdate: tile =>{
        console.log("Tile", tile);
    }
}

Now try to add an attendee or contentShare and it loops through each tile 4 times:

tileId: 1,
active: false,
isContent: false,
isLocal: true,
boundAttendeeId: null

tileId: 1,
active: true,
isContent: false,
isLocal: true,
boundAttendeeId: <guid>

tileId: 1,
active: true,
isContent: false,
isLocal: true:
boundAttendeeId: null

tileId: 1,
active: false,
isContent: false,
isLocal: true:
boundAttendeeId: null

tileId: 2,
active: false,
isContent: false,
isLocal: false,
boundAttendeeId: null

tileId: 2,
active: false,
isContent: true,
isLocal: false,
boundAttendeeId: <guid>#content

tileId: 2,
active: true,
isConent: true,
isLocal: false,
boundAttendeeId: <guid>

tileId: 2,
active: false,
isContent: false,
isLocal: false,
boundAttendeeId: null

This is maddening as I cannot bind my content share correctly. See this as the recommended approach I followed: AWS ContentShare

Is this a Chime bug?

I asked this quesiton here with no answers, so I thought I'd try again: AWS Chime - assigning videos to tiles does not work as expected

1

There are 1 best solutions below

0
On

So I finally figured this out. If you goto Chime SDK github and you'll notice that in each of the observer examples, they always have:

if (!tileState.boundAttendeeId) {
      return;
}

That is the key. Each usable tile reference should have the boundAttendeeId. Then it will sort out the correct tile reference for use to organize your UI.

I have tested this with attendee's as well.