@flashphoner/sfusdk 1.0.41 → 2.0.48
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/examples/sfu.d.ts +13 -0
- package/dist/index.d.ts +6 -0
- package/dist/index.js +15 -0
- package/dist/index.js.map +1 -0
- package/dist/sdk/connection.d.ts +25 -0
- package/dist/sdk/connection.js +101 -0
- package/dist/sdk/connection.js.map +1 -0
- package/dist/sdk/constants.d.ts +355 -0
- package/dist/sdk/constants.js +190 -0
- package/dist/sdk/constants.js.map +1 -0
- package/dist/sdk/logger.d.ts +10 -0
- package/dist/sdk/logger.js +22 -0
- package/dist/sdk/logger.js.map +1 -0
- package/dist/sdk/notifier.d.ts +7 -0
- package/dist/sdk/notifier.js +52 -0
- package/dist/sdk/notifier.js.map +1 -0
- package/dist/sdk/promises.d.ts +11 -0
- package/{src/sdk/promise.js → dist/sdk/promises.js} +14 -13
- package/dist/sdk/promises.js.map +1 -0
- package/dist/sdk/room-extended.d.ts +13 -0
- package/dist/sdk/room-extended.js +112 -0
- package/dist/sdk/room-extended.js.map +1 -0
- package/dist/sdk/room.d.ts +30 -0
- package/dist/sdk/room.js +384 -0
- package/dist/sdk/room.js.map +1 -0
- package/dist/sdk/sfu-extended.d.ts +126 -0
- package/dist/sdk/sfu-extended.js +511 -0
- package/dist/sdk/sfu-extended.js.map +1 -0
- package/dist/sdk/sfu.d.ts +22 -0
- package/dist/sdk/sfu.js +136 -0
- package/dist/sdk/sfu.js.map +1 -0
- package/dist/src/index.d.ts +6 -0
- package/dist/src/sdk/connection.d.ts +25 -0
- package/dist/src/sdk/constants.d.ts +355 -0
- package/dist/src/sdk/logger.d.ts +10 -0
- package/dist/src/sdk/notifier.d.ts +7 -0
- package/dist/src/sdk/promises.d.ts +11 -0
- package/dist/src/sdk/room-extended.d.ts +13 -0
- package/dist/src/sdk/room.d.ts +30 -0
- package/dist/src/sdk/sfu-extended.d.ts +126 -0
- package/dist/src/sdk/sfu.d.ts +22 -0
- package/package.json +27 -24
- package/Gruntfile.js +0 -79
- package/README.md +0 -95
- package/dependencies/bootstrap/css/bootstrap-theme.css +0 -587
- package/dependencies/bootstrap/css/bootstrap-theme.css.map +0 -1
- package/dependencies/bootstrap/css/bootstrap-theme.min.css +0 -5
- package/dependencies/bootstrap/css/bootstrap.css +0 -6853
- package/dependencies/bootstrap/css/bootstrap.css.map +0 -1
- package/dependencies/bootstrap/css/bootstrap.min.css +0 -5
- package/dependencies/bootstrap/font-awesome/HELP-US-OUT.txt +0 -7
- package/dependencies/bootstrap/font-awesome/css/font-awesome.css +0 -2178
- package/dependencies/bootstrap/font-awesome/css/font-awesome.min.css +0 -4
- package/dependencies/bootstrap/font-awesome/fonts/FontAwesome.otf +0 -0
- package/dependencies/bootstrap/font-awesome/fonts/fontawesome-webfont.eot +0 -0
- package/dependencies/bootstrap/font-awesome/fonts/fontawesome-webfont.svg +0 -685
- package/dependencies/bootstrap/font-awesome/fonts/fontawesome-webfont.ttf +0 -0
- package/dependencies/bootstrap/font-awesome/fonts/fontawesome-webfont.woff +0 -0
- package/dependencies/bootstrap/font-awesome/fonts/fontawesome-webfont.woff2 +0 -0
- package/dependencies/bootstrap/font-awesome/less/animated.less +0 -34
- package/dependencies/bootstrap/font-awesome/less/bordered-pulled.less +0 -25
- package/dependencies/bootstrap/font-awesome/less/core.less +0 -12
- package/dependencies/bootstrap/font-awesome/less/fixed-width.less +0 -6
- package/dependencies/bootstrap/font-awesome/less/font-awesome.less +0 -18
- package/dependencies/bootstrap/font-awesome/less/icons.less +0 -724
- package/dependencies/bootstrap/font-awesome/less/larger.less +0 -13
- package/dependencies/bootstrap/font-awesome/less/list.less +0 -19
- package/dependencies/bootstrap/font-awesome/less/mixins.less +0 -60
- package/dependencies/bootstrap/font-awesome/less/path.less +0 -15
- package/dependencies/bootstrap/font-awesome/less/rotated-flipped.less +0 -20
- package/dependencies/bootstrap/font-awesome/less/screen-reader.less +0 -5
- package/dependencies/bootstrap/font-awesome/less/stacked.less +0 -20
- package/dependencies/bootstrap/font-awesome/less/variables.less +0 -735
- package/dependencies/bootstrap/font-awesome/scss/_animated.scss +0 -34
- package/dependencies/bootstrap/font-awesome/scss/_bordered-pulled.scss +0 -25
- package/dependencies/bootstrap/font-awesome/scss/_core.scss +0 -12
- package/dependencies/bootstrap/font-awesome/scss/_fixed-width.scss +0 -6
- package/dependencies/bootstrap/font-awesome/scss/_icons.scss +0 -724
- package/dependencies/bootstrap/font-awesome/scss/_larger.scss +0 -13
- package/dependencies/bootstrap/font-awesome/scss/_list.scss +0 -19
- package/dependencies/bootstrap/font-awesome/scss/_mixins.scss +0 -60
- package/dependencies/bootstrap/font-awesome/scss/_path.scss +0 -15
- package/dependencies/bootstrap/font-awesome/scss/_rotated-flipped.scss +0 -20
- package/dependencies/bootstrap/font-awesome/scss/_screen-reader.scss +0 -5
- package/dependencies/bootstrap/font-awesome/scss/_stacked.scss +0 -20
- package/dependencies/bootstrap/font-awesome/scss/_variables.scss +0 -735
- package/dependencies/bootstrap/font-awesome/scss/font-awesome.scss +0 -18
- package/dependencies/bootstrap/fonts/FontAwesome.otf +0 -0
- package/dependencies/bootstrap/fonts/fontawesome-webfont.eot +0 -0
- package/dependencies/bootstrap/fonts/fontawesome-webfont.svg +0 -655
- package/dependencies/bootstrap/fonts/fontawesome-webfont.ttf +0 -0
- package/dependencies/bootstrap/fonts/fontawesome-webfont.woff +0 -0
- package/dependencies/bootstrap/fonts/fontawesome-webfont.woff2 +0 -0
- package/dependencies/bootstrap/fonts/glyphicons-halflings-regular.eot +0 -0
- package/dependencies/bootstrap/fonts/glyphicons-halflings-regular.svg +0 -288
- package/dependencies/bootstrap/fonts/glyphicons-halflings-regular.ttf +0 -0
- package/dependencies/bootstrap/fonts/glyphicons-halflings-regular.woff +0 -0
- package/dependencies/bootstrap/fonts/glyphicons-halflings-regular.woff2 +0 -0
- package/dependencies/bootstrap/icons/font-awesome.min.css +0 -4
- package/dependencies/bootstrap/js/bootstrap.js +0 -2363
- package/dependencies/bootstrap/js/bootstrap.min.js +0 -7
- package/dependencies/bootstrap/js/npm.js +0 -13
- package/dependencies/bootstrap/js/switch.js +0 -85
- package/dependencies/jquery/jquery-1.12.0.js +0 -11027
- package/dependencies/jquery/jquery-ui.js +0 -16617
- package/dependencies/jquery/jquery.js +0 -8981
- package/dependencies/jquery/jquery.json.js +0 -199
- package/dependencies/jquery/jquery.websocket.js +0 -61
- package/dependencies/sigma/sigma.layout.forceAtlas2.min.js +0 -1
- package/dependencies/sigma/sigma.layout.noverlap.min.js +0 -1
- package/dependencies/sigma/sigma.min.js +0 -2
- package/dependencies/sigma/sigma.plugins.relativeSize.min.js +0 -1
- package/dependencies/sigma/sigma.renderers.edgeLabels.min.js +0 -1
- package/dependencies/sigma/sigma.renderers.parallelEdges.min.js +0 -1
- package/dependencies/sigma/sigma.require.js +0 -12076
- package/docTemplate/README.md +0 -5
- package/docTemplate/publish.js +0 -654
- package/docTemplate/static/fonts/OpenSans-Bold-webfont.eot +0 -0
- package/docTemplate/static/fonts/OpenSans-Bold-webfont.svg +0 -1830
- package/docTemplate/static/fonts/OpenSans-Bold-webfont.woff +0 -0
- package/docTemplate/static/fonts/OpenSans-BoldItalic-webfont.eot +0 -0
- package/docTemplate/static/fonts/OpenSans-BoldItalic-webfont.svg +0 -1830
- package/docTemplate/static/fonts/OpenSans-BoldItalic-webfont.woff +0 -0
- package/docTemplate/static/fonts/OpenSans-Italic-webfont.eot +0 -0
- package/docTemplate/static/fonts/OpenSans-Italic-webfont.svg +0 -1830
- package/docTemplate/static/fonts/OpenSans-Italic-webfont.woff +0 -0
- package/docTemplate/static/fonts/OpenSans-Light-webfont.eot +0 -0
- package/docTemplate/static/fonts/OpenSans-Light-webfont.svg +0 -1831
- package/docTemplate/static/fonts/OpenSans-Light-webfont.woff +0 -0
- package/docTemplate/static/fonts/OpenSans-LightItalic-webfont.eot +0 -0
- package/docTemplate/static/fonts/OpenSans-LightItalic-webfont.svg +0 -1835
- package/docTemplate/static/fonts/OpenSans-LightItalic-webfont.woff +0 -0
- package/docTemplate/static/fonts/OpenSans-Regular-webfont.eot +0 -0
- package/docTemplate/static/fonts/OpenSans-Regular-webfont.svg +0 -1831
- package/docTemplate/static/fonts/OpenSans-Regular-webfont.woff +0 -0
- package/docTemplate/static/scripts/linenumber.js +0 -25
- package/docTemplate/static/scripts/prettify/Apache-License-2.0.txt +0 -202
- package/docTemplate/static/scripts/prettify/lang-css.js +0 -2
- package/docTemplate/static/scripts/prettify/prettify.js +0 -28
- package/docTemplate/static/styles/jsdoc-default.css +0 -354
- package/docTemplate/static/styles/prettify-jsdoc.css +0 -111
- package/docTemplate/static/styles/prettify-tomorrow.css +0 -132
- package/docTemplate/tmpl/augments.tmpl +0 -10
- package/docTemplate/tmpl/container.tmpl +0 -183
- package/docTemplate/tmpl/details.tmpl +0 -143
- package/docTemplate/tmpl/example.tmpl +0 -2
- package/docTemplate/tmpl/examples.tmpl +0 -13
- package/docTemplate/tmpl/exceptions.tmpl +0 -32
- package/docTemplate/tmpl/layout.tmpl +0 -38
- package/docTemplate/tmpl/mainpage.tmpl +0 -14
- package/docTemplate/tmpl/members.tmpl +0 -38
- package/docTemplate/tmpl/method.tmpl +0 -105
- package/docTemplate/tmpl/params.tmpl +0 -124
- package/docTemplate/tmpl/properties.tmpl +0 -108
- package/docTemplate/tmpl/returns.tmpl +0 -19
- package/docTemplate/tmpl/source.tmpl +0 -8
- package/docTemplate/tmpl/tutorial.tmpl +0 -19
- package/docTemplate/tmpl/type.tmpl +0 -7
- package/src/examples/client/chat.js +0 -67
- package/src/examples/client/config.json +0 -26
- package/src/examples/client/controls.js +0 -314
- package/src/examples/client/display.js +0 -502
- package/src/examples/client/main.css +0 -45
- package/src/examples/client/main.html +0 -220
- package/src/examples/client/main.js +0 -156
- package/src/examples/client/resources/details_close.png +0 -0
- package/src/examples/client/resources/details_open.png +0 -0
- package/src/examples/client/util.js +0 -67
- package/src/examples/commons/js/config.js +0 -81
- package/src/examples/commons/js/display.js +0 -484
- package/src/examples/commons/js/util.js +0 -202
- package/src/examples/commons/media/silence.mp3 +0 -0
- package/src/examples/controller/dependencies/sigma/sigma.renderers.edgeLabels.min.js +0 -1
- package/src/examples/controller/dependencies/sigma/sigma.renderers.parallelEdges.min.js +0 -1
- package/src/examples/controller/dependencies/sigma/sigma.require.js +0 -12076
- package/src/examples/controller/graph-view.js +0 -32
- package/src/examples/controller/main.css +0 -45
- package/src/examples/controller/main.html +0 -79
- package/src/examples/controller/main.js +0 -65
- package/src/examples/controller/parser.js +0 -202
- package/src/examples/controller/resources/details_close.png +0 -0
- package/src/examples/controller/resources/details_open.png +0 -0
- package/src/examples/controller/rest.js +0 -56
- package/src/examples/controller/table-view.js +0 -64
- package/src/examples/controller/test-data.js +0 -382
- package/src/examples/player/config.json +0 -8
- package/src/examples/player/player.css +0 -19
- package/src/examples/player/player.html +0 -54
- package/src/examples/player/player.js +0 -209
- package/src/examples/two-way-streaming/config.json +0 -34
- package/src/examples/two-way-streaming/two-way-streaming.css +0 -26
- package/src/examples/two-way-streaming/two-way-streaming.html +0 -72
- package/src/examples/two-way-streaming/two-way-streaming.js +0 -375
- package/src/sdk/constants.js +0 -488
- package/src/sdk/messaging.js +0 -59
- package/src/sdk/room.js +0 -442
- package/src/sdk/sfu-extended.js +0 -513
- package/src/sdk/sfu.js +0 -179
- package/src/sdk/ws.js +0 -109
- package/src/tests/sdk/sfu-extended.test.js +0 -151
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
const createGraphView = function(container) {
|
|
2
|
-
//setup sigma
|
|
3
|
-
const s = new sigma({
|
|
4
|
-
renderer: {
|
|
5
|
-
container: container,
|
|
6
|
-
type: 'canvas'
|
|
7
|
-
},
|
|
8
|
-
settings: {
|
|
9
|
-
minArrowSize: 3,
|
|
10
|
-
edgeLabelSize: 'fixed'
|
|
11
|
-
}
|
|
12
|
-
});
|
|
13
|
-
|
|
14
|
-
const refreshSigma = function(model) {
|
|
15
|
-
s.graph.clear();
|
|
16
|
-
s.refresh();
|
|
17
|
-
|
|
18
|
-
s.graph.read(model);
|
|
19
|
-
s.refresh();
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
const bindNodeClickEvents = function (handler) {
|
|
23
|
-
const eventList = 'clickNode doubleClickNode rightClickNode';
|
|
24
|
-
s.bind(eventList, handler);
|
|
25
|
-
};
|
|
26
|
-
|
|
27
|
-
return {
|
|
28
|
-
s: s,
|
|
29
|
-
bindNodeClickEvents: bindNodeClickEvents,
|
|
30
|
-
refreshSigma: refreshSigma
|
|
31
|
-
}
|
|
32
|
-
}
|
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
.grid-container {
|
|
2
|
-
display: grid;
|
|
3
|
-
grid-template-columns: auto auto auto;
|
|
4
|
-
width: 1284px;
|
|
5
|
-
height: auto;
|
|
6
|
-
}
|
|
7
|
-
.grid-container-local {
|
|
8
|
-
display: grid;
|
|
9
|
-
grid-template-columns: auto auto;
|
|
10
|
-
width: 1284px;
|
|
11
|
-
height: auto;
|
|
12
|
-
}
|
|
13
|
-
.grid-item {
|
|
14
|
-
border: 1px solid rgba(0, 0, 0, 0.8);
|
|
15
|
-
text-align: center;
|
|
16
|
-
width: 428px;
|
|
17
|
-
height: auto;
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
video, object {
|
|
21
|
-
width: 100%;
|
|
22
|
-
height: 100%;
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
#messages {
|
|
26
|
-
height: 300px;
|
|
27
|
-
overflow-y: auto;
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
.display {
|
|
31
|
-
width: 100%;
|
|
32
|
-
height: 100%;
|
|
33
|
-
display: inline-block;
|
|
34
|
-
}
|
|
35
|
-
caption {
|
|
36
|
-
caption-side:top;
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
td.details-control {
|
|
40
|
-
background: url('resources/details_open.png') no-repeat center center;
|
|
41
|
-
cursor: pointer;
|
|
42
|
-
}
|
|
43
|
-
tr.shown td.details-control {
|
|
44
|
-
background: url('resources/details_close.png') no-repeat center center;
|
|
45
|
-
}
|
|
@@ -1,79 +0,0 @@
|
|
|
1
|
-
<!DOCTYPE html>
|
|
2
|
-
<html lang="en">
|
|
3
|
-
<head>
|
|
4
|
-
<meta charset="UTF-8">
|
|
5
|
-
<meta name="viewport" content="width=device-width, initial-scale=1">
|
|
6
|
-
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.0.0-beta3/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-eOJMYsd53ii+scO/bJGFsiCZc+5NDVN2yr8+0RDqr0Ql0h+rP48ckxlpbzKgwra6" crossorigin="anonymous">
|
|
7
|
-
<!-- JavaScript Bundle with Popper -->
|
|
8
|
-
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.0.0-beta3/dist/js/bootstrap.bundle.min.js" integrity="sha384-JEW9xMcG8R+pH31jmWH6WWP0WintQrMb4s7ZOdauHnUtxwoG2vI5DkLtS3qm9Ekf" crossorigin="anonymous"></script>
|
|
9
|
-
<script src="https://cdn.jsdelivr.net/npm/jquery@3.6.0/dist/jquery.min.js"></script>
|
|
10
|
-
<link href="https://cdn.datatables.net/1.10.24/css/jquery.dataTables.min.css" rel="stylesheet"></link>
|
|
11
|
-
<script src="https://cdn.datatables.net/1.10.24/js/jquery.dataTables.min.js"></script>
|
|
12
|
-
|
|
13
|
-
<script type="text/javascript" src="dependencies/sigma/sigma.require.js"></script>
|
|
14
|
-
<script type="text/javascript" src="dependencies/sigma/sigma.renderers.edgeLabels.min.js"></script>
|
|
15
|
-
<script type="text/javascript" src="dependencies/sigma/sigma.renderers.parallelEdges.min.js"></script>
|
|
16
|
-
|
|
17
|
-
<title>SFU Room Controller</title>
|
|
18
|
-
<link rel="stylesheet" href="main.css">
|
|
19
|
-
<script type="text/javascript" src="parser.js"></script>
|
|
20
|
-
<script type="text/javascript" src="graph-view.js"></script>
|
|
21
|
-
<script type="text/javascript" src="table-view.js"></script>
|
|
22
|
-
<script type="text/javascript" src="rest.js"></script>
|
|
23
|
-
<script type="text/javascript" src="main.js"></script>
|
|
24
|
-
</head>
|
|
25
|
-
<body>
|
|
26
|
-
<div class="container-fluid" id="main">
|
|
27
|
-
<input id="url" type="text" value="http://127.0.0.1:8081">
|
|
28
|
-
<input id="roomName" type="text" value="ROOM1">
|
|
29
|
-
<button id="startButton" onclick="connect()">Connect</button>
|
|
30
|
-
<button id="freeze" disabled>Freeze</button>
|
|
31
|
-
<ul class="nav nav-tabs" id="myTab" role="tablist">
|
|
32
|
-
<li class="nav-item" role="presentation">
|
|
33
|
-
<button class="nav-link active" id="raw-tab" data-bs-toggle="tab" data-bs-target="#raw" type="button" role="tab" aria-controls="raw" aria-selected="true">Raw</button>
|
|
34
|
-
</li>
|
|
35
|
-
<li class="nav-item" role="presentation">
|
|
36
|
-
<button class="nav-link" id="map-tab" data-bs-toggle="tab" data-bs-target="#map" type="button" role="tab" aria-controls="map" aria-selected="false">Map</button>
|
|
37
|
-
</li>
|
|
38
|
-
<li class="nav-item" role="presentation">
|
|
39
|
-
<button class="nav-link" id="config-tab" data-bs-toggle="tab" data-bs-target="#config" type="button" role="tab" aria-controls="config" aria-selected="false">Config</button>
|
|
40
|
-
</li>
|
|
41
|
-
</ul>
|
|
42
|
-
<div class="tab-content" id="myTabContent">
|
|
43
|
-
<div class="tab-pane fade show active" id="raw" role="tabpanel" aria-labelledby="raw-tab">
|
|
44
|
-
<pre id="rawContent"></pre>
|
|
45
|
-
</div>
|
|
46
|
-
<div class="tab-pane fade" id="map" role="tabpanel" aria-labelledby="map-tab">
|
|
47
|
-
<div class="row">
|
|
48
|
-
<div class="col-sm-6">
|
|
49
|
-
<div id="sigmaContainer" style="width: 900px; height: 800px">
|
|
50
|
-
</div>
|
|
51
|
-
</div>
|
|
52
|
-
<div class="col-sm-6">
|
|
53
|
-
<table id="metricTable" class="display">
|
|
54
|
-
<thead>
|
|
55
|
-
<tr>
|
|
56
|
-
<th></th>
|
|
57
|
-
<th>METRIC</th>
|
|
58
|
-
<th>TYPE</th>
|
|
59
|
-
<th>PARTICIPANT</th>>
|
|
60
|
-
<th>ID</th>
|
|
61
|
-
<th>QUALITY</th>
|
|
62
|
-
</tr>
|
|
63
|
-
</thead>
|
|
64
|
-
<tbody id="metricTableBody"></tbody>
|
|
65
|
-
</table>
|
|
66
|
-
</div>
|
|
67
|
-
</div>
|
|
68
|
-
</div>
|
|
69
|
-
<div class="tab-pane fade" id="config" role="tabpanel" aria-labelledby="config-tab">
|
|
70
|
-
<div class="form-group form-inline">
|
|
71
|
-
<label for="pollIntervalInput">Poll interval</label>
|
|
72
|
-
<input type="text" class="form-control" id="pollIntervalInput">
|
|
73
|
-
</div>
|
|
74
|
-
<button id="settingsButton" type="submit" class="btn btn-primary">Submit</button>
|
|
75
|
-
</div>
|
|
76
|
-
</div>
|
|
77
|
-
</div>
|
|
78
|
-
</body>
|
|
79
|
-
</html>
|
|
@@ -1,65 +0,0 @@
|
|
|
1
|
-
const config = {
|
|
2
|
-
intervals: {
|
|
3
|
-
poll: 3000
|
|
4
|
-
}
|
|
5
|
-
};
|
|
6
|
-
|
|
7
|
-
const connect = function() {
|
|
8
|
-
let freeze = false;
|
|
9
|
-
const urlElem = document.getElementById("url");
|
|
10
|
-
const roomNameElem = document.getElementById("roomName");
|
|
11
|
-
const rawDisplay = document.getElementById("rawContent");
|
|
12
|
-
const startButtonElem = document.getElementById("startButton");
|
|
13
|
-
const freezeButtonElem = document.getElementById("freeze");
|
|
14
|
-
startButtonElem.disabled = true;
|
|
15
|
-
urlElem.disabled = true;
|
|
16
|
-
roomNameElem.disabled = true;
|
|
17
|
-
const url = urlElem.value;
|
|
18
|
-
const roomName = roomNameElem.value;
|
|
19
|
-
const api = createConnection(url, roomName);
|
|
20
|
-
let pollTimeout;
|
|
21
|
-
const pollStats = function() {
|
|
22
|
-
api.stats().then(function(stats){
|
|
23
|
-
if (!freeze) {
|
|
24
|
-
processAndDisplay(stats);
|
|
25
|
-
pollTimeout = setTimeout(pollStats, config.intervals.poll);
|
|
26
|
-
}
|
|
27
|
-
}, function(e) {
|
|
28
|
-
console.log("Failed to poll stats " + e);
|
|
29
|
-
if (!freeze) {
|
|
30
|
-
rawDisplay.innerHTML = "Failed to poll stats " + e;
|
|
31
|
-
pollTimeout = setTimeout(pollStats, config.intervals.poll);
|
|
32
|
-
}
|
|
33
|
-
})
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
freezeButtonElem.addEventListener("click", function(){
|
|
37
|
-
if (freezeButtonElem.innerText === "Freeze") {
|
|
38
|
-
freeze = true;
|
|
39
|
-
clearTimeout(pollTimeout);
|
|
40
|
-
freezeButtonElem.innerText = "Unfreeze";
|
|
41
|
-
} else {
|
|
42
|
-
freeze = false;
|
|
43
|
-
pollStats();
|
|
44
|
-
freezeButtonElem.innerText = "Freeze";
|
|
45
|
-
}
|
|
46
|
-
});
|
|
47
|
-
freezeButtonElem.disabled = false;
|
|
48
|
-
|
|
49
|
-
const gView = createGraphView('sigmaContainer');
|
|
50
|
-
const tView = createMetricTable();
|
|
51
|
-
let tData, gData;
|
|
52
|
-
const processAndDisplay = function(stats) {
|
|
53
|
-
rawDisplay.innerHTML = JSON.stringify(stats, null, 2);
|
|
54
|
-
tData = statsToTable(stats);
|
|
55
|
-
gData = statsToGraph(stats);
|
|
56
|
-
gView.refreshSigma(gData);
|
|
57
|
-
tView.updateMetricTable(tData.WCS, "WCS");
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
gView.bindNodeClickEvents(function(e){
|
|
61
|
-
tView.updateMetricTable(tData[e.data.node.id], e.data.node.id);
|
|
62
|
-
});
|
|
63
|
-
//kick off stats polling
|
|
64
|
-
pollStats();
|
|
65
|
-
}
|
|
@@ -1,202 +0,0 @@
|
|
|
1
|
-
const statsToGraph = function(stats) {
|
|
2
|
-
let g = {
|
|
3
|
-
nodes: [],
|
|
4
|
-
edges: []
|
|
5
|
-
}
|
|
6
|
-
|
|
7
|
-
const wcsId = "WCS";
|
|
8
|
-
const edgeType = 'curvedArrow';
|
|
9
|
-
let eIndex = 0;
|
|
10
|
-
const fromServerColour = '#00ff40';
|
|
11
|
-
const fromParticipantColour = '#3a8dc6';
|
|
12
|
-
const deadTrackColour = '#ff2800';
|
|
13
|
-
const nodeSize = 5;
|
|
14
|
-
const edgeSize = 2;
|
|
15
|
-
|
|
16
|
-
g.nodes.push({
|
|
17
|
-
id: wcsId,
|
|
18
|
-
label: wcsId,
|
|
19
|
-
// Display attributes:
|
|
20
|
-
x: 0,
|
|
21
|
-
y: 0,
|
|
22
|
-
size: nodeSize,
|
|
23
|
-
color: fromServerColour
|
|
24
|
-
});
|
|
25
|
-
|
|
26
|
-
const calcPoints = function(radius, qty) {
|
|
27
|
-
const ret = [];
|
|
28
|
-
const stepRad = 360/qty * Math.PI / 180;
|
|
29
|
-
for (let i = 0; i < qty; i++) {
|
|
30
|
-
let angle = i * stepRad;
|
|
31
|
-
let x = Math.cos(angle) * radius;
|
|
32
|
-
let y = Math.sin(angle) * radius;
|
|
33
|
-
ret.push({
|
|
34
|
-
x: x,
|
|
35
|
-
y: y
|
|
36
|
-
});
|
|
37
|
-
}
|
|
38
|
-
return ret;
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
const points = calcPoints(800, stats.participants.length);
|
|
42
|
-
stats.participants.forEach(function(participant){
|
|
43
|
-
let count = 0;
|
|
44
|
-
let point = points.pop();
|
|
45
|
-
g.nodes.push({
|
|
46
|
-
id: participant.nickName,
|
|
47
|
-
label: participant.nickName,
|
|
48
|
-
// Display attributes:
|
|
49
|
-
x: point.x,
|
|
50
|
-
y: point.y,
|
|
51
|
-
size: nodeSize,
|
|
52
|
-
color: fromParticipantColour
|
|
53
|
-
});
|
|
54
|
-
participant.outgoingTracks.forEach(function(track){
|
|
55
|
-
if (track.composite) {
|
|
56
|
-
for (const [key, value] of Object.entries(track.tracks)) {
|
|
57
|
-
g.edges.push({
|
|
58
|
-
id: 'e' + eIndex,
|
|
59
|
-
// Reference extremities:
|
|
60
|
-
source: participant.nickName,
|
|
61
|
-
target: wcsId,
|
|
62
|
-
label: value.id + "-" + key,
|
|
63
|
-
count: count++,
|
|
64
|
-
size: edgeSize,
|
|
65
|
-
type: edgeType,
|
|
66
|
-
color: value.alive ? fromParticipantColour : deadTrackColour
|
|
67
|
-
});
|
|
68
|
-
eIndex++;
|
|
69
|
-
}
|
|
70
|
-
} else {
|
|
71
|
-
g.edges.push({
|
|
72
|
-
id: 'e' + eIndex,
|
|
73
|
-
// Reference extremities:
|
|
74
|
-
source: participant.nickName,
|
|
75
|
-
target: wcsId,
|
|
76
|
-
label: track.id,
|
|
77
|
-
count: count++,
|
|
78
|
-
size: edgeSize,
|
|
79
|
-
type: edgeType,
|
|
80
|
-
color: track.alive ? fromParticipantColour : deadTrackColour
|
|
81
|
-
});
|
|
82
|
-
eIndex++;
|
|
83
|
-
}
|
|
84
|
-
});
|
|
85
|
-
for (const [key, value] of Object.entries(participant.incomingTracks)) {
|
|
86
|
-
g.edges.push({
|
|
87
|
-
id: 'e' + eIndex,
|
|
88
|
-
// Reference extremities:
|
|
89
|
-
source: wcsId,
|
|
90
|
-
target: participant.nickName,
|
|
91
|
-
label: value ? key + "-" + value : key,
|
|
92
|
-
count: count++,
|
|
93
|
-
size: edgeSize,
|
|
94
|
-
type: edgeType,
|
|
95
|
-
color: fromServerColour
|
|
96
|
-
});
|
|
97
|
-
eIndex++;
|
|
98
|
-
}
|
|
99
|
-
});
|
|
100
|
-
return g;
|
|
101
|
-
}
|
|
102
|
-
|
|
103
|
-
const statsToTable = function(stats) {
|
|
104
|
-
const NA = "NA";
|
|
105
|
-
const tKey = function(str1, str2) {
|
|
106
|
-
if (str1 && str2) {
|
|
107
|
-
return str1.replaceAll(" ", "") + str2.replaceAll(" ", "");
|
|
108
|
-
}
|
|
109
|
-
return str1;
|
|
110
|
-
}
|
|
111
|
-
const trackToTable = function(track, nickName, quality) {
|
|
112
|
-
return {
|
|
113
|
-
metric: "track",
|
|
114
|
-
type: track.type,
|
|
115
|
-
participant: nickName,
|
|
116
|
-
id: track.id,
|
|
117
|
-
quality: quality,
|
|
118
|
-
details: track
|
|
119
|
-
}
|
|
120
|
-
}
|
|
121
|
-
const metricToTable = function(name, value, nickName) {
|
|
122
|
-
return {
|
|
123
|
-
metric: name,
|
|
124
|
-
type: value,
|
|
125
|
-
participant: nickName,
|
|
126
|
-
id: NA,
|
|
127
|
-
quality: NA,
|
|
128
|
-
details: {}
|
|
129
|
-
}
|
|
130
|
-
}
|
|
131
|
-
|
|
132
|
-
const metrics = {};
|
|
133
|
-
metrics.WCS = [];
|
|
134
|
-
let bitrate_in = 0;
|
|
135
|
-
let tracks_in = 0;
|
|
136
|
-
|
|
137
|
-
const src = {};
|
|
138
|
-
stats.participants.forEach(function(participant){
|
|
139
|
-
participant.outgoingTracks.forEach(function(track){
|
|
140
|
-
if (track.composite) {
|
|
141
|
-
for (const [key, value] of Object.entries(track.tracks)) {
|
|
142
|
-
src[tKey(value.id, key)] = value;
|
|
143
|
-
value.nickName = participant.nickName;
|
|
144
|
-
bitrate_in += value.bitrate;
|
|
145
|
-
tracks_in++;
|
|
146
|
-
}
|
|
147
|
-
} else {
|
|
148
|
-
src[tKey(track.id)] = track;
|
|
149
|
-
track.nickName = participant.nickName;
|
|
150
|
-
bitrate_in += track.bitrate;
|
|
151
|
-
tracks_in++;
|
|
152
|
-
}
|
|
153
|
-
});
|
|
154
|
-
});
|
|
155
|
-
let bitrate_out = 0;
|
|
156
|
-
let tracks_out = 0;
|
|
157
|
-
stats.participants.forEach(function(participant){
|
|
158
|
-
for (const [key, value] of Object.entries(participant.incomingTracks)) {
|
|
159
|
-
const srcTrack = src[tKey(key, value)];
|
|
160
|
-
bitrate_out += srcTrack.bitrate;
|
|
161
|
-
tracks_out++;
|
|
162
|
-
}
|
|
163
|
-
});
|
|
164
|
-
metrics.WCS.push(metricToTable("participants", stats.participants.length, NA));
|
|
165
|
-
metrics.WCS.push(metricToTable("bitrate_in", bitrate_in, NA));
|
|
166
|
-
metrics.WCS.push(metricToTable("bitrate_out", bitrate_out, NA));
|
|
167
|
-
metrics.WCS.push(metricToTable("tracks_in", tracks_in, NA));
|
|
168
|
-
metrics.WCS.push(metricToTable("tracks_out", tracks_out, NA));
|
|
169
|
-
stats.participants.forEach(function(participant){
|
|
170
|
-
const pStats = [];
|
|
171
|
-
let tracksIn = 0;
|
|
172
|
-
let tracksOut = 0;
|
|
173
|
-
let bitrateIn = 0;
|
|
174
|
-
let bitrateOut = 0;
|
|
175
|
-
participant.outgoingTracks.forEach(function(track){
|
|
176
|
-
if (track.composite) {
|
|
177
|
-
for (const [key, value] of Object.entries(track.tracks)) {
|
|
178
|
-
pStats.push(trackToTable(value, participant.nickName, key));
|
|
179
|
-
tracksOut++;
|
|
180
|
-
bitrateOut += value.bitrate;
|
|
181
|
-
}
|
|
182
|
-
} else {
|
|
183
|
-
pStats.push(trackToTable(track, participant.nickName, "NA"));
|
|
184
|
-
tracksOut++;
|
|
185
|
-
bitrateOut += track.bitrate;
|
|
186
|
-
}
|
|
187
|
-
});
|
|
188
|
-
for (const [key, value] of Object.entries(participant.incomingTracks)) {
|
|
189
|
-
const srcTrack = src[tKey(key, value)];
|
|
190
|
-
pStats.push(trackToTable(srcTrack, srcTrack.nickName, value));
|
|
191
|
-
tracksIn++;
|
|
192
|
-
bitrateIn += srcTrack.bitrate;
|
|
193
|
-
}
|
|
194
|
-
pStats.push(metricToTable("tracks_in", tracksIn, participant.nickName));
|
|
195
|
-
pStats.push(metricToTable("bitrate_in", bitrateIn, participant.nickName));
|
|
196
|
-
pStats.push(metricToTable("tracks_out", tracksOut, participant.nickName));
|
|
197
|
-
pStats.push(metricToTable("bitrate_out", bitrateOut, participant.nickName));
|
|
198
|
-
metrics[participant.nickName] = pStats;
|
|
199
|
-
});
|
|
200
|
-
|
|
201
|
-
return metrics;
|
|
202
|
-
}
|
|
Binary file
|
|
Binary file
|
|
@@ -1,56 +0,0 @@
|
|
|
1
|
-
const SFU_PATH = "/rest-api/sfu/";
|
|
2
|
-
|
|
3
|
-
const createConnection = function(url, roomName) {
|
|
4
|
-
const stats = function() {
|
|
5
|
-
return send(url + SFU_PATH + "stats", {
|
|
6
|
-
roomName: roomName
|
|
7
|
-
});
|
|
8
|
-
}
|
|
9
|
-
return {
|
|
10
|
-
stats: stats
|
|
11
|
-
}
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
/** XHR WRAPPER **/
|
|
16
|
-
const send = function(uri, data, responseIsText) {
|
|
17
|
-
return new Promise(function(resolve, reject) {
|
|
18
|
-
var xhr = new XMLHttpRequest();
|
|
19
|
-
if (data) {
|
|
20
|
-
xhr.open('POST', uri, true);
|
|
21
|
-
xhr.setRequestHeader("Content-Type", "application/json;charset=UTF-8");
|
|
22
|
-
} else {
|
|
23
|
-
xhr.open('GET', uri, true);
|
|
24
|
-
}
|
|
25
|
-
xhr.responseType = 'text';
|
|
26
|
-
xhr.onload = function (e) {
|
|
27
|
-
if (this.status === 200) {
|
|
28
|
-
if (this.response) {
|
|
29
|
-
if (!responseIsText) {
|
|
30
|
-
resolve(JSON.parse(this.response));
|
|
31
|
-
} else {
|
|
32
|
-
resolve(this.response);
|
|
33
|
-
}
|
|
34
|
-
} else {
|
|
35
|
-
resolve();
|
|
36
|
-
}
|
|
37
|
-
} else {
|
|
38
|
-
reject(this);
|
|
39
|
-
}
|
|
40
|
-
};
|
|
41
|
-
xhr.onreadystatechange = function () {
|
|
42
|
-
if (xhr.readyState === 4){
|
|
43
|
-
if(xhr.status === 200){
|
|
44
|
-
//success
|
|
45
|
-
} else {
|
|
46
|
-
reject();
|
|
47
|
-
}
|
|
48
|
-
}
|
|
49
|
-
};
|
|
50
|
-
if (data) {
|
|
51
|
-
xhr.send(JSON.stringify(data));
|
|
52
|
-
} else {
|
|
53
|
-
xhr.send();
|
|
54
|
-
}
|
|
55
|
-
});
|
|
56
|
-
};
|
|
@@ -1,64 +0,0 @@
|
|
|
1
|
-
const createMetricTable = function() {
|
|
2
|
-
const updateMetricTable = function(data, caption) {
|
|
3
|
-
metricTableCaption.innerHTML = caption;
|
|
4
|
-
metricTable.clear();
|
|
5
|
-
data.forEach(function(value) {
|
|
6
|
-
metricTable.row.add(value);
|
|
7
|
-
});
|
|
8
|
-
metricTable.draw();
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
//setup table
|
|
12
|
-
const metricTable = $('#metricTable').DataTable({
|
|
13
|
-
"columns": [
|
|
14
|
-
{
|
|
15
|
-
"className": 'details-control',
|
|
16
|
-
"orderable": false,
|
|
17
|
-
"data": null,
|
|
18
|
-
"defaultContent": ''
|
|
19
|
-
},
|
|
20
|
-
{"data": "metric"},
|
|
21
|
-
{"data": "type"},
|
|
22
|
-
{"data": "participant"},
|
|
23
|
-
{"data": "id"},
|
|
24
|
-
{"data": "quality"}
|
|
25
|
-
]
|
|
26
|
-
});
|
|
27
|
-
|
|
28
|
-
const format = function(d) {
|
|
29
|
-
let details = '<table cellpadding="5" cellspacing="0" border="0" style="padding-left:50px;">';
|
|
30
|
-
for (const [key, value] of Object.entries(d.details)) {
|
|
31
|
-
details += '<tr>'+
|
|
32
|
-
'<td>'+ key + '</td>'+
|
|
33
|
-
'<td>'+ value + '</td>'+
|
|
34
|
-
'</tr>';
|
|
35
|
-
}
|
|
36
|
-
details +='</table>';
|
|
37
|
-
return details;
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
// Add event listener for opening and closing details
|
|
41
|
-
$('#metricTableBody').on('click', 'td.details-control', function () {
|
|
42
|
-
var tr = $(this).closest('tr');
|
|
43
|
-
var row = metricTable.row( tr );
|
|
44
|
-
|
|
45
|
-
if ( row.child.isShown() ) {
|
|
46
|
-
// This row is already open - close it
|
|
47
|
-
row.child.hide();
|
|
48
|
-
tr.removeClass('shown');
|
|
49
|
-
}
|
|
50
|
-
else {
|
|
51
|
-
// Open this row
|
|
52
|
-
row.child( format(row.data()) ).show();
|
|
53
|
-
tr.addClass('shown');
|
|
54
|
-
}
|
|
55
|
-
});
|
|
56
|
-
|
|
57
|
-
const metricTableCaption = document.getElementById("metricTable").createCaption();
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
return {
|
|
62
|
-
updateMetricTable: updateMetricTable
|
|
63
|
-
}
|
|
64
|
-
}
|