-
Couldn't load subscription status.
- Fork 98
start stop recording webpage #252
Unanswered
mishcazzulani
asked this question in
Q&A
-
hello i'm trying to build a simple webpage that when opened connects to obs-websocket and starts recording
i'm using obs 23.1.0 obs-websocket 4.6.1 and obs-websocket-js 3.1.0
here is my code:
<!DOCTYPE` html>
<html>
<head>
<script type="text/javascript" src="obs-websocket.js"></script>
</head>
<body>
<script>
const obs = new OBSWebSocket();
obs.connect({ address: '10.0.0.70:4444' });
obs.StartRecording();
</script>
</body>
</html>
it connects but doesn't start recording
Beta Was this translation helpful? Give feedback.
All reactions
Replies: 1 comment
-
obs.connect() returns a promise, as it does not happen straight away, so you need to chain a .then() on the end to know when it has connected. Changing your code to
obs.connect({ address: '10.0.0.70:4444' }).then(() => obs.StartRecording()) should make it start recording.
Beta Was this translation helpful? Give feedback.
All reactions
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment