apivideo / api.video-typescript-media-stream-composer

Easily upload videos to api.video using progressive upload from a composition of several media streams
MIT License
40 stars 11 forks source link

[Bug]: Shutting down camera is not possible until destroy and should also work with removeStream #16

Open victorfunes opened 1 year ago

victorfunes commented 1 year ago

Version

0.2.2

Environment that reproduces the issue

Device: intel laptop OS: Windows 11 Chrome 111.0.5563.65 (Build oficial) (64 bits)

Is it reproducible in the example application?

Yes

Reproduction steps

Using your demo app: https://record.a.video/ Add stream > Add screencast + rounded webcam Delete cam stream (using the trash button) The light of the camera continues being on and shouldn't.

I also tried after removing the stream stop the streams manually from outside: getTracks().forEach((track) => track.stop());

But it still keeps the camera open. It is only released when calling destroy() function.

Expected result

In my opinion the stream lifecicle should be managed from outside of the component, so: When a stream is removed from the component it should completely release all the resources, even before the destroy.

Actual result

Currently the camera light continues being turned on until destroy the component

Additional context

No response

Relevant logs output

No response

bhelzer commented 1 year ago

In addition calling destroy fails if stopRecording has been called previously.