MCPcopy Create free account
hub / github.com/Roy3838/Observer / constructor

Method constructor

app/src/utils/streamManager.ts:82–107  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

80
81
82 constructor() {
83 const allStreamTypes: PseudoStreamType[] = ['camera', 'screenVideo', 'screenAudio', 'microphone', 'allAudio'];
84 allStreamTypes.forEach(type => this.userSets.set(type, new Set()));
85
86 // A master stream can die without us asking (user hits "Stop sharing", device
87 // unplugged). Run the normal teardown so our mirrored state, the persistent
88 // video element and the UI all drop the dead stream; the next agent iteration
89 // then fails loudly in the pre-processor instead of capturing a frozen frame.
90 browserStreamCapture.onStreamEnd = (type) => {
91 Logger.warn("StreamManager", `Master '${type}' stream died externally, tearing down.`);
92 switch (type) {
93 case 'display':
94 case 'screenAudio':
95 // Browser screen audio lives on the display stream, so both die together.
96 this.teardownScreenAudioStream();
97 this.teardownDisplayStream();
98 break;
99 case 'camera':
100 this.teardownCameraStream();
101 break;
102 case 'microphone':
103 this.teardownMicrophoneStream();
104 break;
105 }
106 };
107 }
108
109 // --- Public API ---
110

Callers

nothing calls this directly

Calls 5

teardownDisplayStreamMethod · 0.95
teardownCameraStreamMethod · 0.95
warnMethod · 0.80

Tested by

no test coverage detected