# Media devices stay active after call

**URL:** <https://devforum.zoom.us/t/media-devices-stay-active-after-call/119335>\
**Category:** Video SDK\
**Created:** [October 17, 2024, 2:53pm UTC](https://devforum.zoom.us/t/media-devices-stay-active-after-call/119335 "2024-10-17T14:53:15Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![alasdair.yorke](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/alasdair.yorke/32/50483_2.png) [@alasdair.yorke](https://devforum.zoom.us/u/alasdair.yorke)\
**Post date:** [October 17, 2024, 2:53pm UTC](https://devforum.zoom.us/t/media-devices-stay-active-after-call/119335/1 "2024-10-17T14:53:15Z")

</div>

**Video SDK Type and Version**  
Web SDK: 1.11.10

**Description**  
When a call is ended from the connection-change event returning a Closed state the camera/microphone are still shown as in use on the browser after .

**Troubleshooting Routes**  
I’ve made sure to run stopVideo and stopAudio when the call ends and I’ve tried fetching all the active mediaStreams from the navigator and stopping all tracks. There has been no effect.

**How To Reproduce**

1. Join the session as a host
2. Join the session from another device as a guest
3. End the entire session as the host
4. See the call end for the second user
5. See the media devices still marked as active in the browser of the second user

---

<div class="post-metadata">

**Author:** ![ngiesbrecht](https://avatars.discourse-cdn.com/v4/letter/n/57b2e6/32.png) [@ngiesbrecht](https://devforum.zoom.us/u/ngiesbrecht)\
**Post date:** [November 28, 2024, 9:20pm UTC](https://devforum.zoom.us/t/media-devices-stay-active-after-call/119335/2 "2024-11-28T21:20:46Z")

</div>

Did you ever find a solution for this? We are currently running into the same issue.

---

<div class="post-metadata">

**Author:** ![vic.yang](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/vic.yang/32/24656_2.png) [@vic.yang](https://devforum.zoom.us/u/vic.yang)\
**Post date:** [November 29, 2024, 1:00am UTC](https://devforum.zoom.us/t/media-devices-stay-active-after-call/119335/3 "2024-11-29T01:00:47Z")

</div>

Hey @ngiesbrecht @alasdair.yorke

Thanks for your feedback.

> See the media devices still marked as active in the browser of the second user

Could you share more detailed information with us? For example, is it the microphone or the camera device that is still in use?

Thanks  
Vic

---

<div class="post-metadata">

**Author:** ![ngiesbrecht](https://avatars.discourse-cdn.com/v4/letter/n/57b2e6/32.png) [@ngiesbrecht](https://devforum.zoom.us/u/ngiesbrecht)\
**Post date:** [November 29, 2024, 1:56am UTC](https://devforum.zoom.us/t/media-devices-stay-active-after-call/119335/4 "2024-11-29T01:56:33Z")

</div>

**Of note:** I’m running 1.12.12 unlike the original poster.

Both the microphone and camera stay active for the participant when the meeting ends via the host ending with ‘client.leave(true) ‘.

Attempting to catch the session ending in the event listener ‘connection-change’ and calling stopVideo() or stopAudio() fails with the error ‘IMPROPER\_MEETING\_STATE’.

The browser does not release the camera/microphone until a browser refresh is done.

_Edit_  
Some additional information for you @vic.yang.

- I only notice this issue on safari
- I have tried multiple solutions, none worked. The only way I’ve been able to drop the camera/microphone if the host ends the session is via a refresh.
  - _Tried:_ Looping through all the devices manually and manually disabling all of them using mediaquery after the session has ended
  - _Tried:_ Calling .stopVideo() on the participant side on component unmount (prior to the connection-change event firing)
  - _Tried_: calling Client.destroyClient() on component unmount.

---

<div class="post-metadata">

**Author:** ![Guy2](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/guy2/32/69961_2.png) [@Guy2](https://devforum.zoom.us/u/Guy2)\
**Post date:** [June 30, 2025, 8:27am UTC](https://devforum.zoom.us/t/media-devices-stay-active-after-call/119335/5 "2025-06-30T08:27:53Z")

</div>

Having the same issue using either Web Zoom client, or Mac desktop client.

Camera icon on macOS menu bar remains active (lit green) when Zoom sessions are terminated (when clicked, shows Zoom as the app holding the Webcam hostage…). I’m on a Mac mini M4 running the latest version of Sequoia.

Only way to get rid of it is a restart.

Help?!

---

<div class="post-metadata">

**Author:** ![freelancer.nak](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/freelancer.nak/32/40968_2.png) [@freelancer.nak](https://devforum.zoom.us/u/freelancer.nak)\
**Post date:** [July 1, 2025, 11:11am UTC](https://devforum.zoom.us/t/media-devices-stay-active-after-call/119335/6 "2025-07-01T11:11:41Z")

</div>

Hi Alasdair,

Thanks for outlining the issue clearly. This behavior usually occurs when media tracks (camera/microphone) are not explicitly stopped at all necessary exit points in a Zoom Video SDK session.

Even if `stopVideo()` and `stopAudio()` are called, the browser may still show the devices as active unless all underlying media tracks are properly stopped and released.

To fully clean up media devices, I recommend handling it in **three key places** :

* * *

### 1. On `client.leave()`

```auto
await zoomClient.leave();
cleanupMediaTracks();

```

* * *

### 2. On `connection-change` to `Closed`

```auto
zoomClient.on('connection-change', ({ state }) => {
  if (state === 'Closed') {
    cleanupMediaTracks();
  }
});

```

* * *

### 3. On browser unload or tab close

```auto
window.addEventListener('beforeunload', cleanupMediaTracks);
window.addEventListener('pagehide', cleanupMediaTracks);

```

* * *

### Media Cleanup Function

```auto
function cleanupMediaTracks() {
  // Zoom Video SDK media
  mediaStream?.stopAudio?.();
  mediaStream?.stopVideo?.();

  // Raw browser MediaStream (if used)
  if (localMediaStream) {
    localMediaStream.getTracks().forEach(track => track.stop());
  }
}

```

> `mediaStream` refers to the Zoom SDK’s media stream (`client.getMediaStream()`), while `localMediaStream` is any stream from `getUserMedia()` you may be managing manually.

With this setup, media devices should release properly after the session ends or the tab is closed.

Let me know if you need help structuring this into a reusable media handler.

— Naeem Ahmed

---

<div class="post-metadata">

**Author:** ![Collie](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/collie/32/73634_2.png) [@Collie](https://devforum.zoom.us/u/Collie)\
**Post date:** [February 18, 2026, 11:31am UTC](https://devforum.zoom.us/t/media-devices-stay-active-after-call/119335/7 "2026-02-18T11:31:03Z")

</div>

I have noticed that when this happens, my face time is also active. I have had to go into facetime and exit it from the menu. This solves the problem for me.
