videoTileDidUpdate()

in demo-website/src/meeting.js [839:861]


    videoTileDidUpdate(tileState) {
        const tileIndex = tileState.localTile
            ? 16
            : this.tileOrganizer.acquireTileIndex(tileState.tileId);
        const tileElement = document.getElementById(`tile-${tileIndex}`);
        const videoElement = document.getElementById(`video-${tileIndex}`);
        const nameplateElement = document.getElementById(`nameplate-${tileIndex}`);
        this.log(`binding video tile ${tileState.tileId} to ${videoElement.id}`);
        this.audioVideo.bindVideoElement(tileState.tileId, videoElement);
        this.tileIndexToTileId[tileIndex] = tileState.tileId;
        this.tileIdToTileIndex[tileState.tileId] = tileIndex;
        // TODO: enforce roster names
        new TimeoutScheduler(2000).start(() => {
            const rosterName = this.roster[tileState.boundAttendeeId]
                ? this.roster[tileState.boundAttendeeId].name
                : '';
            if (nameplateElement.innerHTML !== rosterName) {
                nameplateElement.innerHTML = tileState.localTile ? 'Me' : rosterName;
            }
        });
        tileElement.style.display = 'block';
        this.layoutVideoTiles();
    }