forked from steveseguin/vdo.ninja
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathstreamdeck.html
More file actions
585 lines (537 loc) · 26.9 KB
/
streamdeck.html
File metadata and controls
585 lines (537 loc) · 26.9 KB
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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>StreamDeck + VDO.Ninja Mixer - Quick Setup Guide</title>
<link href="https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap" rel="stylesheet">
<style>
* {
margin: 0;
padding: 0;
box-sizing: border-box;
}
body {
font-family: 'Inter', sans-serif;
background: #f5f7fa;
color: #333;
line-height: 1.6;
}
.container {
max-width: 900px;
margin: 0 auto;
padding: 40px 20px;
}
header {
text-align: center;
margin-bottom: 60px;
}
h1 {
font-size: 2.5em;
color: #1e2937;
margin-bottom: 10px;
}
h4, h3 {
display: inline;
}
.subtitle {
font-size: 1.2em;
color: #6b7280;
}
.highlight-box {
background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
color: white;
padding: 30px;
border-radius: 12px;
margin-bottom: 40px;
box-shadow: 0 10px 25px rgba(102, 126, 234, 0.15);
}
.step-container {
background: white;
border-radius: 12px;
box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
margin-bottom: 40px;
overflow: hidden;
}
.step-header {
background: #f8fafc;
padding: 20px;
border-bottom: 1px solid #e5e7eb;
}
.step-number {
display: inline-block;
width: 36px;
height: 36px;
background: #667eea;
color: white;
border-radius: 50%;
text-align: center;
line-height: 36px;
font-weight: 600;
margin-right: 12px;
}
.step-content {
padding: 30px;
}
.code-block {
background: #f8fafc;
border: 1px solid #e5e7eb;
border-radius: 8px;
padding: 16px;
margin: 15px 0;
font-family: 'Courier New', monospace;
white-space: pre-wrap;
word-break: break-all;
}
.command-table {
width: 100%;
border-collapse: collapse;
margin: 20px 0;
}
.command-table th,
.command-table td {
padding: 12px;
text-align: left;
border: 1px solid #e5e7eb;
}
.command-table th {
background: #f8fafc;
font-weight: 600;
color: #374151;
}
.command-table tr:nth-child(even) {
background: #f9fafb;
}
.tip-box {
background: #eff6ff;
border: 1px solid #dbeafe;
border-radius: 8px;
padding: 16px;
margin: 20px 0;
}
.tip-icon {
color: #3b82f6;
margin-right: 8px;
}
.warning-box {
background: #fef3c7;
border: 1px solid #fde68a;
border-radius: 8px;
padding: 16px;
margin: 20px 0;
}
.warning-icon {
color: #f59e0b;
margin-right: 8px;
}
.section-title {
font-size: 1.5em;
color: #1e2937;
margin: 40px 0 20px 0;
border-bottom: 2px solid #e5e7eb;
padding-bottom: 10px;
}
.layout-showcase {
display: grid;
grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
gap: 20px;
margin: 30px 0;
}
.layout-card {
background: white;
border: 1px solid #e5e7eb;
border-radius: 8px;
padding: 20px;
text-align: center;
}
.layout-visual {
width: 100%;
height: 120px;
background: #f3f4f6;
border-radius: 6px;
margin-bottom: 15px;
position: relative;
overflow: hidden;
}
.layout-grid {
position: absolute;
top: 10px;
left: 10px;
right: 10px;
bottom: 10px;
display: grid;
gap: 2px;
}
.layout-cell {
background: #667eea;
border-radius: 2px;
}
.layout-label {
font-weight: 600;
color: #374151;
}
.streamdeck-button {
background: #374151;
color: white;
border: none;
padding: 12px 30px;
border-radius: 6px;
font-weight: 500;
cursor: not-allowed; /* Indicates these are examples, not clickable here */
margin: 10px;
display: inline-block;
}
footer {
text-align: center;
margin-top: 60px;
padding-top: 30px;
border-top: 1px solid #e5e7eb;
color: #6b7280;
}
.important {
background: #fecaca;
padding: 4px 8px;
border-radius: 4px;
color: #991b1b;
font-weight: 500;
}
li {
margin-bottom: 10px;
}
ul {
margin-left: 20px;
margin-top: 10px;
}
.site-footer {
background-color: #f0f0f0;
color: #333;
text-align: center;
padding: 20px 0;
font-size: 0.9em;
border-top: 1px solid #ddd;
}
.site-footer a {
color: #007bff;
text-decoration: none;
}
.site-footer a:hover {
text-decoration: underline;
}
</style>
</head>
<body>
<div class="container">
<header>
<h1>StreamDeck + VDO.Ninja Mixer</h1>
<p class="subtitle">Professional control made simple - no MIDI required!</p>
</header>
<div class="highlight-box">
<h2 style="margin-bottom: 15px;">🎥 Welcome to VDO.Ninja Control!</h2>
<p>Tired of limited control in other streaming platforms? VDO.Ninja's API lets you create a professional control setup using your Elgato StreamDeck. Switch between layouts, control cameras, manage guests - all with simple HTTP GET requests!</p>
</div>
<div class="step-container">
<div class="step-header">
<span class="step-number">1</span>
<h3>Generate Your API Key</h3>
</div>
<div class="step-content">
<p>First, choose a unique API key. This key links your StreamDeck commands to your VDO.Ninja mixer session. It should be hard for others to guess.</p>
<div class="code-block">Your API Key: <span class="important">YOUR_UNIQUE_API_KEY</span> (e.g., MySecretMixerKey2025)</div>
<div class="tip-box">
<span class="tip-icon">💡</span>
<strong>Tip:</strong> Make your API key memorable for you but secure. You'll need to use this exact same key in both VDO.Ninja and your StreamDeck button configurations. It can be any combination of letters and numbers that you make up.
</div>
</div>
</div>
<div class="step-container">
<div class="step-header">
<span class="step-number">2</span>
<h3>Open VDO.Ninja Mixer with API Enabled</h3>
</div>
<div class="step-content">
<p>Open your VDO.Ninja Mixer page in your browser, adding your API key as a URL parameter. Replace `YOUR_UNIQUE_API_KEY` with the key you chose in Step 1:</p>
<div class="code-block">https://vdo.ninja/mixer?api=YOUR_UNIQUE_API_KEY</div>
<p>If your mixer URL already has other parameters (e.g., `?room=MyRoom`), add the API key with an ampersand (`&`):</p>
<div class="code-block">https://vdo.ninja/mixer?room=MyRoom&api=YOUR_UNIQUE_API_KEY</div>
<p>This allows the mixer page to listen for commands associated with your API key.</p>
<div class="warning-box">
<span class="warning-icon">⚠️</span>
<strong>Important:</strong> You <span class="important">must</span> add the `?api=YOUR_UNIQUE_API_KEY` (or `&api=YOUR_UNIQUE_API_KEY`) parameter to your VDO.Ninja Mixer URL, otherwise, the StreamDeck commands will not work! The VDO.Ninja page needs to be open and have this API key in its URL to receive commands.
</div>
</div>
</div>
<div class="step-container">
<div class="step-header">
<span class="step-number">3</span>
<h3>Configure StreamDeck Buttons for HTTP Requests</h3>
</div>
<div class="step-content">
<p>On your Stream Deck, you'll create buttons that send HTTP GET requests to the VDO.Ninja API.</p>
<p><strong>The recommended method for simplicity is using the Stream Deck's built-in "Website" action:</strong></p>
<ul>
<li>Open the Stream Deck software on your computer.</li>
<li>From the actions list on the right (usually categorized), find the "System" category.</li>
<li>Drag the "Website" action onto an empty key on your Stream Deck layout.</li>
<li>Configure the "Website" action for the key:
<ul>
<li><strong>Title:</strong> Give your button a descriptive name (e.g., "Layout 0", "Mute Mic").</li>
<li><strong>URL:</strong> This is where you'll put the VDO.Ninja API command URL (see examples below). Make sure to replace `YOUR_UNIQUE_API_KEY` in the URL with the key you chose in Step 1.</li>
<li><strong>Access in background:</strong> <span class="important">Crucially, ensure this checkbox is CHECKED.</span> This makes the Stream Deck send the request without trying to open a web browser window.</li>
</ul>
</li>
</ul>
<div class="tip-box">
<span class="tip-icon">💡</span>
<strong>Alternative (Advanced):</strong> For more complex needs (not typically required for VDO.Ninja's basic API), you could explore Stream Deck plugins specifically designed for API/HTTP requests (e.g., "API Ninja" by BarRaider or "HTTP GET Request"). These offer more options like custom headers or parsing responses, but the "Website" action is sufficient for these commands.
</div>
<p style="margin-top: 20px;"><strong>Understanding the API URL Structure:</strong></p>
<p>The general format for the VDO.Ninja API URLs you'll use is:</p>
<div class="code-block">https://api.vdo.ninja/YOUR_UNIQUE_API_KEY/action/target/value</div>
<ul>
<li><code>YOUR_UNIQUE_API_KEY</code>: The key from Step 1.</li>
<li><code>action</code>: The command to perform (e.g., `layout`, `mic`, `camera`).</li>
<li><code>target</code>: Who or what the action applies to. For self-control in the mixer or for layout changes, this is often `null`. For guest control, it could be a guest slot number (e.g., `1`, `2`).</li>
<li><code>value</code>: The specific setting for the action (e.g., a layout number like `0` or `1`, or `toggle`, `true`, `false`).</li>
</ul>
<p>If a parameter like `target` or `value` is not needed for a specific command, it's often represented by `null` in the URL path. <span class="important">Do not use double slashes (//) if a middle parameter is `null`. Always include `null` as part of the path.</span></p>
<h4 style="margin-top: 30px;">Layout Controls (Defaults)</h4>
<p>Assign these URLs to Stream Deck "Website" actions to switch VDO.Ninja Mixer layouts. Remember to replace `YOUR_UNIQUE_API_KEY`.</p>
<div class="layout-showcase">
<div class="layout-card">
<div class="layout-visual">
<div class="layout-grid" style="grid-template-columns: 1fr; grid-template-rows: 1fr;">
<div class="layout-cell"></div>
</div>
</div>
<div class="layout-label">Auto Mix (Layout 0)</div>
<div class="code-block" style="font-size: 0.9em;">https://api.vdo.ninja/YOUR_UNIQUE_API_KEY/layout/null/0</div>
</div>
<div class="layout-card">
<div class="layout-visual">
<div class="layout-grid" style="grid-template-columns: 1fr; grid-template-rows: 1fr;">
<div class="layout-cell"></div>
</div>
</div>
<div class="layout-label">Layout 1</div>
<div class="code-block" style="font-size: 0.9em;">https://api.vdo.ninja/YOUR_UNIQUE_API_KEY/layout/null/1</div>
</div>
<div class="layout-card">
<div class="layout-visual">
<div class="layout-grid" style="grid-template-columns: repeat(2, 1fr); grid-template-rows: repeat(1, 1fr);">
<div class="layout-cell"></div>
<div class="layout-cell"></div>
</div>
</div>
<div class="layout-label">Layout 5</div>
<div class="code-block" style="font-size: 0.9em;">https://api.vdo.ninja/YOUR_UNIQUE_API_KEY/layout/null/5</div>
</div>
<div class="layout-card">
<div class="layout-visual">
<div class="layout-grid" style="grid-template-columns: repeat(2, 1fr); grid-template-rows: repeat(2, 1fr);">
<div class="layout-cell"></div>
<div class="layout-cell"></div>
<div class="layout-cell"></div>
<div class="layout-cell"></div>
</div>
</div>
<div class="layout-label">Layout 7</div>
<div class="code-block" style="font-size: 0.9em;">https://api.vdo.ninja/YOUR_UNIQUE_API_KEY/layout/null/7</div>
</div>
</div>
<h4 style="margin-top: 40px;">Essential Controls (Self)</h4>
<p>These commands control your own VDO.Ninja instance (the one with the `?api=` parameter). The `target` is `null` as these actions apply to the VDO.Ninja instance itself.</p>
<table class="command-table">
<tr>
<th>Button Label (Suggestion)</th>
<th>URL Command (for StreamDeck "Website" action)</th>
<th>Function</th>
</tr>
<tr>
<td>🎤 Mute/Unmute Mic</td>
<td><code>https://api.vdo.ninja/YOUR_UNIQUE_API_KEY/mic/null/toggle</code></td>
<td>Toggle your microphone on/off</td>
</tr>
<tr>
<td>📹 Mute/Unmute Cam</td>
<td><code>https://api.vdo.ninja/YOUR_UNIQUE_API_KEY/camera/null/toggle</code></td>
<td>Toggle your camera on/off</td>
</tr>
<tr>
<td>🔴 Start Record</td>
<td><code>https://api.vdo.ninja/YOUR_UNIQUE_API_KEY/record/null/true</code></td>
<td>Start recording (local)</td>
</tr>
<tr>
<td>⏹️ Stop Record</td>
<td><code>https://api.vdo.ninja/YOUR_UNIQUE_API_KEY/record/null/false</code></td>
<td>Stop recording (local)</td>
</tr>
<tr>
<td>✋ Toggle Hand</td>
<td><code>https://api.vdo.ninja/YOUR_UNIQUE_API_KEY/togglehand/null/null</code></td>
<td>Raise/lower your hand</td>
</tr>
</table>
<h4 style="margin-top: 40px;">Guest Control (For Directors)</h4>
<p>If you are using the Director role and have guests in slots, you can control them. Replace `SLOT_NUMBER` with the guest's slot (e.g., `1`, `2`, etc.).</p>
<table class="command-table">
<tr>
<th>Button Label (Suggestion)</th>
<th>URL Command (Example for Guest in Slot 1)</th>
<th>Function</th>
</tr>
<tr>
<td>Mute Guest 1</td>
<td><code>https://api.vdo.ninja/YOUR_UNIQUE_API_KEY/mic/1/toggle</code></td>
<td>Toggle Guest 1's microphone</td>
</tr>
<tr>
<td>Cam Off Guest 1</td>
<td><code>https://api.vdo.ninja/YOUR_UNIQUE_API_KEY/camera/1/false</code></td>
<td>Turn Guest 1's camera off</td>
</tr>
<tr>
<td>Add Guest 1 to Scene 0</td>
<td><code>https://api.vdo.ninja/YOUR_UNIQUE_API_KEY/addScene/1/0</code></td>
<td>Toggle Guest 1 in/out of Scene 0 (Auto-Mix/Main Scene)</td>
</tr>
<tr>
<td>Hangup Guest 2</td>
<td><code>https://api.vdo.ninja/YOUR_UNIQUE_API_KEY/hangup/2/null</code></td>
<td>Disconnect guest in slot 2</td>
</tr>
</table>
<div class="warning-box">
<span class="warning-icon">⚠️</span>
<strong>Crucial Reminder:</strong> Always replace `YOUR_UNIQUE_API_KEY` with your actual API key in all URLs you configure on your StreamDeck buttons! And ensure "Access in background" is checked for each "Website" action.
</div>
</div>
</div>
<div class="step-container">
<div class="step-header">
<span class="step-number">4</span>
<h3>Advanced Control Options & Full List</h3>
</div>
<div class="step-content">
<p>VDO.Ninja offers many more API commands. For a comprehensive list, please refer to the official API documentation (often found on the Companion-Ninja GitHub or VDO.Ninja docs).</p>
<p>Here are a few more examples of what's possible:</p>
<h4>Scene Management (Director)</h4>
<table class="command-table">
<tr>
<th>Function</th>
<th>URL Command (replace `YOUR_UNIQUE_API_KEY`, `GUEST_SLOT`, `SCENE_ID`)</th>
</tr>
<tr>
<td>Add Guest in Slot 1 to Scene 0</td>
<td><code>https://api.vdo.ninja/YOUR_UNIQUE_API_KEY/addScene/1/0</code></td>
</tr>
<tr>
<td>Mute Guest in Slot 1 in Scene 0</td>
<td><code>https://api.vdo.ninja/YOUR_UNIQUE_API_KEY/muteScene/1/0</code></td>
</tr>
</table>
<h4>Group Controls (Director - Self)</h4>
<table class="command-table">
<tr>
<th>Function</th>
<th>URL Command (replace `YOUR_UNIQUE_API_KEY`, `GROUP_ID`)</th>
</tr>
<tr>
<td>Join Group 1 (Self)</td>
<td><code>https://api.vdo.ninja/YOUR_UNIQUE_API_KEY/joinGroup/null/1</code></td>
</tr>
<tr>
<td>Leave Group 2 (Self)</td>
<td><code>https://api.vdo.ninja/YOUR_UNIQUE_API_KEY/leaveGroup/null/2</code></td>
</tr>
<tr>
<td>Toggle Self in/out of Group 3</td>
<td><code>https://api.vdo.ninja/YOUR_UNIQUE_API_KEY/group/null/3</code></td>
</tr>
</table>
<h4>Camera Control (PTZ - for compatible cameras, target can be `null` for self or guest slot)</h4>
<table class="command-table">
<tr>
<th>Function (Self Camera)</th>
<th>URL Command (replace `YOUR_UNIQUE_API_KEY`)</th>
</tr>
<tr>
<td>Zoom In (Self)</td>
<td><code>https://api.vdo.ninja/YOUR_UNIQUE_API_KEY/zoom/null/0.1</code></td>
</tr>
<tr>
<td>Zoom Out (Self)</td>
<td><code>https://api.vdo.ninja/YOUR_UNIQUE_API_KEY/zoom/null/-0.1</code></td>
</tr>
<tr>
<td>Pan Left (Self)</td>
<td><code>https://api.vdo.ninja/YOUR_UNIQUE_API_KEY/pan/null/-0.1</code></td>
</tr>
<tr>
<td>Pan Right (Self)</td>
<td><code>https://api.vdo.ninja/YOUR_UNIQUE_API_KEY/pan/null/0.1</code></td>
</tr>
</table>
<div class="tip-box">
<span class="tip-icon">💡</span>
<strong>Targeting Guests for PTZ:</strong> To control a guest's PTZ camera, replace `null` with their guest slot number. For example, to zoom Guest 1's camera in: <code>https://api.vdo.ninja/YOUR_UNIQUE_API_KEY/zoom/1/0.1</code>
</div>
</div>
</div>
<div class="step-container">
<div class="step-header">
<span class="step-number">5</span>
<h3>Quick Start Examples (StreamDeck Button Ideas)</h3>
</div>
<div class="step-content">
<p>Here are some ideas for StreamDeck button layouts. Remember, you need to create each of these using the "Website" action and the corresponding API URLs as detailed in Step 3.</p>
<h4>Basic Control Set (for a Performer/Self-Operator)</h4>
<div style="background: #f3f4f6; padding: 20px; border-radius: 8px; margin: 20px 0;">
<p><i>(These are visual examples of how your StreamDeck might look. Each is a "Website" action.)</i></p>
<div style="display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 10px; margin-top:10px;">
<div class="streamdeck-button">Layout 0<br>(Auto)</div>
<div class="streamdeck-button">Layout 1</div>
<div class="streamdeck-button">Layout 2</div>
<div class="streamdeck-button">Mute Mic</div>
<div class="streamdeck-button">Mute Cam</div>
<div class="streamdeck-button">Start Rec</div>
<div class="streamdeck-button">Stop Rec</div>
<div class="streamdeck-button">Raise Hand</div>
</div>
</div>
<h4>Director Control Set (for managing a show with guests)</h4>
<div style="background: #f3f4f6; padding: 20px; border-radius: 8px; margin: 20px 0;">
<p><i>(These are visual examples of how your StreamDeck might look. Each is a "Website" action.)</i></p>
<div style="display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 10px; margin-top:10px;">
<div class="streamdeck-button">Mute G1 Mic</div>
<div class="streamdeck-button">Mute G2 Mic</div>
<div class="streamdeck-button">G1 to Scene 0</div>
<div class="streamdeck-button">G2 to Scene 0</div>
<div class="streamdeck-button">Hangup G1</div>
<div class="streamdeck-button">Hangup G2</div>
<div class="streamdeck-button">Force Key G1</div>
<div class="streamdeck-button">Highlight G1</div>
</div>
</div>
</div>
</div>
<div class="highlight-box">
<h2 style="margin-bottom: 15px;">🚀 You're All Set!</h2>
<p>With these StreamDeck controls, you now have powerful, tactile command over your VDO.Ninja Mixer sessions. No more frantic clicking through menus during a live production – just press a button for instant control!</p>
<p style="margin-top: 15px;"><strong>Remember:</strong> Always keep your API key secure and never share it publicly. Ensure the VDO.Ninja Mixer page with the `?api=` parameter is open in your browser for the commands to work.</p>
</div>
<footer class="site-footer">
<p>
For detailed API options, functions, and information on the Bitfocus Companion plugin,
please visit the
<a href="https://github.com/steveseguin/Companion-Ninja" target="_blank" rel="noopener noreferrer">Companion-Ninja GitHub repository</a>.
The repository includes a comprehensive markdown list.
</p>
</footer>
<footer>
<p>Created with ❤️ for the VDO.Ninja community</p>
<p>For detailed API commands and support, visit the VDO.Ninja documentation and the <a href="https://github.com/steveseguin/Companion-Ninja" style="color: #667eea;" target="_blank">Companion-Ninja GitHub</a>.</p>
</footer>
</div>
</body>
</html>