refactor: stop venmic on stream stop (#353)
This commit is contained in:
parent
cb33f1834b
commit
4d82a6f41d
1 changed files with 8 additions and 5 deletions
|
@ -83,11 +83,14 @@ addPatch({
|
||||||
|
|
||||||
if (isLinux) {
|
if (isLinux) {
|
||||||
onceReady.then(() => {
|
onceReady.then(() => {
|
||||||
FluxDispatcher.subscribe("VOICE_STATE_UPDATES", e => {
|
FluxDispatcher.subscribe("STREAM_CLOSE", ({ streamKey }: { streamKey: string }) => {
|
||||||
for (const state of e.voiceStates) {
|
const owner = streamKey.split(":").at(-1);
|
||||||
if (state.userId === UserStore.getCurrentUser().id && state.oldChannelId && !state.channelId)
|
|
||||||
VesktopNative.virtmic.stop();
|
if (owner !== UserStore.getCurrentUser().id) {
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
VesktopNative.virtmic.stop();
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@ -252,7 +255,7 @@ function AudioSourcePickerLinux({
|
||||||
{!sources.ok &&
|
{!sources.ok &&
|
||||||
(sources.isGlibcxxToOld ? (
|
(sources.isGlibcxxToOld ? (
|
||||||
<Forms.FormText>
|
<Forms.FormText>
|
||||||
Failed to retrieve Audio Sources because your c++ library is too old to run venmic. If you would
|
Failed to retrieve Audio Sources because your C++ library is too old to run venmic. If you would
|
||||||
like to stream with Audio, see{" "}
|
like to stream with Audio, see{" "}
|
||||||
<a href="https://gist.github.com/Vendicated/b655044ffbb16b2716095a448c6d827a" target="_blank">
|
<a href="https://gist.github.com/Vendicated/b655044ffbb16b2716095a448c6d827a" target="_blank">
|
||||||
this guide
|
this guide
|
||||||
|
|
Loading…
Reference in a new issue