---
title: "Discussion on \"Accessing Available Devices in Browser via getUserMedia()\" | Hashnode"
description: "Discussion on \"Accessing Available Devices in Browser via getUserMedia()\". The Covid-19 pandemic got me scrambling to come up with some web based solutions to support local Summer art festivals. In April I started digging into WebRTC as a potential in-browser low-barrier-to entry Real Time video solution. After some success..."
url: "https://hashnode.com/posts/accessing-available-devices-in-browser-via-getusermedia/5f6f8ecf0ba48d6624c91a60"
---

[Feed](https://hashnode.com/feed) /

Discussion

# [Accessing Available Devices in Browser via getUserMedia()](https://hashnode.blainegarrett.com/accessing-available-devices-in-browser-via-getusermedia?utm_source=hashnode&utm_medium=feed)

The Covid-19 pandemic got me scrambling to come up with some web based solutions to support local Summer art festivals. In April I started digging into WebRTC as a potential in-browser low-barrier-to entry Real Time video solution. After some success...

Sep 26, 2020 · 7 min read · hashnode.blainegarrett.com  
Read the article

-   [#webrtc](https://hashnode.com/tag/webrtc)
-   [#hardware](https://hashnode.com/tag/hardware)
-   [#html5](https://hashnode.com/tag/html5)
-   [#browsers](https://hashnode.com/tag/browsers)
-   [#typescript](https://hashnode.com/tag/typescript)

## Written by

[Blaine Garrett](https://hashnode.com/@blainegarrrett)

@blainegarrrett · Minneapolis, Minnesota, USA

  
[View profile](https://hashnode.com/@blainegarrrett)

Software Engineer and Artist

I&#39;ll find something good to put here.

## Responses 1

Markdown supported · ⌘↵ to post

[Blaine Garrett](https://hashnode.com/@blainegarrrett)

[Sep 27, 2020](https://hashnode.com/posts/accessing-available-devices-in-browser-via-getusermedia/5f6f8ecf0ba48d6624c91a60/comment/5f70b6db531ea76fd9689cc3)

Update: In the handleSuccess callback I added a few lines stop the stream. It was a little disconcerting navigating to a new page and having the camera light still on.

```
      stream.getTracks().forEach(function (track) {
        track.stop(); // e.g. turn camera off, etc
      });
```

In a future version, I'll store the device stream in a ref and run similar code when unmounting the React component.
