Skip to content

Commit

Permalink
allow stream variables on all streams, including rooms (#24)
Browse files Browse the repository at this point in the history
  • Loading branch information
bryce-seifert authored Jun 30, 2024
1 parent d9e8697 commit 6382910
Show file tree
Hide file tree
Showing 6 changed files with 126 additions and 64 deletions.
8 changes: 4 additions & 4 deletions companion/HELP.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ Control [VDO.Ninja](https://vdo.ninja) settings remotely.

### Getting Started

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

### Available Actions

Expand Down Expand Up @@ -68,4 +68,4 @@ Control [VDO.Ninja](https://vdo.ninja) settings remotely.
- mic (Current mute status, either by stream ID or guest position)
- camera (Current camera status, either by stream ID or guest position)
- speaker (Available for the "Director" role only)
- label (if specified, otherwise just the guest position number)
- label (If specified, otherwise it will be the guest position number)
2 changes: 1 addition & 1 deletion companion/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"name": "vdo-ninja",
"shortname": "VDO.Ninja",
"description": "vdo-ninja",
"version": "2.2.1",
"version": "2.2.2",
"license": "MIT",
"repository": "git+https://github.com/bitfocus/companion-module-vdo-ninja.git",
"bugs": "https://github.com/bitfocus/companion-module-vdo-ninja/issues",
Expand Down
4 changes: 3 additions & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -272,7 +272,9 @@ class VDONinjaInstance extends InstanceBase {
case 'camera':
this.states[data.streamID].videoMuted = data.value
break

case 'details':
this.ws.send(`{"action": "getDetails"}`)
break
default:
this.states[data.streamID][data.action] = data.value
break
Expand Down
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,22 +1,22 @@
{
"name": "vdo-ninja",
"version": "2.2.1",
"version": "2.2.2",
"main": "index.js",
"type": "module",
"scripts": {
"format": "prettier -w ."
},
"license": "MIT",
"dependencies": {
"@companion-module/base": "~1.7.0",
"@companion-module/base": "~1.8.0",
"ws": "^8.17.1"
},
"repository": {
"type": "git",
"url": "git+https://github.com/bitfocus/companion-module-vdo-ninja.git"
},
"devDependencies": {
"@companion-module/tools": "^1.5.0"
"@companion-module/tools": "^1.5.1"
},
"prettier": "@companion-module/tools/.prettierrc.json"
}
17 changes: 9 additions & 8 deletions variables.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@ export function getVariables() {
variables.push({ variableId: `guest_${data.position}_mic`, name: `Guest ${data.position} ${name} - Mic` })
variables.push({ variableId: `guest_${data.position}_camera`, name: `Guest ${data.position} ${name} - Camera` })
variables.push({ variableId: `guest_${data.position}_label`, name: `Guest ${data.position} - Label` })
} else {
variables.push({ variableId: `${data.streamID}_mic`, name: `${data.streamID} ${name} - Mic` })
variables.push({ variableId: `${data.streamID}_camera`, name: `${data.streamID} ${name} - Camera` })
}
variables.push({ variableId: `${data.streamID}_mic`, name: `Stream ID: ${data.streamID} - Mic` })
variables.push({ variableId: `${data.streamID}_camera`, name: `Stream ID: ${data.streamID} - Camera` })
variables.push({ variableId: `${data.streamID}_label`, name: `Stream ID: ${data.streamID} - Label` })
}
}
return variables
Expand All @@ -30,6 +30,7 @@ export function updateVariables() {

if (data.streamID) {
if (data.director) {
label = 'Director'
this.setVariableValues({
director_mic: data.muted ? 'Muted' : 'Unmuted',
director_camera: data.videoMuted ? 'Muted' : 'Unmuted',
Expand All @@ -41,12 +42,12 @@ export function updateVariables() {
[`guest_${data.position}_camera`]: data.videoMuted || data.others?.['hide-guest'] == 1 ? 'Muted' : 'Unmuted',
[`guest_${data.position}_label`]: label,
})
} else {
this.setVariableValues({
[`${data.streamID}_mic`]: data.muted ? 'Muted' : 'Unmuted',
[`${data.streamID}_camera`]: data.videoMuted ? 'Muted' : 'Unmuted',
})
}
this.setVariableValues({
[`${data.streamID}_mic`]: data.muted || data.others?.['mute-guest'] == 1 ? 'Muted' : 'Unmuted',
[`${data.streamID}_camera`]: data.videoMuted || data.others?.['hide-guest'] == 1 ? 'Muted' : 'Unmuted',
[`${data.streamID}_label`]: label,
})
}
}
}
153 changes: 106 additions & 47 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,13 @@
resolved "https://registry.yarnpkg.com/@aashutoshrathi/word-wrap/-/word-wrap-1.2.6.tgz#bd9154aec9983f77b3a034ecaa015c2e4201f6cf"
integrity sha512-1Yjs2SvM8TflER/OD3cOjhWWOZb58A2t7wpE2S9XfBYTiIl+XFhQG2bjy4Pu1I+EAlCNUzRDYDdFwFYUKvXcIA==

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

"@companion-module/tools@^1.5.0":
version "1.5.0"
resolved "https://registry.yarnpkg.com/@companion-module/tools/-/tools-1.5.0.tgz#ce3cc1fc8aa71ebcbb8fcc65ccaad22099bb3c9e"
integrity sha512-J9sY2DE6i7bWYZ1uoPE8Drux53StYVqpVe+xHF0mERvV9QXOvPQ5AqxM12ts/Jd0vzd94jqLEUzm1I/y/KEWtw==
"@companion-module/tools@^1.5.1":
version "1.5.1"
resolved "https://registry.yarnpkg.com/@companion-module/tools/-/tools-1.5.1.tgz#5f5d3e65eee22926e704de3084e3f66de9d841d0"
integrity sha512-9KJC0mZLpg7dlS3MKCYzbUbOjiDMpjjwHgeAxMzh9AOM1ybgsEkmYLfIyZ/EWWSSJ/1s75IJmOtIUWVkZUuqhQ==
dependencies:
"@typescript-eslint/eslint-plugin" "^5.59.9"
"@typescript-eslint/parser" "^5.59.9"
Expand All @@ -38,7 +38,7 @@
find-up "^7.0.0"
parse-author "^2.0.0"
prettier "^2.8.8"
tar "^6.2.0"
tar "^6.2.1"
webpack "^5.90.0"
webpack-cli "^5.1.4"
zx "^7.2.3"
Expand Down Expand Up @@ -183,51 +183,91 @@
"@nodelib/fs.scandir" "2.1.5"
fastq "^1.6.0"

"@sentry-internal/[email protected]":
version "7.102.1"
resolved "https://registry.yarnpkg.com/@sentry-internal/tracing/-/tracing-7.102.1.tgz#5c39c8f04a4a1a665fb6d368e1cd13605152f18b"
integrity sha512-RkFlFyAC0fQOvBbBqnq0CLmFW5m3JJz9pKbZd5vXPraWAlniKSb1bC/4DF9SlNx0FN1LWG+IU3ISdpzwwTeAGg==
"@sentry-internal/[email protected]":
version "7.114.0"
resolved "https://registry.yarnpkg.com/@sentry-internal/tracing/-/tracing-7.114.0.tgz#bdcd364f511e2de45db6e3004faf5685ca2e0f86"
integrity sha512-dOuvfJN7G+3YqLlUY4HIjyWHaRP8vbOgF+OsE5w2l7ZEn1rMAaUbPntAR8AF9GBA6j2zWNoSo8e7GjbJxVofSg==
dependencies:
"@sentry/core" "7.114.0"
"@sentry/types" "7.114.0"
"@sentry/utils" "7.114.0"

"@sentry-internal/[email protected]":
version "7.118.0"
resolved "https://registry.yarnpkg.com/@sentry-internal/tracing/-/tracing-7.118.0.tgz#1a96ea745db818e20c2f8273d317f284a416a90a"
integrity sha512-dERAshKlQLrBscHSarhHyUeGsu652bDTUN1FK0m4e3X48M3I5/s+0N880Qjpe5MprNLcINlaIgdQ9jkisvxjfw==
dependencies:
"@sentry/core" "7.118.0"
"@sentry/types" "7.118.0"
"@sentry/utils" "7.118.0"

"@sentry/[email protected]":
version "7.114.0"
resolved "https://registry.yarnpkg.com/@sentry/core/-/core-7.114.0.tgz#3efe86b92a5379c44dfd0fd4685266b1a30fa898"
integrity sha512-YnanVlmulkjgZiVZ9BfY9k6I082n+C+LbZo52MTvx3FY6RE5iyiPMpaOh67oXEZRWcYQEGm+bKruRxLVP6RlbA==
dependencies:
"@sentry/types" "7.114.0"
"@sentry/utils" "7.114.0"

"@sentry/[email protected]":
version "7.118.0"
resolved "https://registry.yarnpkg.com/@sentry/core/-/core-7.118.0.tgz#1549b49621bc05a8df16c3546793a299b0638559"
integrity sha512-ol0xBdp3/K11IMAYSQE0FMxBOOH9hMsb/rjxXWe0hfM5c72CqYWL3ol7voPci0GELJ5CZG+9ImEU1V9r6gK64g==
dependencies:
"@sentry/core" "7.102.1"
"@sentry/types" "7.102.1"
"@sentry/utils" "7.102.1"
"@sentry/types" "7.118.0"
"@sentry/utils" "7.118.0"

"@sentry/core@7.102.1":
version "7.102.1"
resolved "https://registry.yarnpkg.com/@sentry/core/-/core-7.102.1.tgz#855d37b6bba9986a9380864c823e696d3fc5aa01"
integrity sha512-QjY+LSP3du3J/C8x/FfEbRxgZgsWd0jfTJ4P7s9f219I1csK4OeBMC3UA1HwEa0pY/9OF6H/egW2CjOcMM5Pdg==
"@sentry/integrations@7.118.0":
version "7.118.0"
resolved "https://registry.yarnpkg.com/@sentry/integrations/-/integrations-7.118.0.tgz#f090db621979785c6dc44406da1f72653fa0617c"
integrity sha512-C2rR4NvIMjokF8jP5qzSf1o2zxDx7IeYnr8u15Kb2+HdZtX559owALR0hfgwnfeElqMhGlJBaKUWZ48lXJMzCQ==
dependencies:
"@sentry/types" "7.102.1"
"@sentry/utils" "7.102.1"
"@sentry/core" "7.118.0"
"@sentry/types" "7.118.0"
"@sentry/utils" "7.118.0"
localforage "^1.8.1"

"@sentry/node@^7.82.0":
version "7.102.1"
resolved "https://registry.yarnpkg.com/@sentry/node/-/node-7.102.1.tgz#3e787ab2628c5950916f25c335a4eb6c0ea93ea5"
integrity sha512-mb3vmM3SGuCruckPiv/Vafeh89UQavTfpPFoU6Jwe6dSpQ39BO8fO8k8Zev+/nP6r/FKLtX17mJobErHECXsYw==
"@sentry/node@^7.109.0":
version "7.118.0"
resolved "https://registry.yarnpkg.com/@sentry/node/-/node-7.118.0.tgz#c0b78cabc737eb8a638e82f338fc533455552117"
integrity sha512-79N63DvYKkNPqzmc0cjO+vMZ/nU7+CbE3K3COQNiV7gk58+666G9mRZQJuZVOVebatq5wM5UR0G4LPkwD+J84g==
dependencies:
"@sentry-internal/tracing" "7.102.1"
"@sentry/core" "7.102.1"
"@sentry/types" "7.102.1"
"@sentry/utils" "7.102.1"
"@sentry-internal/tracing" "7.118.0"
"@sentry/core" "7.118.0"
"@sentry/integrations" "7.118.0"
"@sentry/types" "7.118.0"
"@sentry/utils" "7.118.0"

"@sentry/tracing@^7.82.0":
version "7.102.1"
resolved "https://registry.yarnpkg.com/@sentry/tracing/-/tracing-7.102.1.tgz#6594b1b01e0fd1201dca2a12f32919bd9b5d8a4d"
integrity sha512-9VQEox0R7ouhhUVHtBwlGlXG5beDCM/Uo0BY+G0M1H03aFJsLAwnxPNeWnK3WvPejxf94EgdimKMjDjv9l2Sbg==
"@sentry/tracing@^7.109.0":
version "7.114.0"
resolved "https://registry.yarnpkg.com/@sentry/tracing/-/tracing-7.114.0.tgz#32a3438b0f2d02fb7b7359fe7712c5a349a2a329"
integrity sha512-eldEYGADReZ4jWdN5u35yxLUSTOvjsiZAYd4KBEpf+Ii65n7g/kYOKAjNl7tHbrEG1EsMW4nDPWStUMk1w+tfg==
dependencies:
"@sentry-internal/tracing" "7.102.1"
"@sentry-internal/tracing" "7.114.0"

"@sentry/[email protected]":
version "7.114.0"
resolved "https://registry.yarnpkg.com/@sentry/types/-/types-7.114.0.tgz#ab8009d5f6df23b7342121083bed34ee2452e856"
integrity sha512-tsqkkyL3eJtptmPtT0m9W/bPLkU7ILY7nvwpi1hahA5jrM7ppoU0IMaQWAgTD+U3rzFH40IdXNBFb8Gnqcva4w==

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

"@sentry/utils@7.102.1":
version "7.102.1"
resolved "https://registry.yarnpkg.com/@sentry/utils/-/utils-7.102.1.tgz#45ddcdf2e700d40160347bbdf4233aff3179d398"
integrity sha512-+8WcFjHVV/HROXSAwMuUzveElBFC43EiTG7SNEBNgOUeQzQVTmbUZXyTVgLrUmtoWqvnIxCacoLxtZo1o67kdg==
"@sentry/utils@7.114.0":
version "7.114.0"
resolved "https://registry.yarnpkg.com/@sentry/utils/-/utils-7.114.0.tgz#59d30a79f4acff3c9268de0b345f0bcbc6335112"
integrity sha512-319N90McVpupQ6vws4+tfCy/03AdtsU0MurIE4+W5cubHME08HtiEWlfacvAxX+yuKFhvdsO4K4BB/dj54ideg==
dependencies:
"@sentry/types" "7.102.1"
"@sentry/types" "7.114.0"

"@sentry/[email protected]":
version "7.118.0"
resolved "https://registry.yarnpkg.com/@sentry/utils/-/utils-7.118.0.tgz#bfc60826fe3d5d2ae7338ec6ac1f06c20beb179e"
integrity sha512-43qItc/ydxZV1Zb3Kn2M54RwL9XXFa3IAYBO8S82Qvq5YUYmU2AmJ1jgg7DabXlVSWgMA1HntwqnOV3JLaEnTQ==
dependencies:
"@sentry/types" "7.118.0"

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

immediate@~3.0.5:
version "3.0.6"
resolved "https://registry.yarnpkg.com/immediate/-/immediate-3.0.6.tgz#9db1dbd0faf8de6fbe0f5dd5e56bb606280de69b"
integrity sha512-XXOFtyqDjNDAQxVfYxuF7g9Il/IbWmmlQg2MYKOH8ExIT1qg6xc4zyS3HaEEATgs1btfzxq15ciUiY7gjSXRGQ==

import-fresh@^3.2.1:
version "3.3.0"
resolved "https://registry.yarnpkg.com/import-fresh/-/import-fresh-3.3.0.tgz#37162c25fcb9ebaa2e6e53d5b4d88ce17d9e0c2b"
Expand Down Expand Up @@ -1433,11 +1478,25 @@ levn@^0.4.1:
prelude-ls "^1.2.1"
type-check "~0.4.0"

[email protected]:
version "3.1.1"
resolved "https://registry.yarnpkg.com/lie/-/lie-3.1.1.tgz#9a436b2cc7746ca59de7a41fa469b3efb76bd87e"
integrity sha512-RiNhHysUjhrDQntfYSfY4MU24coXXdEOgw9WGcKHNeEwffDYbF//u87M1EWaMGzuFoSbqW0C9C6lEEhDOAswfw==
dependencies:
immediate "~3.0.5"

loader-runner@^4.2.0:
version "4.3.0"
resolved "https://registry.yarnpkg.com/loader-runner/-/loader-runner-4.3.0.tgz#c1b4a163b99f614830353b16755e7149ac2314e1"
integrity sha512-3R/1M+yS3j5ou80Me59j7F9IMs4PXs3VqRrm0TU3AbKPxlmpoY1TNscJV/oGJXo8qCatFGTfDbY6W6ipGOYXfg==

localforage@^1.8.1:
version "1.10.0"
resolved "https://registry.yarnpkg.com/localforage/-/localforage-1.10.0.tgz#5c465dc5f62b2807c3a84c0c6a1b1b3212781dd4"
integrity sha512-14/H1aX7hzBBmmh7sGPd+AOMkkIrHM3Z1PAyGgZigA1H1p5O5ANnMyWzvpAETtG68/dC4pC0ncy3+PPGzXZHPg==
dependencies:
lie "3.1.1"

locate-path@^5.0.0:
version "5.0.0"
resolved "https://registry.yarnpkg.com/locate-path/-/locate-path-5.0.0.tgz#1afba396afd676a6d42504d0a67a3a7eb9f62aa0"
Expand Down Expand Up @@ -1992,7 +2051,7 @@ tapable@^2.1.1, tapable@^2.2.0:
resolved "https://registry.yarnpkg.com/tapable/-/tapable-2.2.1.tgz#1967a73ef4060a82f12ab96af86d52fdb76eeca0"
integrity sha512-GNzQvQTOIP6RyTfE2Qxb8ZVlNmw0n88vp1szwWRimP02mnTsx3Wtn5qRdqY9w2XduFNUgvOwhNnQsjwCp+kqaQ==

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

0 comments on commit 6382910

Please sign in to comment.