I'm creating angular client using Chime JS SDK. I'm able to create meeting and add attendees to the meeting. However there is no clear documentation on how to bind video tiles to UI on Angular. I'm trying this on videoTileDidUpdate
event:
const videoContainer = this.renderer.createElement('div');
// Set the id of the div
this.renderer.setProperty(videoContainer, 'id', "video-" + tileState.tileId);
this.renderer.setProperty(videoContainer, 'class', "p-col");
const videoTile = this.renderer.createElement('video');
this.renderer.setProperty(videoTile, 'id', "tile-" + tileState.tileId);
this.renderer.setProperty(videoTile, 'autoplay', "1");
this.renderer.appendChild(videoContainer, videoTile);
this.renderer.appendChild(videoElement.nativeElement, videoContainer);
this.meetingSession.audioVideo.bindVideoElement(tileState.tileId, videoTile);
The event gets triggered infinitely and infinite video elements are created. However there is no video. How to get the video showing on the video tag.
I figured it out on my own. Posting it if someone is looking for it.
Instead of creating dynamic video elements on the fly, we need to use a set of video tags and get reference and bind them.
Template:
Reference it on the code.
And then in tilDidUpdate observer bind it to the element.