mirror of
https://github.com/Monadical-SAS/reflector.git
synced 2025-12-21 04:39:06 +00:00
www: make sure screen media stream is closed after we press stop
This commit is contained in:
@@ -232,8 +232,12 @@ export default function Recorder(props: RecorderProps) {
|
|||||||
if (record.isRecording()) {
|
if (record.isRecording()) {
|
||||||
if (props.onStop) props.onStop();
|
if (props.onStop) props.onStop();
|
||||||
record.stopRecording();
|
record.stopRecording();
|
||||||
|
if (screenMediaStream) {
|
||||||
|
screenMediaStream.getTracks().forEach((t) => t.stop());
|
||||||
|
}
|
||||||
setIsRecording(false);
|
setIsRecording(false);
|
||||||
setHasRecorded(true);
|
setHasRecorded(true);
|
||||||
|
setScreenMediaStream(null);
|
||||||
setDestinationStream(null);
|
setDestinationStream(null);
|
||||||
} else {
|
} else {
|
||||||
const stream = await getCurrentStream();
|
const stream = await getCurrentStream();
|
||||||
|
|||||||
Reference in New Issue
Block a user