Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

start stop recording webpage #252

Unanswered
mishcazzulani asked this question in Q&A
Discussion options

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

You must be logged in to vote

Replies: 1 comment

Comment options

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.

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
Converted from issue

This discussion was converted from issue #161 on June 12, 2021 15:42.

AltStyle によって変換されたページ (->オリジナル) /