Loading...
video.src = URL.createObjectURL(stream);
video.play();video.srcObject = stream;
await video.play();Streams attach through srcObject; passing a MediaStream to createObjectURL() is no longer supported.
<video> element but leaving the camera or microphone running.track.stop() when the stream is no longer needed, so the camera light turns off.srcObject, not by creating object URLs.Call stream.getTracks().forEach((t) => t.stop()). The camera light turns off once every video track is stopped.
Set track.enabled = false on the audio track. The track keeps running but carries silence.
Yes. Pass them to the constructor, as in new MediaStream([videoTrack, audioTrack]).