# How do I show a placeholder image when as user's camera is off?

**URL:** <https://devforum.zoom.us/t/how-do-i-show-a-placeholder-image-when-as-users-camera-is-off/121186>\
**Category:** Video SDK\
**Created:** [November 20, 2024, 2:02am UTC](https://devforum.zoom.us/t/how-do-i-show-a-placeholder-image-when-as-users-camera-is-off/121186 "2024-11-20T02:02:50Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![edisonfreire14](https://avatars.discourse-cdn.com/v4/letter/e/5e9695/32.png) [@edisonfreire14](https://devforum.zoom.us/u/edisonfreire14)\
**Post date:** [November 20, 2024, 2:02am UTC](https://devforum.zoom.us/t/how-do-i-show-a-placeholder-image-when-as-users-camera-is-off/121186/1 "2024-11-20T02:02:50Z")

</div>

How do I show a placeholder image when as user’s camera is off?  
Extra question: how would I show the user’s name in the bottom corner of there video player.  
I am working in a next js project following the structure in Video SDK next js quickstart github repo.

---

<div class="post-metadata">

**Author:** ![ekaansh.zoom](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/ekaansh.zoom/32/55004_2.png) [@ekaansh.zoom](https://devforum.zoom.us/u/ekaansh.zoom)\
**Post date:** [November 27, 2024, 11:25am UTC](https://devforum.zoom.us/t/how-do-i-show-a-placeholder-image-when-as-users-camera-is-off/121186/3 "2024-11-27T11:25:00Z")

</div>

You’ll have to do something like this:

Store the state of inactive (or all) users:

```diff
const Videocall = (props: { slug: string; JWT: string }) => {
   const session = props.slug;
   const jwt = props.JWT;
   const [inCall, setInCall] = useState(false);
+ const [inativeUsers, setInactiveUsers] = useState<number[]>([]);

```

sync the state with event listeners (I’m using video state change for ease of understanding, but you’ll have to keep a track of user’s joining/leaving also):

```diff
const renderVideo = async (event: {
    action: "Start" | "Stop";
    userId: number;
  }) => {
     const mediaStream = client.current.getMediaStream();
     if (event.action === "Stop") {
+ setInactiveUsers((prev) => [...prev, event.userId]);
       const element = await mediaStream.detachVideo(event.userId);
       Array.isArray(element)
         ? element.forEach((el) => el.remove())
         : element.remove();
     } else {
+ setInactiveUsers((prev) => prev.filter((id) => id !== event.userId));
       const userVideo = await mediaStream.attachVideo(
         event.userId,
         VideoQuality.Video_360P,
...

```

Use the state to render placeholders (I’m just rendering the id):

```diff
       <div className="flex w-full flex-1" style={inCall ? {} : { display: "none" }}>
         {/* @ts-expect-error html component */}
         <video-player-container ref={videoContainerRef} style={videoPlayerStyle} />
+ {inativeUsers.map(userId => <p key={userId}>{userId}</p>)}
       </div>
       {!inCall ? (
         <div className="mx-auto flex w-64 flex-col self-center">

```
