obs-websocket-community-projects / obs-websocket-js

Consumes https://github.com/obsproject/obs-websocket
MIT License
657 stars 95 forks source link

Unable to "SetStreamServiceSettings" after stopping the stream #343

Open NithishB06 opened 9 months ago

NithishB06 commented 9 months ago

I am trying to check for stream status first using GetStreamStatus. and based on that stop the stream if it is active.

Immediately I am doing this: await obs.call("SetStreamServiceSettings", streamSettings);

which is causing this error:

OBSWebSocketError: You cannot change stream service settings while streaming.

The issue is that when I stop the stream, it takes 2-3 seconds for OBS to process it and stop the stream but meanwhile I am trying to set stream service settings while the state has not changed, I have tried a lot of things and have not found any success so far.

I have even tried using events like .on and others but with no progress.

Are there any viable approaches to deal with issues like these?