Skip to content

Commit 6382910

Browse files
allow stream variables on all streams, including rooms (#24)
1 parent d9e8697 commit 6382910

File tree

6 files changed

+126
-64
lines changed

6 files changed

+126
-64
lines changed

companion/HELP.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@ Control [VDO.Ninja](https://vdo.ninja) settings remotely.
44

55
### Getting Started
66

7-
- Ensure you are using VDO.Ninja 23 or above
8-
- Add an API ID as a URL parameter (ex. `&api=xxxxxx`) to your VDO.Ninja URL
9-
- Enter the same API ID in the module settings
7+
- Think of an API ID to use for your production. It should be unique and difficult to guess
8+
- Add your API ID as a URL parameter (ex. `&api=your-unique-api-key`) to your VDO.Ninja URL
9+
- Add the same API ID in the Companion module settings
1010

1111
### Available Actions
1212

@@ -68,4 +68,4 @@ Control [VDO.Ninja](https://vdo.ninja) settings remotely.
6868
- mic (Current mute status, either by stream ID or guest position)
6969
- camera (Current camera status, either by stream ID or guest position)
7070
- speaker (Available for the "Director" role only)
71-
- label (if specified, otherwise just the guest position number)
71+
- label (If specified, otherwise it will be the guest position number)

companion/manifest.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"name": "vdo-ninja",
44
"shortname": "VDO.Ninja",
55
"description": "vdo-ninja",
6-
"version": "2.2.1",
6+
"version": "2.2.2",
77
"license": "MIT",
88
"repository": "git+https://github.com/bitfocus/companion-module-vdo-ninja.git",
99
"bugs": "https://github.com/bitfocus/companion-module-vdo-ninja/issues",

index.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -272,7 +272,9 @@ class VDONinjaInstance extends InstanceBase {
272272
case 'camera':
273273
this.states[data.streamID].videoMuted = data.value
274274
break
275-
275+
case 'details':
276+
this.ws.send(`{"action": "getDetails"}`)
277+
break
276278
default:
277279
this.states[data.streamID][data.action] = data.value
278280
break

package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,22 @@
11
{
22
"name": "vdo-ninja",
3-
"version": "2.2.1",
3+
"version": "2.2.2",
44
"main": "index.js",
55
"type": "module",
66
"scripts": {
77
"format": "prettier -w ."
88
},
99
"license": "MIT",
1010
"dependencies": {
11-
"@companion-module/base": "~1.7.0",
11+
"@companion-module/base": "~1.8.0",
1212
"ws": "^8.17.1"
1313
},
1414
"repository": {
1515
"type": "git",
1616
"url": "git+https://github.com/bitfocus/companion-module-vdo-ninja.git"
1717
},
1818
"devDependencies": {
19-
"@companion-module/tools": "^1.5.0"
19+
"@companion-module/tools": "^1.5.1"
2020
},
2121
"prettier": "@companion-module/tools/.prettierrc.json"
2222
}

variables.js

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,10 @@ export function getVariables() {
1414
variables.push({ variableId: `guest_${data.position}_mic`, name: `Guest ${data.position} ${name} - Mic` })
1515
variables.push({ variableId: `guest_${data.position}_camera`, name: `Guest ${data.position} ${name} - Camera` })
1616
variables.push({ variableId: `guest_${data.position}_label`, name: `Guest ${data.position} - Label` })
17-
} else {
18-
variables.push({ variableId: `${data.streamID}_mic`, name: `${data.streamID} ${name} - Mic` })
19-
variables.push({ variableId: `${data.streamID}_camera`, name: `${data.streamID} ${name} - Camera` })
2017
}
18+
variables.push({ variableId: `${data.streamID}_mic`, name: `Stream ID: ${data.streamID} - Mic` })
19+
variables.push({ variableId: `${data.streamID}_camera`, name: `Stream ID: ${data.streamID} - Camera` })
20+
variables.push({ variableId: `${data.streamID}_label`, name: `Stream ID: ${data.streamID} - Label` })
2121
}
2222
}
2323
return variables
@@ -30,6 +30,7 @@ export function updateVariables() {
3030

3131
if (data.streamID) {
3232
if (data.director) {
33+
label = 'Director'
3334
this.setVariableValues({
3435
director_mic: data.muted ? 'Muted' : 'Unmuted',
3536
director_camera: data.videoMuted ? 'Muted' : 'Unmuted',
@@ -41,12 +42,12 @@ export function updateVariables() {
4142
[`guest_${data.position}_camera`]: data.videoMuted || data.others?.['hide-guest'] == 1 ? 'Muted' : 'Unmuted',
4243
[`guest_${data.position}_label`]: label,
4344
})
44-
} else {
45-
this.setVariableValues({
46-
[`${data.streamID}_mic`]: data.muted ? 'Muted' : 'Unmuted',
47-
[`${data.streamID}_camera`]: data.videoMuted ? 'Muted' : 'Unmuted',
48-
})
4945
}
46+
this.setVariableValues({
47+
[`${data.streamID}_mic`]: data.muted || data.others?.['mute-guest'] == 1 ? 'Muted' : 'Unmuted',
48+
[`${data.streamID}_camera`]: data.videoMuted || data.others?.['hide-guest'] == 1 ? 'Muted' : 'Unmuted',
49+
[`${data.streamID}_label`]: label,
50+
})
5051
}
5152
}
5253
}

yarn.lock

Lines changed: 106 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,13 @@
77
resolved "https://registry.yarnpkg.com/@aashutoshrathi/word-wrap/-/word-wrap-1.2.6.tgz#bd9154aec9983f77b3a034ecaa015c2e4201f6cf"
88
integrity sha512-1Yjs2SvM8TflER/OD3cOjhWWOZb58A2t7wpE2S9XfBYTiIl+XFhQG2bjy4Pu1I+EAlCNUzRDYDdFwFYUKvXcIA==
99

10-
"@companion-module/base@~1.7.0":
11-
version "1.7.0"
12-
resolved "https://registry.yarnpkg.com/@companion-module/base/-/base-1.7.0.tgz#d4bed26890db024b134922bf852d8bc75b449979"
13-
integrity sha512-i9HD0fCMVjBOMyD5z3CK0IjCsfM2EBxeI1RDeVO3RxyQnygUYMkc/WWUiZ7zVZ6WCwNV+Qb93z7L3cdVh8vVFA==
10+
"@companion-module/base@~1.8.0":
11+
version "1.8.0"
12+
resolved "https://registry.yarnpkg.com/@companion-module/base/-/base-1.8.0.tgz#1c74204b29451bd7740b2428db372fdfaf51d84d"
13+
integrity sha512-97qmnaPAJZbisYR6EBQ/fZxY8dPLV3my6qIHJzifFl/vkwi+a3ucoXQWLwd5tijM9pqbZOS/3b2V1m6sbdAWlQ==
1414
dependencies:
15-
"@sentry/node" "^7.82.0"
16-
"@sentry/tracing" "^7.82.0"
15+
"@sentry/node" "^7.109.0"
16+
"@sentry/tracing" "^7.109.0"
1717
ajv "^8.12.0"
1818
colord "^2.9.3"
1919
ejson "^2.2.3"
@@ -24,10 +24,10 @@
2424
p-timeout "^4.1.0"
2525
tslib "^2.6.2"
2626

27-
"@companion-module/tools@^1.5.0":
28-
version "1.5.0"
29-
resolved "https://registry.yarnpkg.com/@companion-module/tools/-/tools-1.5.0.tgz#ce3cc1fc8aa71ebcbb8fcc65ccaad22099bb3c9e"
30-
integrity sha512-J9sY2DE6i7bWYZ1uoPE8Drux53StYVqpVe+xHF0mERvV9QXOvPQ5AqxM12ts/Jd0vzd94jqLEUzm1I/y/KEWtw==
27+
"@companion-module/tools@^1.5.1":
28+
version "1.5.1"
29+
resolved "https://registry.yarnpkg.com/@companion-module/tools/-/tools-1.5.1.tgz#5f5d3e65eee22926e704de3084e3f66de9d841d0"
30+
integrity sha512-9KJC0mZLpg7dlS3MKCYzbUbOjiDMpjjwHgeAxMzh9AOM1ybgsEkmYLfIyZ/EWWSSJ/1s75IJmOtIUWVkZUuqhQ==
3131
dependencies:
3232
"@typescript-eslint/eslint-plugin" "^5.59.9"
3333
"@typescript-eslint/parser" "^5.59.9"
@@ -38,7 +38,7 @@
3838
find-up "^7.0.0"
3939
parse-author "^2.0.0"
4040
prettier "^2.8.8"
41-
tar "^6.2.0"
41+
tar "^6.2.1"
4242
webpack "^5.90.0"
4343
webpack-cli "^5.1.4"
4444
zx "^7.2.3"
@@ -183,51 +183,91 @@
183183
"@nodelib/fs.scandir" "2.1.5"
184184
fastq "^1.6.0"
185185

186-
"@sentry-internal/tracing@7.102.1":
187-
version "7.102.1"
188-
resolved "https://registry.yarnpkg.com/@sentry-internal/tracing/-/tracing-7.102.1.tgz#5c39c8f04a4a1a665fb6d368e1cd13605152f18b"
189-
integrity sha512-RkFlFyAC0fQOvBbBqnq0CLmFW5m3JJz9pKbZd5vXPraWAlniKSb1bC/4DF9SlNx0FN1LWG+IU3ISdpzwwTeAGg==
186+
"@sentry-internal/tracing@7.114.0":
187+
version "7.114.0"
188+
resolved "https://registry.yarnpkg.com/@sentry-internal/tracing/-/tracing-7.114.0.tgz#bdcd364f511e2de45db6e3004faf5685ca2e0f86"
189+
integrity sha512-dOuvfJN7G+3YqLlUY4HIjyWHaRP8vbOgF+OsE5w2l7ZEn1rMAaUbPntAR8AF9GBA6j2zWNoSo8e7GjbJxVofSg==
190+
dependencies:
191+
"@sentry/core" "7.114.0"
192+
"@sentry/types" "7.114.0"
193+
"@sentry/utils" "7.114.0"
194+
195+
"@sentry-internal/tracing@7.118.0":
196+
version "7.118.0"
197+
resolved "https://registry.yarnpkg.com/@sentry-internal/tracing/-/tracing-7.118.0.tgz#1a96ea745db818e20c2f8273d317f284a416a90a"
198+
integrity sha512-dERAshKlQLrBscHSarhHyUeGsu652bDTUN1FK0m4e3X48M3I5/s+0N880Qjpe5MprNLcINlaIgdQ9jkisvxjfw==
199+
dependencies:
200+
"@sentry/core" "7.118.0"
201+
"@sentry/types" "7.118.0"
202+
"@sentry/utils" "7.118.0"
203+
204+
"@sentry/core@7.114.0":
205+
version "7.114.0"
206+
resolved "https://registry.yarnpkg.com/@sentry/core/-/core-7.114.0.tgz#3efe86b92a5379c44dfd0fd4685266b1a30fa898"
207+
integrity sha512-YnanVlmulkjgZiVZ9BfY9k6I082n+C+LbZo52MTvx3FY6RE5iyiPMpaOh67oXEZRWcYQEGm+bKruRxLVP6RlbA==
208+
dependencies:
209+
"@sentry/types" "7.114.0"
210+
"@sentry/utils" "7.114.0"
211+
212+
"@sentry/core@7.118.0":
213+
version "7.118.0"
214+
resolved "https://registry.yarnpkg.com/@sentry/core/-/core-7.118.0.tgz#1549b49621bc05a8df16c3546793a299b0638559"
215+
integrity sha512-ol0xBdp3/K11IMAYSQE0FMxBOOH9hMsb/rjxXWe0hfM5c72CqYWL3ol7voPci0GELJ5CZG+9ImEU1V9r6gK64g==
190216
dependencies:
191-
"@sentry/core" "7.102.1"
192-
"@sentry/types" "7.102.1"
193-
"@sentry/utils" "7.102.1"
217+
"@sentry/types" "7.118.0"
218+
"@sentry/utils" "7.118.0"
194219

195-
"@sentry/core@7.102.1":
196-
version "7.102.1"
197-
resolved "https://registry.yarnpkg.com/@sentry/core/-/core-7.102.1.tgz#855d37b6bba9986a9380864c823e696d3fc5aa01"
198-
integrity sha512-QjY+LSP3du3J/C8x/FfEbRxgZgsWd0jfTJ4P7s9f219I1csK4OeBMC3UA1HwEa0pY/9OF6H/egW2CjOcMM5Pdg==
220+
"@sentry/integrations@7.118.0":
221+
version "7.118.0"
222+
resolved "https://registry.yarnpkg.com/@sentry/integrations/-/integrations-7.118.0.tgz#f090db621979785c6dc44406da1f72653fa0617c"
223+
integrity sha512-C2rR4NvIMjokF8jP5qzSf1o2zxDx7IeYnr8u15Kb2+HdZtX559owALR0hfgwnfeElqMhGlJBaKUWZ48lXJMzCQ==
199224
dependencies:
200-
"@sentry/types" "7.102.1"
201-
"@sentry/utils" "7.102.1"
225+
"@sentry/core" "7.118.0"
226+
"@sentry/types" "7.118.0"
227+
"@sentry/utils" "7.118.0"
228+
localforage "^1.8.1"
202229

203-
"@sentry/node@^7.82.0":
204-
version "7.102.1"
205-
resolved "https://registry.yarnpkg.com/@sentry/node/-/node-7.102.1.tgz#3e787ab2628c5950916f25c335a4eb6c0ea93ea5"
206-
integrity sha512-mb3vmM3SGuCruckPiv/Vafeh89UQavTfpPFoU6Jwe6dSpQ39BO8fO8k8Zev+/nP6r/FKLtX17mJobErHECXsYw==
230+
"@sentry/node@^7.109.0":
231+
version "7.118.0"
232+
resolved "https://registry.yarnpkg.com/@sentry/node/-/node-7.118.0.tgz#c0b78cabc737eb8a638e82f338fc533455552117"
233+
integrity sha512-79N63DvYKkNPqzmc0cjO+vMZ/nU7+CbE3K3COQNiV7gk58+666G9mRZQJuZVOVebatq5wM5UR0G4LPkwD+J84g==
207234
dependencies:
208-
"@sentry-internal/tracing" "7.102.1"
209-
"@sentry/core" "7.102.1"
210-
"@sentry/types" "7.102.1"
211-
"@sentry/utils" "7.102.1"
235+
"@sentry-internal/tracing" "7.118.0"
236+
"@sentry/core" "7.118.0"
237+
"@sentry/integrations" "7.118.0"
238+
"@sentry/types" "7.118.0"
239+
"@sentry/utils" "7.118.0"
212240

213-
"@sentry/tracing@^7.82.0":
214-
version "7.102.1"
215-
resolved "https://registry.yarnpkg.com/@sentry/tracing/-/tracing-7.102.1.tgz#6594b1b01e0fd1201dca2a12f32919bd9b5d8a4d"
216-
integrity sha512-9VQEox0R7ouhhUVHtBwlGlXG5beDCM/Uo0BY+G0M1H03aFJsLAwnxPNeWnK3WvPejxf94EgdimKMjDjv9l2Sbg==
241+
"@sentry/tracing@^7.109.0":
242+
version "7.114.0"
243+
resolved "https://registry.yarnpkg.com/@sentry/tracing/-/tracing-7.114.0.tgz#32a3438b0f2d02fb7b7359fe7712c5a349a2a329"
244+
integrity sha512-eldEYGADReZ4jWdN5u35yxLUSTOvjsiZAYd4KBEpf+Ii65n7g/kYOKAjNl7tHbrEG1EsMW4nDPWStUMk1w+tfg==
217245
dependencies:
218-
"@sentry-internal/tracing" "7.102.1"
246+
"@sentry-internal/tracing" "7.114.0"
247+
248+
"@sentry/types@7.114.0":
249+
version "7.114.0"
250+
resolved "https://registry.yarnpkg.com/@sentry/types/-/types-7.114.0.tgz#ab8009d5f6df23b7342121083bed34ee2452e856"
251+
integrity sha512-tsqkkyL3eJtptmPtT0m9W/bPLkU7ILY7nvwpi1hahA5jrM7ppoU0IMaQWAgTD+U3rzFH40IdXNBFb8Gnqcva4w==
219252

220-
"@sentry/types@7.102.1":
221-
version "7.102.1"
222-
resolved "https://registry.yarnpkg.com/@sentry/types/-/types-7.102.1.tgz#18c35f32ecbd12afb9860ca2de7bfff542d10b27"
223-
integrity sha512-htKorf3t/D0XYtM7foTcmG+rM47rDP6XdbvCcX5gBCuCYlzpM1vqCt2rl3FLktZC6TaIpFRJw1TLfx6m+x5jdA==
253+
"@sentry/types@7.118.0":
254+
version "7.118.0"
255+
resolved "https://registry.yarnpkg.com/@sentry/types/-/types-7.118.0.tgz#ca3ab06912f60bc2a7ccf2d2e5ccf43985851aef"
256+
integrity sha512-2drqrD2+6kgeg+W/ycmiti3G4lJrV3hGjY9PpJ3bJeXrh6T2+LxKPzlgSEnKFaeQWkXdZ4eaUbtTXVebMjb5JA==
224257

225-
"@sentry/utils@7.102.1":
226-
version "7.102.1"
227-
resolved "https://registry.yarnpkg.com/@sentry/utils/-/utils-7.102.1.tgz#45ddcdf2e700d40160347bbdf4233aff3179d398"
228-
integrity sha512-+8WcFjHVV/HROXSAwMuUzveElBFC43EiTG7SNEBNgOUeQzQVTmbUZXyTVgLrUmtoWqvnIxCacoLxtZo1o67kdg==
258+
"@sentry/utils@7.114.0":
259+
version "7.114.0"
260+
resolved "https://registry.yarnpkg.com/@sentry/utils/-/utils-7.114.0.tgz#59d30a79f4acff3c9268de0b345f0bcbc6335112"
261+
integrity sha512-319N90McVpupQ6vws4+tfCy/03AdtsU0MurIE4+W5cubHME08HtiEWlfacvAxX+yuKFhvdsO4K4BB/dj54ideg==
229262
dependencies:
230-
"@sentry/types" "7.102.1"
263+
"@sentry/types" "7.114.0"
264+
265+
"@sentry/utils@7.118.0":
266+
version "7.118.0"
267+
resolved "https://registry.yarnpkg.com/@sentry/utils/-/utils-7.118.0.tgz#bfc60826fe3d5d2ae7338ec6ac1f06c20beb179e"
268+
integrity sha512-43qItc/ydxZV1Zb3Kn2M54RwL9XXFa3IAYBO8S82Qvq5YUYmU2AmJ1jgg7DabXlVSWgMA1HntwqnOV3JLaEnTQ==
269+
dependencies:
270+
"@sentry/types" "7.118.0"
231271

232272
"@types/eslint-scope@^3.7.3":
233273
version "3.7.4"
@@ -1276,6 +1316,11 @@ ignore@^5.2.4:
12761316
resolved "https://registry.yarnpkg.com/ignore/-/ignore-5.2.4.tgz#a291c0c6178ff1b960befe47fcdec301674a6324"
12771317
integrity sha512-MAb38BcSbH0eHNBxn7ql2NH/kX33OkB3lZ1BNdh7ENeRChHTYsTvWrMubiIAMNS2llXEEgZ1MUOBtXChP3kaFQ==
12781318

1319+
immediate@~3.0.5:
1320+
version "3.0.6"
1321+
resolved "https://registry.yarnpkg.com/immediate/-/immediate-3.0.6.tgz#9db1dbd0faf8de6fbe0f5dd5e56bb606280de69b"
1322+
integrity sha512-XXOFtyqDjNDAQxVfYxuF7g9Il/IbWmmlQg2MYKOH8ExIT1qg6xc4zyS3HaEEATgs1btfzxq15ciUiY7gjSXRGQ==
1323+
12791324
import-fresh@^3.2.1:
12801325
version "3.3.0"
12811326
resolved "https://registry.yarnpkg.com/import-fresh/-/import-fresh-3.3.0.tgz#37162c25fcb9ebaa2e6e53d5b4d88ce17d9e0c2b"
@@ -1433,11 +1478,25 @@ levn@^0.4.1:
14331478
prelude-ls "^1.2.1"
14341479
type-check "~0.4.0"
14351480

1481+
lie@3.1.1:
1482+
version "3.1.1"
1483+
resolved "https://registry.yarnpkg.com/lie/-/lie-3.1.1.tgz#9a436b2cc7746ca59de7a41fa469b3efb76bd87e"
1484+
integrity sha512-RiNhHysUjhrDQntfYSfY4MU24coXXdEOgw9WGcKHNeEwffDYbF//u87M1EWaMGzuFoSbqW0C9C6lEEhDOAswfw==
1485+
dependencies:
1486+
immediate "~3.0.5"
1487+
14361488
loader-runner@^4.2.0:
14371489
version "4.3.0"
14381490
resolved "https://registry.yarnpkg.com/loader-runner/-/loader-runner-4.3.0.tgz#c1b4a163b99f614830353b16755e7149ac2314e1"
14391491
integrity sha512-3R/1M+yS3j5ou80Me59j7F9IMs4PXs3VqRrm0TU3AbKPxlmpoY1TNscJV/oGJXo8qCatFGTfDbY6W6ipGOYXfg==
14401492

1493+
localforage@^1.8.1:
1494+
version "1.10.0"
1495+
resolved "https://registry.yarnpkg.com/localforage/-/localforage-1.10.0.tgz#5c465dc5f62b2807c3a84c0c6a1b1b3212781dd4"
1496+
integrity sha512-14/H1aX7hzBBmmh7sGPd+AOMkkIrHM3Z1PAyGgZigA1H1p5O5ANnMyWzvpAETtG68/dC4pC0ncy3+PPGzXZHPg==
1497+
dependencies:
1498+
lie "3.1.1"
1499+
14411500
locate-path@^5.0.0:
14421501
version "5.0.0"
14431502
resolved "https://registry.yarnpkg.com/locate-path/-/locate-path-5.0.0.tgz#1afba396afd676a6d42504d0a67a3a7eb9f62aa0"
@@ -1992,7 +2051,7 @@ tapable@^2.1.1, tapable@^2.2.0:
19922051
resolved "https://registry.yarnpkg.com/tapable/-/tapable-2.2.1.tgz#1967a73ef4060a82f12ab96af86d52fdb76eeca0"
19932052
integrity sha512-GNzQvQTOIP6RyTfE2Qxb8ZVlNmw0n88vp1szwWRimP02mnTsx3Wtn5qRdqY9w2XduFNUgvOwhNnQsjwCp+kqaQ==
19942053

1995-
tar@^6.2.0:
2054+
tar@^6.2.1:
19962055
version "6.2.1"
19972056
resolved "https://registry.yarnpkg.com/tar/-/tar-6.2.1.tgz#717549c541bc3c2af15751bea94b1dd068d4b03a"
19982057
integrity sha512-DZ4yORTwrbTj/7MZYq2w+/ZFdI6OZ/f9SFHR+71gIVUZhOQPHzVCLpvRnPgyaMpfWxxk/4ONva3GQSyNIKRv6A==

0 commit comments

Comments
 (0)