@clockworkdog/cogs-client 1.4.1 → 1.4.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/dist/CogsConnection.js +1 -1
- package/dist/RtspStreamer.d.ts +1 -0
- package/dist/RtspStreamer.js +9 -0
- package/dist/browser/index.js +23 -14
- package/package.json +2 -2
package/dist/CogsConnection.js
CHANGED
|
@@ -175,7 +175,7 @@ function websocketParametersFromUrl(url) {
|
|
|
175
175
|
const localClientId = pathParams.get('local_id');
|
|
176
176
|
const isSimulator = pathParams.get('simulator') === 'true';
|
|
177
177
|
const display = (_a = pathParams.get('display')) !== null && _a !== void 0 ? _a : '';
|
|
178
|
-
const pluginId = parsedUrl.pathname.startsWith('/plugin/') ? parsedUrl.pathname.split('/')[2] : undefined;
|
|
178
|
+
const pluginId = parsedUrl.pathname.startsWith('/plugin/') ? decodeURIComponent(parsedUrl.pathname.split('/')[2]) : undefined;
|
|
179
179
|
if (localClientId) {
|
|
180
180
|
const type = (_b = pathParams.get('t')) !== null && _b !== void 0 ? _b : '';
|
|
181
181
|
pathParams.delete('local_id');
|
package/dist/RtspStreamer.d.ts
CHANGED
package/dist/RtspStreamer.js
CHANGED
|
@@ -2,6 +2,9 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
const media_stream_library_browser_1 = require("@clockworkdog/media-stream-library-browser");
|
|
4
4
|
const urls_1 = require("./helpers/urls");
|
|
5
|
+
// Use a faster-than-realtime playback rate by default
|
|
6
|
+
// so that it keeps up with a realtime stream in case of video buffering
|
|
7
|
+
const DEFAULT_VIDEO_PLAYBACK_RATE = 1.1;
|
|
5
8
|
/**
|
|
6
9
|
* Manages a websocket connection to the COGS TCP relay which can be used to send RTSP video
|
|
7
10
|
* feeds to the web.
|
|
@@ -15,6 +18,7 @@ class RtspStreamer {
|
|
|
15
18
|
* @returns The playing HTML5 video pipeline.
|
|
16
19
|
*/
|
|
17
20
|
play(params) {
|
|
21
|
+
var _a;
|
|
18
22
|
const { uri, videoElement } = params;
|
|
19
23
|
const pipeline = new media_stream_library_browser_1.Html5VideoPipeline({
|
|
20
24
|
ws: { uri: this._websocketUri },
|
|
@@ -31,6 +35,11 @@ class RtspStreamer {
|
|
|
31
35
|
pipeline.ready.then(() => {
|
|
32
36
|
pipeline.rtsp.play();
|
|
33
37
|
});
|
|
38
|
+
videoElement.playbackRate = (_a = params.playbackRate) !== null && _a !== void 0 ? _a : DEFAULT_VIDEO_PLAYBACK_RATE;
|
|
39
|
+
videoElement.addEventListener('play', () => {
|
|
40
|
+
var _a;
|
|
41
|
+
videoElement.playbackRate = (_a = params.playbackRate) !== null && _a !== void 0 ? _a : DEFAULT_VIDEO_PLAYBACK_RATE;
|
|
42
|
+
});
|
|
34
43
|
return pipeline;
|
|
35
44
|
}
|
|
36
45
|
}
|