-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
264 lines (251 loc) · 16.2 KB
/
index.html
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
<!DOCTYPE html>
<html lang="en">
<head>
<title>KVS Multi-Viewer</title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css">
<link rel="stylesheet" href="loader.css">
<link rel="stylesheet" href="./app.css">
<script src="https://code.jquery.com/jquery-3.3.1.slim.min.js"></script>
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/js/bootstrap.bundle.min.js"></script>
<script src="aws-sdk-2.1363.0.min.js"></script>
<script src="https://unpkg.com/@ungap/url-search-params"></script>
<script src="https://webrtc.github.io/adapter/adapter-latest.js"></script>
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/chart.umd.min.js"></script>
<link rel="icon" type="image/png" href="favicon.ico">
</head>
<body>
<div class="container mt-3">
<div class="row loader"></div>
<div id="main" class="d-none">
<form id="form" onsubmit="return false">
<div class="form-group has-validation" style="position: relative;">
<label for="region">Region</label>
<input type="text" class="form-control valid" id="region" placeholder="Region" value="us-east-2" autocomplete="off" required>
<datalist id="regionList"></datalist>
<div id="region-invalid-feedback" class="invalid-feedback"></div>
</div>
<div class="form-group">
<label for="accessKeyId">Access Key ID</label>
<input type="text" class="form-control" id="accessKeyId" placeholder="Access key id" required>
</div>
<div class="form-group">
<label for="secretAccessKey">Secret Access Key</label>
<input type="password" class="form-control" id="secretAccessKey" placeholder="Secret access key" required>
</div>
<div class="form-group">
<label for="channelPattern">Channel Pattern (X: [1,2] / Y: [1-4])</label>
<input type="text" class="form-control" id="channelPattern" placeholder="example-channel-X-Y" required>
</div>
<div class="form-group">
<label for="extraChannels">Extra channels to open (separate with ';')</label>
<input type="text" class="form-control" id="extraChannels" placeholder="example-channel1;example-channel2">
</div>
<div class="form-group">
<div class="form-check form-check-inline">
<input class="form-check-input" type="checkbox" id="openDataChannel" value="datachannel" checked>
<label for="openDataChannel" class="form-check-label">Open DataChannel</label>
<span data-delay="{ "hide": 1500 }" data-position="auto" tabindex="0" class="text-info ml-1" data-toggle="tooltip" data-html="true" title="
<p>Open a channel which can be used for bidirectional peer-to-peer transfers of data, hence the name.</p>
<a href="https://www.w3.org/TR/webrtc/#rtcdatachannel">Additional information</a>
"><sup>ⓘ</sup></span>
</div>
</div>
<details><summary class="h4">RES/NAT/ICE</summary>
<p><small>Set the desired video resolution and aspect ratio.</small></p>
<div class="form-group">
<div class="form-check form-check">
<input class="form-check-input" type="radio" name="resolution" id="widescreen" value="option1" checked>
<label class="form-check-label" for="widescreen">1280x720 <small>(16:9 widescreen)</small></label>
</div>
<div class="form-check form-check">
<input class="form-check-input" type="radio" name="resolution" id="fullscreen" value="option2">
<label class="form-check-label" for="fullscreen">640x480 <small>(4:3 fullscreen)</small></label>
</div>
</div>
<h4>NAT Traversal</h4>
<p><small>Control settings for ICE candidate generation.</small>
<span data-delay="{ "hide": 1500 }" data-position="auto" tabindex="0" class="text-info" data-toggle="tooltip" data-html="true" title="
<p>Determines the types of <code>ICE candidates</code> that are generated.<br/><br/>STUN/TURN = host, server reflexive, and relay<br/>STUN only = server reflexive<br/>TURN only = relay<br/>Disabled = host</p>
<a href="https://docs.aws.amazon.com/kinesisvideostreams-webrtc-dg/latest/devguide/kvswebrtc-how-it-works.html#how-kvswebrtc-works">Additional information</a>
"><sup>ⓘ</sup></span></p>
<div class="form-group">
<div class="form-check form-check">
<input class="form-check-input" type="radio" name="natTraversal" id="natTraversalEnabled" value="option2" checked>
<label class="form-check-label" for="natTraversalEnabled">STUN/TURN</label>
</div>
<div class="form-check form-check">
<input class="form-check-input" type="radio" name="natTraversal" id="forceTURN" value="option3">
<label class="form-check-label" for="forceTURN">TURN Only <small>(force cloud relay)</small></label>
</div>
<div class="form-check form-check">
<input class="form-check-input" type="radio" name="natTraversal" id="forceSTUN" value="option4">
<label class="form-check-label" for="forceSTUN">STUN Only</label>
</div>
<div class="form-check form-check">
<input class="form-check-input" type="radio" name="natTraversal" id="natTraversalDisabled" value="option1">
<label class="form-check-label" for="natTraversalDisabled">Disabled</label>
</div>
</div>
<div class="form-group">
<div class="form-check form-check-inline">
<input class="form-check-input" type="checkbox" id="useTrickleICE" value="useTrickleICE" checked>
<label for="useTrickleICE" class="form-check-label">Use trickle ICE</label>
<span data-delay="{ "hide": 1500 }" data-position="auto" tabindex="0" class="text-info ml-1" data-toggle="tooltip" data-html="true" title="
<p>ICE candidates are exchanged incrementally as soon as they become available (and simultaneously with the gathering of other candidates). Supported by browsers, but not by Alexa devices.</p>
<a href="https://datatracker.ietf.org/doc/html/rfc8829#sec.ice-candidate-trickling">Additional information</a>
"><sup>ⓘ</sup></span>
</div>
</div>
<h4 class="d-none">Amazon KVS WebRTC DQP</h4>
<div class="form-group d-none">
<div class="form-check form-check-inline">
<input class="form-check-input" type="checkbox" id="enableDQPmetrics" value="enableDQPmetrics">
<label for="enableDQPmetrics" class="form-check-label">Enable KVS WebRTC DQP Test and Metrics <small>(Viewer only)</small></label>
<span data-delay="{ "hide": 1500 }" data-position="auto" tabindex="0" class="text-info ml-1" data-toggle="tooltip" data-html="true" title="
<p>Enables the test and metrics for the Amazon KVS WebRTC Device Qualification Program.</p>
<a href="https://aws.amazon.com/partners/programs/dqp/">Additional information</a>
"><sup>ⓘ</sup></span>
</div>
</div>
</details>
<details class="d-none"><summary class="h4">Advanced</summary>
<p><small>Filter settings for which ICE candidates and sent to and received from the peer.</small></p>
<div class="container">
<div class="row">
<div class="col-sm">
<div class="form-check form-check">
<input class="form-check-input" type="checkbox" id="send-relay" checked>
<label for="send-relay" class="form-check-label">Send <code>relay</code> candidates to peer</label>
</div>
<div class="form-check form-check">
<input class="form-check-input" type="checkbox" id="accept-relay" checked>
<label for="accept-relay" class="form-check-label">Accept <code>relay</code> candidates from peer</label>
</div>
<div class="form-check form-check">
<input class="form-check-input" type="checkbox" id="send-srflx" checked>
<label for="send-srflx" class="form-check-label">Send <code>srflx</code> candidates to peer</label>
</div>
<div class="form-check form-check">
<input class="form-check-input" type="checkbox" id="accept-srflx" checked>
<label for="accept-srflx" class="form-check-label">Accept <code>srflx</code> candidates from peer</label>
</div>
<div class="form-check form-check">
<input class="form-check-input" type="checkbox" id="send-host" checked>
<label for="send-host" class="form-check-label">Send <code>host</code> candidates to peer</label>
</div>
<div class="form-check form-check">
<input class="form-check-input" type="checkbox" id="accept-host" checked>
<label for="accept-host" class="form-check-label">Accept <code>host</code> candidates from peer</label>
</div>
</div>
<div class="col-sm">
<div class="form-check form-check">
<input class="form-check-input" type="checkbox" id="send-prflx" checked>
<label for="send-prflx" class="form-check-label">Send <code>prflx</code> candidates to peer</label>
</div>
<div class="form-check form-check">
<input class="form-check-input" type="checkbox" id="accept-prflx" checked>
<label for="accept-prflx" class="form-check-label">Accept <code>prflx</code> candidates from peer</label>
</div>
<div class="form-check form-check">
<input class="form-check-input" type="checkbox" id="send-tcp" checked>
<label for="send-tcp" class="form-check-label">Send <code>tcp</code> candidates to peer</label>
</div>
<div class="form-check form-check">
<input class="form-check-input" type="checkbox" id="accept-tcp" checked>
<label for="accept-tcp" class="form-check-label">Accept <code>tcp</code> candidates from peer</label>
</div>
<div class="form-check form-check">
<input class="form-check-input" type="checkbox" id="send-udp" checked>
<label for="send-udp" class="form-check-label">Send <code>udp</code> candidates to peer</label>
</div>
<div class="form-check form-check">
<input class="form-check-input" type="checkbox" id="accept-udp" checked>
<label for="accept-udp" class="form-check-label">Accept <code>udp</code> candidates from peer</label>
</div>
</div>
</div>
</div>
</details>
<hr>
<div>
<button id="viewer-button" type="submit" class="btn btn-primary">Start Viewers</button>
</div>
</form>
<div id="viewer" class="d-none">
<div class="row">
<div class="col">
<div class="video-container"><video class="remote-view" autoplay playsinline controls></video></div>
</div>
</div>
<div class="row datachannel">
<div class="col">
<div class="form-group">
<textarea type="text" class="form-control local-message" placeholder="DataChannel message to send to MASTER"></textarea>
</div>
</div>
<div class="col">
<div class="card bg-light mb-3">
<pre class="remote-message card-body text-monospace preserve-whitespace"></pre>
</div>
</div>
</div>
<div>
<span class="send-message datachannel">
<button type="button" class="btn btn-primary send-message-button">Send DataChannel Message</button>
</span>
</div>
</div>
<div id="viewers" class="row"></div>
<button id="stop-viewer-button" type="button" class="btn btn-danger d-none">Stop Viewers</button>
<div id="dqpmetrics" class="d-none">
<h3 id="dqpmetrics-header">DQP Test Metrics (from Master)</h3>
<div class="row">
<div class="col">
<div class="card bg-light mb-3">
<div id="dqp-test"></div>
</div>
</div>
<div class="col">
<div class="card bg-light mb-3">
<canvas id="metricsChart" style="width:100%"; height="400px"></canvas>
</div>
</div>
</div>
<h3 id="live-stats-header">Live Stats (from Master)</h3>
<div class="card bg-light mb-3">
<div id="webrtc-live-stats"></div>
</div>
</div>
<h3 id="logs-header">Logs</h3>
<div class="card bg-light mb-3">
<div style="display: flex; justify-content: space-between;">
<div id="tabs">
<button id="debug-button" class="btn btn-light" onClick="logLevelSelected(event)" data-level="DEBUG">DEBUG</button>
<button id="info-button" class="btn btn-primary" onClick="logLevelSelected(event)" data-level="INFO">INFO</button>
<button id="warn-button" class="btn btn-light" onClick="logLevelSelected(event)" data-level="WARN">WARN</button>
<button id="error-button" class="btn btn-light" onClick="logLevelSelected(event)" data-level="ERROR">ERROR</button>
</div>
<div class="d-inline-flex">
<button id="more-logs" class="btn btn-light" title="Show more logs">+</button>
<button id="less-logs" class="btn btn-light" title="Show less logs">-</button>
<button id="clear-logs" class="btn btn-light">Clear Logs</button>
<div>
<button id="copy-logs" class="btn btn-light" title="Copy logs">
<span id="copy-tooltip" aria-live="assertive" class="text-info" role="tooltip" data-position="auto" title="Copied logs to clipboard!">📋</span>
</button>
</div>
</div>
</div>
<pre id="logs" class="card-body text-monospace preserve-whitespace"></pre>
</div>
</div>
</div>
<div id="test"></div>
<script src="https://awslabs.github.io/amazon-kinesis-video-streams-webrtc-sdk-js/kvs-webrtc.js"></script>
<script src="./viewer.js"></script>
<script src="./app.js"></script>
</body>
</html>