Duncanorak
New Member
Hi I wonder if any clever people out there can help me? I have this html code along with web-sockets.js that should change the scene when I press the button on the website. It connects to websocket but appears to send no information (this is me interpreting what websocket is displaying). I think the commands are correct, the function names seem to be correct as they work in obs-raw.streamer.bot and do indeed select the correct seen.
Many thanks in advance.
Here a screen shots of Websocket and obs-raw.streamer.bot and also the HTML code.
<!DOCTYPE html>
<html lang="en">
<head>
<script type="text/javascript" src="http://127.0.0.1/obs-websocket.js"></script>
<title>WEBSOCKET TEST</title>
</head>
<body>
<a align="center" href="#" onclick="SetCurrentProgramScene('SCENE-NAME-ON-OBS')">Cam1</a>
<script>
function SetCurrentProgramScene(sceneName)
{const obs = new OBSWebSocket();
obs.connect({address: '127.0.0.1:4455'});
obs.on('ConnectionOpened', () => {obs.call('SetCurrentProgramScene', {'sceneName': Cam1 });
});
}
</script>
</body>
</html>
Many thanks in advance.
Here a screen shots of Websocket and obs-raw.streamer.bot and also the HTML code.
<!DOCTYPE html>
<html lang="en">
<head>
<script type="text/javascript" src="http://127.0.0.1/obs-websocket.js"></script>
<title>WEBSOCKET TEST</title>
</head>
<body>
<a align="center" href="#" onclick="SetCurrentProgramScene('SCENE-NAME-ON-OBS')">Cam1</a>
<script>
function SetCurrentProgramScene(sceneName)
{const obs = new OBSWebSocket();
obs.connect({address: '127.0.0.1:4455'});
obs.on('ConnectionOpened', () => {obs.call('SetCurrentProgramScene', {'sceneName': Cam1 });
});
}
</script>
</body>
</html>