-
Notifications
You must be signed in to change notification settings - Fork 97
-
Hi, I'm not an expert of HTML, I've managed to do what I need, simply change scene onclick event, but every time the click comes a new connection has been made to the port 4444, if I use the disconnection the script doesn't work more, how to solve it?
Instead of open/close the connection on every click I would like to test if the connection is on already? Possibile? Even if the HTML page will change? (on every html page there is
<head>
<script type="text/javascript" src="http://192.168.24.2/OBS-WebSocket.js"></script>
....
and I'm afraid the script will be "rebooted" every time, loosing the chance to know if it still connected or not.
Talking back about disconnect();
<script>
function setCurrentScene(scenename) {
const obs = new OBSWebSocket();
obs.connect({address: '192.168.24.2:4444'
});
obs.on('ConnectionOpened', () => {
obs.send('SetCurrentScene', {
'scene-name': scenename
});
});
//obs.disconnect();
}
</script>
Works but if I uncomment the obs.disconnect(); it won't work never.
Thank you
Beta Was this translation helpful? Give feedback.
All reactions
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment