mirror of
https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs.git
synced 2024-11-27 05:51:01 +00:00
stat-frontend: Allow passing a URL to the stat producer
This commit is contained in:
parent
da0a934307
commit
d15c32e3e6
2 changed files with 12 additions and 1 deletions
|
@ -14,3 +14,7 @@ Then navigate to `http://localhost:3000/`. Once consumers are connected
|
||||||
to the webrtc-sink-stats-server, they should be listed on the page, clicking
|
to the webrtc-sink-stats-server, they should be listed on the page, clicking
|
||||||
on any consumer will show a modal with plots for some of the most interesting
|
on any consumer will show a modal with plots for some of the most interesting
|
||||||
statistics.
|
statistics.
|
||||||
|
|
||||||
|
The stat server can also be specified through the `remote-url` search parameter,
|
||||||
|
for example you can access a distant stat server with
|
||||||
|
`http://localhost:3000?remote-uri=my-remoye.com:72522`.
|
||||||
|
|
|
@ -80,7 +80,14 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
const fetchStats = () => {
|
const fetchStats = () => {
|
||||||
ws = new WebSocket("ws://127.0.0.1:8484");
|
const urlParams = new URLSearchParams(window.location.search);
|
||||||
|
var remote_server = urlParams.get('remote-url');
|
||||||
|
if (!remote_server)
|
||||||
|
remote_server = "127.0.0.1:8484"
|
||||||
|
const ws_url = `ws://${remote_server}`;
|
||||||
|
|
||||||
|
console.info(`Logging to ${ws_url}`);
|
||||||
|
ws = new WebSocket(ws_url);
|
||||||
|
|
||||||
ws.onerror = () => {
|
ws.onerror = () => {
|
||||||
websocketStatus = WebSocketStatus.Error
|
websocketStatus = WebSocketStatus.Error
|
||||||
|
|
Loading…
Reference in a new issue