Display active speaker in video-player

My goal is to have a video-player element that is always showing the active speaker.

Is it possible to re-use the same element with detachVideo/attachVideo in the same way that video-single.tsx works from the sample app?

I’m struggling to make this happen. I’m wondering if there is a working or tested pattern I can follow.
Thanks!

Got it working.

// Detach current users video from existing element
await mediaStream.detachVideo(parseInt(currentUserId), existingVideoPlayer);

// Attach new users video to THE SAME element
const videoElement = await mediaStream.attachVideo(
  stableActiveSpeakerId,
  VideoQuality.Video_1080P,
  existingVideoPlayer as HTMLElement  // ← Reusing same container
);