iobroker.agent-dvr 0.2.0 → 0.2.2
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/README.de.md +10 -0
- package/README.md +10 -14
- package/admin/assets/{index-ulvdM37k.js → index-DFh6AKdK.js} +1 -1
- package/admin/i18n/de.json +8 -2
- package/admin/i18n/en.json +8 -2
- package/admin/i18n/es.json +8 -2
- package/admin/i18n/fr.json +8 -2
- package/admin/i18n/it.json +8 -2
- package/admin/i18n/nl.json +8 -2
- package/admin/i18n/pl.json +8 -2
- package/admin/i18n/pt.json +8 -2
- package/admin/i18n/ru.json +8 -2
- package/admin/i18n/uk.json +8 -2
- package/admin/i18n/zh-cn.json +8 -2
- package/admin/index_m.html +1 -1
- package/build/main.js +11 -8
- package/build/main.js.map +2 -2
- package/io-package.json +27 -27
- package/package.json +1 -1
package/admin/index_m.html
CHANGED
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
};
|
|
19
19
|
document.head.appendChild(script);
|
|
20
20
|
</script>
|
|
21
|
-
<script type="module" crossorigin src="./assets/index-
|
|
21
|
+
<script type="module" crossorigin src="./assets/index-DFh6AKdK.js"></script>
|
|
22
22
|
</head>
|
|
23
23
|
<body>
|
|
24
24
|
<noscript>You need to enable JavaScript to run this app.</noscript>
|
package/build/main.js
CHANGED
|
@@ -386,20 +386,20 @@ class AgentDvr extends utils.Adapter {
|
|
|
386
386
|
rows.push({ source: "go2rtc", name: s });
|
|
387
387
|
}
|
|
388
388
|
if (!rows.length) {
|
|
389
|
-
rows.push({ source: "\u2014", name: "
|
|
389
|
+
rows.push({ source: "\u2014", name: "No sources found (adapter has not polled yet)" });
|
|
390
390
|
}
|
|
391
391
|
return { result: rows };
|
|
392
392
|
}
|
|
393
393
|
fetchGo2rtcStreams(overrideUrl) {
|
|
394
394
|
const url = (overrideUrl || this.config.go2rtcUrl || "").replace(/^https:\/\//i, "http://");
|
|
395
395
|
if (!url) {
|
|
396
|
-
return Promise.resolve({ streams: [], error: "go2rtcUrl
|
|
396
|
+
return Promise.resolve({ streams: [], error: "go2rtcUrl not configured" });
|
|
397
397
|
}
|
|
398
398
|
let target;
|
|
399
399
|
try {
|
|
400
400
|
target = new URL("/api/streams", url);
|
|
401
401
|
} catch {
|
|
402
|
-
return Promise.resolve({ streams: [], error: `
|
|
402
|
+
return Promise.resolve({ streams: [], error: `Invalid URL: ${url}` });
|
|
403
403
|
}
|
|
404
404
|
let httpReq;
|
|
405
405
|
const fetch = new Promise((resolve) => {
|
|
@@ -415,20 +415,23 @@ class AgentDvr extends utils.Adapter {
|
|
|
415
415
|
const streams = Object.keys(parsed || {});
|
|
416
416
|
resolve({
|
|
417
417
|
streams,
|
|
418
|
-
error: streams.length === 0 ? "go2rtc
|
|
418
|
+
error: streams.length === 0 ? "go2rtc reachable but no streams configured" : void 0
|
|
419
419
|
});
|
|
420
420
|
} catch {
|
|
421
|
-
resolve({
|
|
421
|
+
resolve({
|
|
422
|
+
streams: [],
|
|
423
|
+
error: `Invalid JSON response from go2rtc (HTTP ${res.statusCode})`
|
|
424
|
+
});
|
|
422
425
|
}
|
|
423
426
|
});
|
|
424
|
-
res.on("error", (e) => resolve({ streams: [], error: `Stream
|
|
427
|
+
res.on("error", (e) => resolve({ streams: [], error: `Stream error: ${e.message}` }));
|
|
425
428
|
});
|
|
426
|
-
httpReq.on("error", (e) => resolve({ streams: [], error: `
|
|
429
|
+
httpReq.on("error", (e) => resolve({ streams: [], error: `Connection error: ${e.message}` }));
|
|
427
430
|
});
|
|
428
431
|
const timeout = new Promise(
|
|
429
432
|
(resolve) => this.setTimeout(() => {
|
|
430
433
|
httpReq == null ? void 0 : httpReq.destroy();
|
|
431
|
-
resolve({ streams: [], error: `Timeout
|
|
434
|
+
resolve({ streams: [], error: `Timeout fetching ${target.toString()}` });
|
|
432
435
|
}, 3e3)
|
|
433
436
|
);
|
|
434
437
|
return Promise.race([fetch, timeout]);
|