removeVideoTracks(stream) removes the stream's video tracks without
stopping the underlying capture — the tracks are detached, not
stopped. Pair it with copyVideoTracks
to swap a device live, or use stopStream
when you actually want to release the hardware. Part of
pota/use/stream.
| Argument | Type | Description |
|---|---|---|
stream |
MediaStream |
Stream to detach all video tracks from. |
Returns: nothing — it mutates stream in place.
Detach every video track from a capture stream while leaving its audio running.
import { removeVideoTracks } from 'pota/use/stream'
const stream = await navigator.mediaDevices.getUserMedia({
audio: true,
video: true,
})
removeVideoTracks(stream)