-
-
Notifications
You must be signed in to change notification settings - Fork 28
/
Copy pathindex.html
192 lines (188 loc) · 10.7 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
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>AES67 Stream Monitor</title>
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<link rel="stylesheet" href="css/bootstrap/bootstrap.min.css">
<link rel="stylesheet" href="css/app.css">
</head>
<body>
<div id="app" v-cloak>
<div id="sdp" v-if="page == 'sdp'">
<div id="errors" class="alert alert-danger" v-if="errors.length > 0">
<span v-for="error in errors">{{ error }}<br /></span>
</div>
<div>
<div class="header"><h4 class="d-inline-block">Streams <span class="badge badge-primary"><span v-if="filterString != ''">{{ filtered }}/</span>{{ sdp.length }}</span></h4><button class="d-inline-block btn btn-sm btn-secondary float-right" v-on:click="page='settings';">Settings</button><input class="form-control form-control-sm d-inline-block float-right" id="filter" type="text" v-model="filterString" placeholder="Filter streams" /></div>
<div class="alert alert-primary" role="alert" v-if="sdp.length == 0">Waiting for SDP Messages</div>
<div class="table-responsive">
<table id="table-sdp" class="table table-sm" v-if="sdp.length > 0">
<thead v-if="filtered > 0 || (sdp.length > 0 && filterString == '')">
<tr>
<th v-on:click="sortStreams('name')" class="sortable" v-bind:class="{'asc': sortingState == 0, 'desc': sortingState == 1}">Name</th>
<th>Tags</th>
<th v-on:click="sortStreams('info')" class="sortable" v-bind:class="{'asc': sortingState == 2, 'desc': sortingState == 3}">Info</th>
<th v-on:click="sortStreams('addr')" class="sortable" v-bind:class="{'asc': sortingState == 4, 'desc': sortingState == 5}">Device Address</th>
<th v-on:click="sortStreams('mcast')" class="sortable" v-bind:class="{'asc': sortingState == 6, 'desc': sortingState == 7}">Multicast Address</th>
<th v-on:click="sortStreams('codec')" class="sortable" v-bind:class="{'asc': sortingState == 8, 'desc': sortingState == 9}">Format</th>
<th v-on:click="sortStreams('samplerate')" class="sortable" v-bind:class="{'asc': sortingState == 10, 'desc': sortingState == 11}">Samplerate</th>
<th v-on:click="sortStreams('channels')" class="sortable" v-bind:class="{'asc': sortingState == 12, 'desc': sortingState == 13}">Channel #</th>
<th>Channel</th>
<th></th>
<th></th>
<th></th>
</tr>
</thead>
<tbody>
<tr v-for="stream in sdp" v-if="filterStream(stream) && (stream.isSupported || !settings.hideStreams)">
<td>{{ stream.name }}</td>
<td>
<span v-if="stream.dante" class="badge badge-secondary" title="Dante device">Dante</span>
<span v-if="stream.manual" class="badge badge-secondary" title="Manually added">Manual</span>
<span v-if="stream.announce" class="badge badge-secondary" title="Stream is being announced on the network">SAP</span>
</td>
<td>{{ stream.description }}</td>
<td>{{ stream.origin.address }}</td>
<td>{{ stream.mcast }}</td>
<td>{{ stream.codec }}</td>
<td><span v-if="stream.isSupported">{{ stream.samplerate }}Hz</span></td>
<td>{{ stream.channels }}</td>
<td>
<select class="form-control form-control-sm" :disabled="!stream.isSupported || audio == stream.id" v-model="selected[stream.id]">
<option v-for="channel in getChannels(stream)" v-bind:value="channel.val">{{ channel.name }}</option>
</select>
</td>
<td><button class="btn btn-sm btn-success" :disabled="!stream.isSupported" v-on:click="audioHandler(stream)" v-bind:class="{ 'btn-success': (audio != stream.id), 'btn-danger': (audio == stream.id) }" v-html="stream.id == audio ? 'Stop' : 'Listen'">Listen</button></td>
<td><button class="btn btn-sm btn-primary" v-on:click="detailHandler(stream)">Details</button></td>
<td><button v-if="stream.manual" class="btn btn-sm btn-danger" v-on:click="deleteHandler(stream)">Delete</button></td>
</tr>
</tbody>
</table>
</div>
<div class="alert alert-primary" role="alert" v-if="filtered == 0 && sdp.length > 0 && filterString != ''">No matchings streams.</div>
</div>
</div>
<div id="settings" v-if="page == 'settings'">
<div class="header"><h4 class="d-inline-block">Settings</h4><button class="d-inline-block btn btn-sm btn-secondary float-right" v-on:click="saveSettings(false)">Cancel</button><button class="d-inline-block btn btn-sm btn-success float-right" id="save" v-on:click="saveSettings(true)">Save</button></div>
<hr />
<div class="row">
<div class="col-4">
<h6>Network</h6><hr>
<div class="form-group">
<label for="network">Network interface</label>
<select class="form-control" v-model="currentSettings.addr" id="network">
<option v-for="addr in network" v-bind:value="addr">{{ addr }}</option>
</select>
</div>
</div>
<div class="col-4">
<h6>Audio</h6><hr>
<div class="form-group">
<label for="audiodevice">Audiodevice</label>
<select class="form-control" v-model="currentSettings.device" id="audiodevice">
<option v-for="device in audiodevices" v-bind:value="device.id">{{ device.name }}</option>
</select>
</div>
<div class="form-check">
<input class="form-check-input" type="checkbox" v-model="currentSettings.jitterBuffer" id="jitterbuffer">
<label class="form-check-label" for="jitterbuffer">
Use RTP buffering
</label>
</div>
<div class="input-group">
<input class="form-control" type="number" v-model="currentSettings.jitterBufferTime" :disabled="!currentSettings.jitterBuffer" min="1" max="1000" />
<div class="input-group-append">
<span class="input-group-text">packets</span>
</div>
</div>
<small v-if="audio != 0">Playback needs to be restarted for audio settings to become active</small>
</div>
<div class="col-4">
<h6>Other</h6><hr>
<div class="form-check">
<input class="form-check-input" type="checkbox" v-model="currentSettings.hideStreams" id="hideStreams">
<label class="form-check-label" for="hideStreams">
Hide unsupported streams
</label>
</div>
<br /><h6>Discovery</h6><hr>
<label for="basic-url">SDP delete timeout</label>
<div class="input-group">
<input class="form-control" type="number" id="basic-url" v-model="currentSettings.deleteTimeout" />
<div class="input-group-append">
<span class="input-group-text">seconds</span>
</div>
</div>
<small id="emailHelp" class="form-text text-muted">Streams will be removed, if no new announcement is received within timeout.</small>
<br />
<button class="btn btn-sm btn-primary" v-on:click="page='addSDP';">Add Stream via SDP</button>
</div>
</div>
</div>
<div id="detail" v-if="page == 'detail'">
<div class="header">
<h4 class="d-inline-block">{{ current.name }} <small>{{ current.description == '-' ? '' : current.description }}</small></h4>
<button class="d-inline-block btn btn-sm btn-secondary float-right" v-on:click="page='sdp';">Back</button>
<button class="d-inline-block btn btn-sm btn-success float-right" id="save" v-if="rawSDPDetails != current.raw" v-on:click="saveHandler(current)">Save</button>
<button class="btn btn-sm btn-success float-right" id="listen" v-on:click="audioHandler(current)" v-bind:class="{ 'btn-success': (audio != current.id), 'btn-danger': (audio == current.id) }" v-html="current.id == audio ? 'Stop' : 'Listen'" :disabled="!current.isSupported">Listen</button>
<select class="form-control form-control-sm d-inline-block float-right" id="listen" :disabled="audio == current.id || !current.isSupported" v-model="selected[current.id]">
<option v-for="channel in getChannels(current)" v-bind:value="channel.val">{{ channel.name }}</option>
</select>
</div>
<hr />
<div class="row">
<div class="col-7">
<div class="wrapper" v-if="current.isSupported">
<h6>Details</h6>
<div><b>Device address:</b> {{current.origin.address}}</div>
<div><b>Multicast address:</b> {{current.mcast}}:{{current.media[0].port}}</div>
<div><b>Samplerate:</b> {{current.samplerate}}Hz</div>
<div><b>Packettime:</b> {{current.media[0].ptime}}ms</div>
<div><b>Audio channels:</b> {{current.channels}}</div>
<div><b>Format:</b> {{current.codec}}</div>
<div><b>Bitrate:</b> {{ calculateBitrate(current) }}mb/s</div>
<div v-if="current.media[0].tsRefClocks && current.media[0].tsRefClocks[0].clksrcExt && current.media[0].tsRefClocks[0].clksrc == 'ptp'"><b>PTP clocksource:</b> {{ getPTPClocksrc(current) }}</div>
<div v-if="current.media[0].tsRefClocks && current.media[0].tsRefClocks[0].clksrcExt && current.media[0].tsRefClocks[0].clksrc == 'ptp'"><b>PTP domain:</b> {{ getPTPDomain(current) }}</div>
<div v-if="current.dante || current.manual || current.announce">
<b>Tags:</b>
<span v-if="current.dante" class="badge badge-secondary" title="Dante device">Dante</span>
<span v-if="current.manual" class="badge badge-secondary" title="Manually added">Manual</span>
<span v-if="current.announce" class="badge badge-secondary" title="Stream is being announced on the network">SAP</span>
</div>
</div>
<div class="wrapper" v-if="!current.isSupported">
<h6>Stream not supported.</h6>
Reason: {{ current.unsupportedReason }}.
</div>
</div>
<div class="col-5">
<div class="form-group">
<h6 for="sdpraw">Raw SDP</h6>
<textarea class="form-control" id="sdpraw" rows="23" :readonly="!current.manual" v-model="rawSDPDetails"></textarea>
</div>
</div>
</div>
</div>
<div id="addSDP" v-if="page == 'addSDP'">
<div class="header">
<h4 class="d-inline-block">Add Stream manually</h4>
<button class="d-inline-block btn btn-sm btn-secondary float-right" v-on:click="page='settings'; rawSDP='';">Cancel</button>
<button class="d-inline-block btn btn-sm btn-success float-right" id="save" v-on:click="addSDPHandler()">Add</button>
</div>
<hr />
<span>Paste SDP data below</span>
<textarea class="form-control" rows="20" v-model="rawSDP" placeholder="SDP data"></textarea>
<div class="form-check">
<input class="form-check-input" type="checkbox" v-model="announceRawSDP" id="sapAnnounce">
<label class="form-check-label" for="sapAnnounce">
Announce stream on network via Session Announcement Protocol
</label>
</div>
</div>
</div>
<script src="js/jquery.js"></script>
<script src="js/bootstrap/bootstrap.min.js"></script>
<script type="text/javascript" src="js/app.js"></script>
</body>
</html>