-
Notifications
You must be signed in to change notification settings - Fork 7
Expand file tree
/
Copy pathtest-obs.js
More file actions
35 lines (30 loc) · 789 Bytes
/
test-obs.js
File metadata and controls
35 lines (30 loc) · 789 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
const { default: OBSWebSocket } = require('obs-websocket-js');
const print = console.log;
function findall(regex, subject) {
let matches = [];
let match = true;
while (match) {
match = regex.exec(subject);
if (match) {
matches.push(match);
}
}
return matches;
}
print('------ OBS TESTING -----');
async function testOBS() {
const obs = new OBSWebSocket();
try {
await obs.connect('ws://127.0.0.1:4455', '7bZmcvMKmkOPnLZe');
} catch (e) {
console.log(e);
}
// print(obs.getStatus());
// print(await obs.setSceneItemRender('Pro Slide Text', true, 'Live With Lyrics (Text)'));
// print(await obs.setPreviewScene('Live With Lower Third'));
}
async function main() {
// obs.on('connected', () => testOBS());
await testOBS();
}
main();