vue-streaming 2.0.1 → 2.0.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.
Files changed (28) hide show
  1. package/dist/WebSocketStream.vue_vue_type_script_setup_true_lang-D5IiGqMS.cjs +2 -0
  2. package/dist/WebSocketStream.vue_vue_type_script_setup_true_lang-D5IiGqMS.cjs.map +1 -0
  3. package/dist/WebSocketStream.vue_vue_type_script_setup_true_lang-D5yjtuTd.js +1240 -0
  4. package/dist/WebSocketStream.vue_vue_type_script_setup_true_lang-D5yjtuTd.js.map +1 -0
  5. package/dist/components/index.cjs +1 -1
  6. package/dist/components/index.js +3 -2
  7. package/dist/composables/index.cjs +1 -1
  8. package/dist/composables/index.js +1 -1
  9. package/dist/index.cjs +1 -1
  10. package/dist/index.js +53 -51
  11. package/dist/useWebSocket--HDylHpA.cjs +4 -0
  12. package/dist/useWebSocket--HDylHpA.cjs.map +1 -0
  13. package/dist/useWebSocket-C3JPFBmy.js +1328 -0
  14. package/dist/useWebSocket-C3JPFBmy.js.map +1 -0
  15. package/dist/utils/index.cjs +1 -1
  16. package/dist/utils/index.cjs.map +1 -1
  17. package/dist/utils/index.js +48 -38
  18. package/dist/utils/index.js.map +1 -1
  19. package/dist/vue-streaming.css +1 -1
  20. package/package.json +9 -2
  21. package/dist/WebSocketStream.vue_vue_type_script_setup_true_lang-BzBWoH8H.js +0 -1083
  22. package/dist/WebSocketStream.vue_vue_type_script_setup_true_lang-BzBWoH8H.js.map +0 -1
  23. package/dist/WebSocketStream.vue_vue_type_script_setup_true_lang-C7Kci1ME.cjs +0 -2
  24. package/dist/WebSocketStream.vue_vue_type_script_setup_true_lang-C7Kci1ME.cjs.map +0 -1
  25. package/dist/useWebSocket-8VThnC_J.cjs +0 -4
  26. package/dist/useWebSocket-8VThnC_J.cjs.map +0 -1
  27. package/dist/useWebSocket-D1Rqm0H7.js +0 -1278
  28. package/dist/useWebSocket-D1Rqm0H7.js.map +0 -1
@@ -1,1083 +0,0 @@
1
- import { defineComponent as T, ref as H, watch as L, computed as O, onMounted as U, createElementBlock as b, openBlock as w, createElementVNode as _, createCommentVNode as E, normalizeClass as G, unref as t, toDisplayString as x, Fragment as J, renderList as Q, onUnmounted as Z, normalizeStyle as ee, renderSlot as M, toRefs as I } from "vue";
2
- import { a as te, g as ne, u as oe, b as se, c as re, d as ae, f as ie, e as le, h as ce } from "./useWebSocket-D1Rqm0H7.js";
3
- const ue = { class: "hls-player" }, de = { class: "hls-player__video-container" }, pe = ["controls", "muted", "loop", "poster"], me = {
4
- key: 0,
5
- class: "hls-player__overlay"
6
- }, fe = {
7
- key: 1,
8
- class: "hls-player__overlay hls-player__overlay--error"
9
- }, ve = { class: "hls-player__error" }, _e = {
10
- key: 0,
11
- class: "hls-player__controls"
12
- }, ye = { class: "hls-player__quality" }, he = ["value"], ge = ["value"], be = { class: "hls-player__stats" }, we = { key: 0 }, Ce = /* @__PURE__ */ T({
13
- __name: "HLSPlayer",
14
- props: {
15
- src: {},
16
- autoPlay: { type: Boolean, default: !0 },
17
- controls: { type: Boolean, default: !0 },
18
- muted: { type: Boolean, default: !1 },
19
- loop: { type: Boolean, default: !1 },
20
- poster: {},
21
- lowLatency: { type: Boolean, default: !1 },
22
- startLevel: { default: -1 },
23
- videoClass: {}
24
- },
25
- emits: ["ready", "play", "pause", "ended", "error", "levelChange", "timeUpdate", "stateChange"],
26
- setup(C, { expose: R, emit: S }) {
27
- const e = C, o = S, v = H(null), y = {
28
- url: e.src,
29
- autoPlay: e.autoPlay,
30
- lowLatencyMode: e.lowLatency,
31
- startLevel: e.startLevel
32
- }, g = {
33
- onManifestLoaded: (k) => {
34
- o("ready");
35
- },
36
- onLevelSwitched: (k) => {
37
- o("levelChange", k);
38
- },
39
- onPlaybackStarted: () => {
40
- o("play");
41
- },
42
- onPlaybackEnded: () => {
43
- o("ended");
44
- },
45
- onError: (k) => {
46
- o("error", k);
47
- }
48
- }, {
49
- state: i,
50
- isPlaying: d,
51
- isBuffering: f,
52
- levels: r,
53
- currentLevel: l,
54
- autoLevelEnabled: c,
55
- currentTime: p,
56
- duration: u,
57
- buffered: n,
58
- volume: s,
59
- muted: a,
60
- stats: B,
61
- error: m,
62
- isSupported: h,
63
- attach: A,
64
- play: j,
65
- pause: P,
66
- stop: $,
67
- seek: D,
68
- setLevel: q,
69
- setVolume: K,
70
- toggleMute: X,
71
- destroy: Y
72
- } = te(y, g);
73
- L(i, (k) => {
74
- o("stateChange", k);
75
- }), L(p, (k) => {
76
- o("timeUpdate", k);
77
- });
78
- function N(k) {
79
- if (!isFinite(k)) return "0:00";
80
- const F = Math.floor(k / 60), z = Math.floor(k % 60);
81
- return `${F}:${z.toString().padStart(2, "0")}`;
82
- }
83
- const V = O(() => l.value < 0 || l.value >= r.value.length ? null : r.value[l.value]);
84
- return U(async () => {
85
- if (v.value)
86
- try {
87
- await A(v.value);
88
- } catch (k) {
89
- console.error("[HLSPlayer] Failed to attach:", k);
90
- }
91
- }), L(
92
- () => e.src,
93
- async (k) => {
94
- v.value && k && (Y(), y.url = k, await A(v.value));
95
- }
96
- ), R({
97
- play: j,
98
- pause: P,
99
- stop: $,
100
- seek: D,
101
- setLevel: q,
102
- setVolume: K,
103
- toggleMute: X,
104
- state: i,
105
- levels: r,
106
- currentLevel: l,
107
- stats: B
108
- }), (k, F) => (w(), b("div", ue, [
109
- _("div", de, [
110
- _("video", {
111
- ref_key: "videoRef",
112
- ref: v,
113
- class: G(["hls-player__video", k.videoClass]),
114
- controls: k.controls,
115
- muted: k.muted,
116
- loop: k.loop,
117
- poster: k.poster,
118
- playsinline: ""
119
- }, null, 10, pe),
120
- t(f) ? (w(), b("div", me, [...F[1] || (F[1] = [
121
- _("div", { class: "hls-player__spinner" }, null, -1)
122
- ])])) : E("", !0),
123
- t(m) ? (w(), b("div", fe, [
124
- _("div", ve, [
125
- _("span", null, "⚠️ " + x(t(m).message), 1)
126
- ])
127
- ])) : E("", !0)
128
- ]),
129
- t(r).length > 1 ? (w(), b("div", _e, [
130
- _("div", ye, [
131
- F[3] || (F[3] = _("label", null, "Quality:", -1)),
132
- _("select", {
133
- value: t(l),
134
- onChange: F[0] || (F[0] = (z) => t(q)(Number(z.target.value)))
135
- }, [
136
- F[2] || (F[2] = _("option", { value: -1 }, "Auto", -1)),
137
- (w(!0), b(J, null, Q(t(r), (z) => (w(), b("option", {
138
- key: z.index,
139
- value: z.index
140
- }, x(z.height) + "p (" + x(Math.round(z.bitrate / 1e3)) + "kbps) ", 9, ge))), 128))
141
- ], 40, he)
142
- ]),
143
- _("div", be, [
144
- V.value ? (w(), b("span", we, x(V.value.width) + "x" + x(V.value.height), 1)) : E("", !0),
145
- _("span", null, x(Math.round(t(B).bandwidth / 1e6 * 10) / 10) + " Mbps", 1),
146
- _("span", null, x(N(t(p))) + " / " + x(N(t(u))), 1)
147
- ])
148
- ])) : E("", !0)
149
- ]));
150
- }
151
- }), W = (C, R) => {
152
- const S = C.__vccOpts || C;
153
- for (const [e, o] of R)
154
- S[e] = o;
155
- return S;
156
- }, nt = /* @__PURE__ */ W(Ce, [["__scopeId", "data-v-b04c54da"]]), Se = { class: "pointcloud-viewer" }, Re = {
157
- key: 0,
158
- class: "pointcloud-viewer__overlay"
159
- }, ke = {
160
- key: 1,
161
- class: "pointcloud-viewer__overlay pointcloud-viewer__overlay--error"
162
- }, xe = { class: "pointcloud-viewer__stats" }, Pe = { key: 0 }, Be = /* @__PURE__ */ T({
163
- __name: "PointCloudViewer",
164
- props: {
165
- points: {},
166
- pointSize: { default: 0.02 },
167
- pointColor: { default: 65280 },
168
- usePointColors: { type: Boolean, default: !0 },
169
- cameraPosition: { default: () => ({ x: 5, y: 5, z: 5 }) },
170
- autoRotate: { type: Boolean, default: !1 },
171
- autoRotateSpeed: { default: 1 },
172
- backgroundColor: { default: 1973790 },
173
- showAxes: { type: Boolean, default: !1 },
174
- showGrid: { type: Boolean, default: !0 },
175
- bounds: {}
176
- },
177
- emits: ["ready", "click", "error"],
178
- setup(C, { expose: R, emit: S }) {
179
- const e = C, o = S, v = H(null), y = H(!0), g = H(null);
180
- let i = null, d = null, f = null, r = null, l = null, c = null, p = null;
181
- async function u() {
182
- if (v.value)
183
- try {
184
- i = await import("three");
185
- const { OrbitControls: m } = await import("three/examples/jsm/controls/OrbitControls.js"), h = v.value, A = h.clientWidth, j = h.clientHeight;
186
- if (d = new i.Scene(), d.background = new i.Color(e.backgroundColor), f = new i.PerspectiveCamera(75, A / j, 0.1, 1e3), f.position.set(
187
- e.cameraPosition.x,
188
- e.cameraPosition.y,
189
- e.cameraPosition.z
190
- ), r = new i.WebGLRenderer({ antialias: !0 }), r.setSize(A, j), r.setPixelRatio(window.devicePixelRatio), h.appendChild(r.domElement), l = new m(f, r.domElement), l.autoRotate = e.autoRotate, l.autoRotateSpeed = e.autoRotateSpeed, e.showGrid) {
191
- const $ = new i.GridHelper(10, 10, 4473924, 3355443);
192
- d.add($);
193
- }
194
- if (e.showAxes) {
195
- const $ = new i.AxesHelper(5);
196
- d.add($);
197
- }
198
- new ResizeObserver(() => {
199
- if (!f || !r || !v.value) return;
200
- const $ = v.value.clientWidth, D = v.value.clientHeight;
201
- f.aspect = $ / D, f.updateProjectionMatrix(), r.setSize($, D);
202
- }).observe(h), s(), y.value = !1, o("ready");
203
- } catch (m) {
204
- const h = m instanceof Error ? m : new Error(String(m));
205
- g.value = h, o("error", h), console.error("[PointCloudViewer] Failed to initialize:", m);
206
- }
207
- }
208
- function n() {
209
- if (!i || !d || (c && (d.remove(c), c.geometry.dispose(), c.material.dispose(), c = null), e.points.length === 0)) return;
210
- const m = new i.BufferGeometry(), h = new Float32Array(e.points.length * 3), A = new Float32Array(e.points.length * 3);
211
- for (let P = 0; P < e.points.length; P++) {
212
- const $ = e.points[P];
213
- if (h[P * 3] = $.x, h[P * 3 + 1] = $.y, h[P * 3 + 2] = $.z, e.usePointColors && $.r !== void 0)
214
- A[P * 3] = $.r, A[P * 3 + 1] = $.g ?? 0, A[P * 3 + 2] = $.b ?? 0;
215
- else {
216
- const D = new i.Color(e.pointColor);
217
- A[P * 3] = D.r, A[P * 3 + 1] = D.g, A[P * 3 + 2] = D.b;
218
- }
219
- }
220
- m.setAttribute("position", new i.BufferAttribute(h, 3)), m.setAttribute("color", new i.BufferAttribute(A, 3));
221
- const j = new i.PointsMaterial({
222
- size: e.pointSize,
223
- vertexColors: !0,
224
- sizeAttenuation: !0
225
- });
226
- if (c = new i.Points(m, j), d.add(c), e.bounds && f) {
227
- const P = {
228
- x: (e.bounds.min.x + e.bounds.max.x) / 2,
229
- y: (e.bounds.min.y + e.bounds.max.y) / 2,
230
- z: (e.bounds.min.z + e.bounds.max.z) / 2
231
- }, $ = Math.max(
232
- e.bounds.max.x - e.bounds.min.x,
233
- e.bounds.max.y - e.bounds.min.y,
234
- e.bounds.max.z - e.bounds.min.z
235
- );
236
- f.position.set(
237
- P.x + $ * 1.5,
238
- P.y + $ * 1.5,
239
- P.z + $ * 1.5
240
- ), f.lookAt(P.x, P.y, P.z);
241
- }
242
- }
243
- function s() {
244
- p = requestAnimationFrame(s), l && l.update(), r && d && f && r.render(d, f);
245
- }
246
- function a() {
247
- p && (cancelAnimationFrame(p), p = null), c && d && (d.remove(c), c.geometry.dispose(), c.material.dispose()), l && l.dispose(), r && (r.dispose(), v.value && r.domElement.parentNode && v.value.removeChild(r.domElement)), d = null, f = null, r = null, l = null, c = null;
248
- }
249
- L(() => e.points, n, { deep: !0 }), L(
250
- [() => e.pointSize, () => e.pointColor, () => e.usePointColors],
251
- n
252
- ), L(
253
- () => e.autoRotate,
254
- (m) => {
255
- l && (l.autoRotate = m);
256
- }
257
- ), L(
258
- () => e.autoRotateSpeed,
259
- (m) => {
260
- l && (l.autoRotateSpeed = m);
261
- }
262
- ), U(() => {
263
- u();
264
- }), Z(() => {
265
- a();
266
- });
267
- const B = O(() => ({
268
- pointCount: e.points.length,
269
- hasColors: e.points.length > 0 && e.points[0].r !== void 0
270
- }));
271
- return R({
272
- updatePointCloud: n,
273
- stats: B
274
- }), (m, h) => (w(), b("div", Se, [
275
- _("div", {
276
- ref_key: "containerRef",
277
- ref: v,
278
- class: "pointcloud-viewer__canvas"
279
- }, null, 512),
280
- y.value ? (w(), b("div", Re, [...h[0] || (h[0] = [
281
- _("div", { class: "pointcloud-viewer__spinner" }, null, -1),
282
- _("span", null, "Loading viewer...", -1)
283
- ])])) : E("", !0),
284
- g.value ? (w(), b("div", ke, [
285
- _("span", null, "⚠️ " + x(g.value.message), 1),
286
- h[1] || (h[1] = _("small", null, "Make sure 'three' package is installed", -1))
287
- ])) : E("", !0),
288
- _("div", xe, [
289
- _("span", null, "Points: " + x(B.value.pointCount.toLocaleString()), 1),
290
- B.value.hasColors ? (w(), b("span", Pe, "🎨 Colored")) : E("", !0)
291
- ])
292
- ]));
293
- }
294
- }), ot = /* @__PURE__ */ W(Be, [["__scopeId", "data-v-7f487135"]]), $e = { class: "stream-viewer" }, Ae = { class: "stream-viewer__header" }, Ee = { class: "stream-viewer__stats" }, Le = {
295
- key: 0,
296
- class: "stream-viewer__errors"
297
- }, Te = { class: "stream-viewer__actions" }, Fe = {
298
- key: 0,
299
- class: "stream-viewer__timestamp"
300
- }, De = { class: "stream-viewer__data" }, ze = {
301
- key: 0,
302
- class: "stream-viewer__empty"
303
- }, Me = /* @__PURE__ */ T({
304
- __name: "StreamViewer",
305
- props: {
306
- data: {},
307
- type: { default: "auto" },
308
- maxLines: { default: 100 },
309
- autoScroll: { type: Boolean, default: !0 },
310
- showTimestamps: { type: Boolean, default: !0 },
311
- paused: { type: Boolean, default: !1 },
312
- formatter: {}
313
- },
314
- emits: ["clear", "pause"],
315
- setup(C, { expose: R, emit: S }) {
316
- const e = C, o = S, v = H([]), y = H(null);
317
- let g = 0;
318
- function i(n) {
319
- if (e.formatter)
320
- return e.formatter(n);
321
- if (n == null)
322
- return String(n);
323
- switch (e.type === "auto" ? d(n) : e.type) {
324
- case "json":
325
- try {
326
- return JSON.stringify(n, null, 2);
327
- } catch {
328
- return String(n);
329
- }
330
- case "binary":
331
- return n instanceof ArrayBuffer ? `Binary: ${new Uint8Array(n).length} bytes` : String(n);
332
- default:
333
- return String(n);
334
- }
335
- }
336
- function d(n) {
337
- return n instanceof ArrayBuffer || n instanceof Uint8Array ? "binary" : typeof n == "object" ? "json" : "text";
338
- }
339
- function f(n, s = "data") {
340
- if (e.paused) return;
341
- const a = {
342
- id: g++,
343
- timestamp: /* @__PURE__ */ new Date(),
344
- data: i(n),
345
- type: s
346
- };
347
- v.value = [...v.value, a].slice(-e.maxLines), e.autoScroll && r();
348
- }
349
- function r() {
350
- requestAnimationFrame(() => {
351
- y.value && (y.value.scrollTop = y.value.scrollHeight);
352
- });
353
- }
354
- function l() {
355
- v.value = [], o("clear");
356
- }
357
- function c() {
358
- o("pause", !e.paused);
359
- }
360
- function p(n) {
361
- return n.toLocaleTimeString("en-US", {
362
- hour12: !1,
363
- hour: "2-digit",
364
- minute: "2-digit",
365
- second: "2-digit",
366
- fractionalSecondDigits: 3
367
- });
368
- }
369
- L(
370
- () => e.data,
371
- (n) => {
372
- n !== void 0 && f(n);
373
- }
374
- );
375
- const u = O(() => ({
376
- total: v.value.length,
377
- errors: v.value.filter((n) => n.type === "error").length
378
- }));
379
- return R({
380
- addLog: f,
381
- clear: l,
382
- logs: v,
383
- stats: u
384
- }), (n, s) => (w(), b("div", $e, [
385
- _("div", Ae, [
386
- _("div", Ee, [
387
- _("span", null, "Lines: " + x(u.value.total), 1),
388
- u.value.errors > 0 ? (w(), b("span", Le, " Errors: " + x(u.value.errors), 1)) : E("", !0)
389
- ]),
390
- _("div", Te, [
391
- _("button", {
392
- onClick: c,
393
- class: G(["stream-viewer__btn", { "stream-viewer__btn--active": n.paused }])
394
- }, x(n.paused ? "▶ Resume" : "⏸ Pause"), 3),
395
- _("button", {
396
- onClick: l,
397
- class: "stream-viewer__btn"
398
- }, "🗑 Clear")
399
- ])
400
- ]),
401
- _("div", {
402
- ref_key: "containerRef",
403
- ref: y,
404
- class: "stream-viewer__content"
405
- }, [
406
- (w(!0), b(J, null, Q(v.value, (a) => (w(), b("div", {
407
- key: a.id,
408
- class: G(["stream-viewer__entry", `stream-viewer__entry--${a.type}`])
409
- }, [
410
- n.showTimestamps ? (w(), b("span", Fe, x(p(a.timestamp)), 1)) : E("", !0),
411
- _("pre", De, x(a.data), 1)
412
- ], 2))), 128)),
413
- v.value.length === 0 ? (w(), b("div", ze, " Waiting for data... ")) : E("", !0)
414
- ], 512)
415
- ]));
416
- }
417
- }), st = /* @__PURE__ */ W(Me, [["__scopeId", "data-v-06dc8d20"]]), He = { class: "webrtc-viewer" }, Ie = {
418
- key: 0,
419
- class: "webrtc-viewer__header"
420
- }, je = { class: "webrtc-viewer__status" }, Oe = { class: "webrtc-viewer__controls" }, Ue = { class: "webrtc-viewer__content" }, We = { class: "webrtc-viewer__default" }, Ve = {
421
- key: 0,
422
- class: "webrtc-viewer__placeholder"
423
- }, Ge = {
424
- key: 1,
425
- class: "webrtc-viewer__loading"
426
- }, qe = {
427
- key: 2,
428
- class: "webrtc-viewer__error"
429
- }, Ne = {
430
- key: 3,
431
- class: "webrtc-viewer__info"
432
- }, Je = { key: 0 }, Qe = { key: 1 }, Ke = {
433
- key: 1,
434
- class: "webrtc-viewer__footer"
435
- }, Xe = { key: 0 }, Ye = { key: 1 }, Ze = /* @__PURE__ */ T({
436
- __name: "WebRTCViewer",
437
- props: {
438
- signalingUrl: {},
439
- iceServers: { default: () => [{ urls: "stun:stun.l.google.com:19302" }] },
440
- enablePointCloud: { type: Boolean, default: !0 },
441
- enableDetections: { type: Boolean, default: !0 },
442
- autoConnect: { type: Boolean, default: !0 },
443
- autoReconnect: { type: Boolean, default: !0 },
444
- maxReconnectAttempts: { default: 5 },
445
- showStatus: { type: Boolean, default: !0 },
446
- showStats: { type: Boolean, default: !0 }
447
- },
448
- emits: ["connected", "disconnected", "error", "pointcloud", "detections", "boundingboxes", "status"],
449
- setup(C, { expose: R, emit: S }) {
450
- const e = C, o = S, v = H("Idle"), y = {
451
- signalingUrl: e.signalingUrl,
452
- iceServers: e.iceServers,
453
- enablePointCloud: e.enablePointCloud,
454
- enableDetections: e.enableDetections,
455
- autoReconnect: e.autoReconnect,
456
- maxReconnectAttempts: e.maxReconnectAttempts
457
- }, g = {
458
- onStatus: (m) => {
459
- v.value = m, o("status", m);
460
- },
461
- onConnectionState: (m) => {
462
- m === "connected" ? o("connected") : (m === "disconnected" || m === "closed" || m === "failed") && o("disconnected");
463
- },
464
- onPointCloudFrame: (m) => {
465
- o("pointcloud", m);
466
- },
467
- onDetectionFrame: (m) => {
468
- o("detections", m);
469
- },
470
- onBoundingBoxData: (m) => {
471
- o("boundingboxes", m);
472
- },
473
- onError: (m) => {
474
- o("error", m);
475
- }
476
- }, {
477
- isRunning: i,
478
- connectionState: d,
479
- dataChannels: f,
480
- lastPointCloudFrame: r,
481
- lastDetectionFrame: l,
482
- lastBoundingBoxes: c,
483
- error: p,
484
- start: u,
485
- stop: n,
486
- sendControl: s
487
- } = ne(y, g), a = O(() => {
488
- var m, h;
489
- return {
490
- channels: f.value.size,
491
- pointCount: ((m = r.value) == null ? void 0 : m.points.length) ?? 0,
492
- detectionCount: ((h = l.value) == null ? void 0 : h.detections.length) ?? 0,
493
- bboxCount: c.value.length
494
- };
495
- }), B = O(() => {
496
- switch (d.value) {
497
- case "connected":
498
- return "#4caf50";
499
- case "connecting":
500
- return "#ff9800";
501
- case "reconnecting":
502
- return "#ff9800";
503
- case "error":
504
- return "#f44336";
505
- default:
506
- return "#9e9e9e";
507
- }
508
- });
509
- return U(() => {
510
- e.autoConnect && u();
511
- }), L(
512
- () => e.signalingUrl,
513
- () => {
514
- i.value && (n(), y.signalingUrl = e.signalingUrl, u());
515
- }
516
- ), R({
517
- isRunning: i,
518
- connectionState: d,
519
- start: u,
520
- stop: n,
521
- sendControl: s,
522
- lastPointCloudFrame: r,
523
- lastDetectionFrame: l,
524
- lastBoundingBoxes: c,
525
- stats: a
526
- }), (m, h) => (w(), b("div", He, [
527
- m.showStatus ? (w(), b("div", Ie, [
528
- _("div", je, [
529
- _("span", {
530
- class: "webrtc-viewer__indicator",
531
- style: ee({ backgroundColor: B.value })
532
- }, null, 4),
533
- _("span", null, x(t(d)), 1)
534
- ]),
535
- _("div", Oe, [
536
- t(i) ? (w(), b("button", {
537
- key: 1,
538
- onClick: h[1] || (h[1] = //@ts-ignore
539
- (...A) => t(n) && t(n)(...A)),
540
- class: "webrtc-viewer__btn webrtc-viewer__btn--disconnect"
541
- }, " ⏹ Disconnect ")) : (w(), b("button", {
542
- key: 0,
543
- onClick: h[0] || (h[0] = //@ts-ignore
544
- (...A) => t(u) && t(u)(...A)),
545
- class: "webrtc-viewer__btn webrtc-viewer__btn--connect"
546
- }, " ▶ Connect "))
547
- ])
548
- ])) : E("", !0),
549
- _("div", Ue, [
550
- M(m.$slots, "default", {
551
- isRunning: t(i),
552
- connectionState: t(d),
553
- pointCloudFrame: t(r),
554
- detectionFrame: t(l),
555
- boundingBoxes: t(c),
556
- error: t(p),
557
- start: t(u),
558
- stop: t(n),
559
- sendControl: t(s)
560
- }, () => [
561
- _("div", We, [
562
- t(i) ? t(d) === "connecting" ? (w(), b("div", Ge, [
563
- h[3] || (h[3] = _("div", { class: "webrtc-viewer__spinner" }, null, -1)),
564
- _("span", null, x(v.value), 1)
565
- ])) : t(p) ? (w(), b("div", qe, [
566
- _("span", null, "⚠️ " + x(t(p).message), 1)
567
- ])) : (w(), b("div", Ne, [
568
- h[4] || (h[4] = _("p", null, "WebRTC Connected", -1)),
569
- a.value.pointCount > 0 ? (w(), b("p", Je, " Points: " + x(a.value.pointCount.toLocaleString()), 1)) : E("", !0),
570
- a.value.bboxCount > 0 ? (w(), b("p", Qe, " Bounding Boxes: " + x(a.value.bboxCount), 1)) : E("", !0)
571
- ])) : (w(), b("div", Ve, [...h[2] || (h[2] = [
572
- _("span", null, "Click Connect to start WebRTC stream", -1)
573
- ])]))
574
- ])
575
- ], !0)
576
- ]),
577
- m.showStats && t(i) ? (w(), b("div", Ke, [
578
- _("span", null, "Channels: " + x(a.value.channels), 1),
579
- e.enablePointCloud ? (w(), b("span", Xe, " Points: " + x(a.value.pointCount.toLocaleString()), 1)) : E("", !0),
580
- e.enableDetections ? (w(), b("span", Ye, " Detections: " + x(a.value.detectionCount), 1)) : E("", !0)
581
- ])) : E("", !0)
582
- ]));
583
- }
584
- }), rt = /* @__PURE__ */ W(Ze, [["__scopeId", "data-v-3f83a728"]]), at = /* @__PURE__ */ T({
585
- __name: "DataStreamView",
586
- props: {
587
- config: { default: () => ({}) },
588
- autoStart: { type: Boolean, default: !0 }
589
- },
590
- emits: ["data", "batch", "error"],
591
- setup(C, { expose: R, emit: S }) {
592
- const e = C, o = S, { config: v } = I(e), {
593
- data: y,
594
- buffer: g,
595
- bufferSize: i,
596
- isStreaming: d,
597
- itemsPerSecond: f,
598
- totalItems: r,
599
- error: l,
600
- start: c,
601
- stop: p,
602
- push: u,
603
- clear: n,
604
- getBuffer: s,
605
- subscribe: a
606
- } = oe(e.config, {
607
- onData: (B) => o("data", B),
608
- onBatch: (B) => o("batch", B),
609
- onError: (B) => o("error", B)
610
- });
611
- return U(() => {
612
- e.autoStart && c();
613
- }), L(
614
- v,
615
- () => {
616
- p(), c();
617
- },
618
- { deep: !0 }
619
- ), R({
620
- data: y,
621
- buffer: g,
622
- bufferSize: i,
623
- isStreaming: d,
624
- itemsPerSecond: f,
625
- totalItems: r,
626
- error: l,
627
- start: c,
628
- stop: p,
629
- push: u,
630
- clear: n,
631
- getBuffer: s,
632
- subscribe: a
633
- }), (B, m) => M(B.$slots, "default", {
634
- data: t(y),
635
- buffer: t(g),
636
- bufferSize: t(i),
637
- isStreaming: t(d),
638
- itemsPerSecond: t(f),
639
- totalItems: t(r),
640
- error: t(l),
641
- start: t(c),
642
- stop: t(p),
643
- push: t(u),
644
- clear: t(n)
645
- });
646
- }
647
- }), it = /* @__PURE__ */ T({
648
- __name: "HTTPStream",
649
- props: {
650
- url: {},
651
- method: { default: "GET" },
652
- headers: { default: () => ({}) },
653
- body: { default: void 0 },
654
- credentials: { default: "same-origin" },
655
- autoConnect: { type: Boolean, default: !0 },
656
- autoReconnect: { type: Boolean, default: !0 },
657
- maxReconnectAttempts: { default: 5 },
658
- reconnectDelay: { default: 1e3 },
659
- ndjson: { type: Boolean, default: !0 }
660
- },
661
- emits: ["open", "chunk", "complete", "error", "progress", "reconnecting", "reconnected", "reconnectFailed"],
662
- setup(C, { expose: R, emit: S }) {
663
- const e = C, o = S, { url: v } = I(e), {
664
- isConnected: y,
665
- isStreaming: g,
666
- connectionState: i,
667
- lastChunk: d,
668
- chunks: f,
669
- bytesReceived: r,
670
- error: l,
671
- reconnectAttempts: c,
672
- connect: p,
673
- disconnect: u,
674
- clearChunks: n
675
- } = se(
676
- {
677
- url: e.url,
678
- method: e.method,
679
- headers: e.headers,
680
- body: e.body,
681
- credentials: e.credentials,
682
- autoConnect: e.autoConnect,
683
- autoReconnect: e.autoReconnect,
684
- maxReconnectAttempts: e.maxReconnectAttempts,
685
- reconnectDelay: e.reconnectDelay,
686
- ndjson: e.ndjson
687
- },
688
- {
689
- onOpen: () => o("open"),
690
- onChunk: (s, a) => o("chunk", s, a),
691
- onComplete: () => o("complete"),
692
- onError: (s) => o("error", s),
693
- onProgress: (s) => o("progress", s),
694
- onReconnecting: (s, a) => o("reconnecting", s, a),
695
- onReconnected: () => o("reconnected"),
696
- onReconnectFailed: () => o("reconnectFailed")
697
- }
698
- );
699
- return L(v, () => {
700
- u(), p();
701
- }), R({
702
- isConnected: y,
703
- isStreaming: g,
704
- connectionState: i,
705
- lastChunk: d,
706
- chunks: f,
707
- bytesReceived: r,
708
- error: l,
709
- reconnectAttempts: c,
710
- connect: p,
711
- disconnect: u,
712
- clearChunks: n
713
- }), (s, a) => M(s.$slots, "default", {
714
- isConnected: t(y),
715
- isStreaming: t(g),
716
- connectionState: t(i),
717
- lastChunk: t(d),
718
- chunks: t(f),
719
- bytesReceived: t(r),
720
- error: t(l),
721
- reconnectAttempts: t(c),
722
- connect: t(p),
723
- disconnect: t(u),
724
- clearChunks: t(n)
725
- });
726
- }
727
- }), lt = /* @__PURE__ */ T({
728
- __name: "LaravelEchoStream",
729
- props: {
730
- config: {},
731
- channel: { default: void 0 },
732
- channelType: { default: "public" },
733
- events: { default: () => [] },
734
- autoSubscribe: { type: Boolean, default: !0 }
735
- },
736
- emits: ["connected", "event", "error", "subscribed", "unsubscribed", "here", "joining", "leaving"],
737
- setup(C, { expose: R, emit: S }) {
738
- const e = C, o = S, { channel: v } = I(e), {
739
- isConnected: y,
740
- channels: g,
741
- channel: i,
742
- privateChannel: d,
743
- presenceChannel: f,
744
- leave: r,
745
- leaveAll: l,
746
- connect: c
747
- } = re(e.config, {
748
- onConnected: (n) => o("connected", n),
749
- onError: (n) => o("error", n)
750
- });
751
- let p = null;
752
- function u() {
753
- if (e.channel) {
754
- if (e.channelType === "private")
755
- p = d(e.channel);
756
- else if (e.channelType === "presence") {
757
- const n = f(e.channel);
758
- p = n, n.here((s) => o("here", s)), n.joining((s) => o("joining", s)), n.leaving((s) => o("leaving", s));
759
- } else
760
- p = i(e.channel);
761
- e.events.forEach((n) => {
762
- p == null || p.listen(n, (s) => {
763
- o("event", n, s);
764
- });
765
- }), o("subscribed", e.channel);
766
- }
767
- }
768
- return U(async () => {
769
- await c(), e.autoSubscribe && e.channel && u();
770
- }), L(v, (n, s) => {
771
- s && (r(s), o("unsubscribed", s)), n && e.autoSubscribe && u();
772
- }), R({
773
- isConnected: y,
774
- channels: g,
775
- subscribePublic: i,
776
- privateChannel: d,
777
- presenceChannel: f,
778
- leave: r,
779
- leaveAll: l,
780
- connect: c
781
- }), (n, s) => M(n.$slots, "default", {
782
- isConnected: t(y),
783
- channels: t(g),
784
- subscribePublic: t(i),
785
- privateChannel: t(d),
786
- presenceChannel: t(f),
787
- leave: t(r),
788
- leaveAll: t(l)
789
- });
790
- }
791
- }), ct = /* @__PURE__ */ T({
792
- __name: "LongPollingStream",
793
- props: {
794
- url: {},
795
- method: { default: "GET" },
796
- headers: { default: () => ({}) },
797
- body: { default: void 0 },
798
- credentials: { default: "same-origin" },
799
- interval: { default: 0 },
800
- timeout: { default: 3e4 },
801
- autoStart: { type: Boolean, default: !0 },
802
- autoRestart: { type: Boolean, default: !0 },
803
- maxRestartAttempts: { default: 5 },
804
- restartDelay: { default: 1e3 },
805
- includeTimestamp: { type: Boolean, default: !1 },
806
- timestampParam: { default: "since" }
807
- },
808
- emits: ["start", "data", "error", "stop", "restarting", "restarted", "restartFailed"],
809
- setup(C, { expose: R, emit: S }) {
810
- const e = C, o = S, { url: v } = I(e), {
811
- isPolling: y,
812
- connectionState: g,
813
- lastData: i,
814
- dataHistory: d,
815
- requestCount: f,
816
- error: r,
817
- restartAttempts: l,
818
- start: c,
819
- stop: p,
820
- poll: u,
821
- clearHistory: n
822
- } = ae(
823
- {
824
- url: e.url,
825
- method: e.method,
826
- headers: e.headers,
827
- body: e.body,
828
- credentials: e.credentials,
829
- interval: e.interval,
830
- timeout: e.timeout,
831
- autoStart: e.autoStart,
832
- autoRestart: e.autoRestart,
833
- maxRestartAttempts: e.maxRestartAttempts,
834
- restartDelay: e.restartDelay,
835
- includeTimestamp: e.includeTimestamp,
836
- timestampParam: e.timestampParam
837
- },
838
- {
839
- onStart: () => o("start"),
840
- onData: (s) => o("data", s),
841
- onError: (s) => o("error", s),
842
- onStop: () => o("stop"),
843
- onRestarting: (s, a) => o("restarting", s, a),
844
- onRestarted: () => o("restarted"),
845
- onRestartFailed: () => o("restartFailed")
846
- }
847
- );
848
- return L(v, () => {
849
- p(), c();
850
- }), R({
851
- isPolling: y,
852
- connectionState: g,
853
- lastData: i,
854
- dataHistory: d,
855
- requestCount: f,
856
- error: r,
857
- restartAttempts: l,
858
- start: c,
859
- stop: p,
860
- poll: u,
861
- clearHistory: n
862
- }), (s, a) => M(s.$slots, "default", {
863
- isPolling: t(y),
864
- connectionState: t(g),
865
- lastData: t(i),
866
- dataHistory: t(d),
867
- requestCount: t(f),
868
- error: t(r),
869
- restartAttempts: t(l),
870
- start: t(c),
871
- stop: t(p),
872
- poll: t(u),
873
- clearHistory: t(n)
874
- });
875
- }
876
- }), ut = /* @__PURE__ */ T({
877
- __name: "SocketIOStream",
878
- props: {
879
- config: {},
880
- autoConnect: { type: Boolean, default: !0 },
881
- events: { default: () => [] }
882
- },
883
- emits: ["connect", "disconnect", "error", "event", "reconnecting", "reconnected", "reconnectFailed"],
884
- setup(C, { expose: R, emit: S }) {
885
- const e = C, o = S, { config: v } = I(e), {
886
- isConnected: y,
887
- connectionState: g,
888
- socketId: i,
889
- rooms: d,
890
- error: f,
891
- connect: r,
892
- disconnect: l,
893
- emit: c,
894
- on: p,
895
- off: u,
896
- join: n,
897
- leave: s
898
- } = ie(e.config, {
899
- onConnect: (a) => o("connect", a),
900
- onDisconnect: (a) => o("disconnect", a),
901
- onError: (a) => o("error", a),
902
- onReconnecting: (a) => o("reconnecting", a),
903
- onReconnectFailed: () => o("reconnectFailed")
904
- });
905
- return e.events.forEach((a) => {
906
- p(a, (B) => {
907
- o("event", a, B);
908
- });
909
- }), L(
910
- () => v.value.url,
911
- () => {
912
- l(), r();
913
- }
914
- ), R({
915
- isConnected: y,
916
- connectionState: g,
917
- socketId: i,
918
- rooms: d,
919
- error: f,
920
- connect: r,
921
- disconnect: l,
922
- emit: c,
923
- on: p,
924
- off: u,
925
- join: n,
926
- leave: s
927
- }), (a, B) => M(a.$slots, "default", {
928
- isConnected: t(y),
929
- connectionState: t(g),
930
- socketId: t(i),
931
- rooms: t(d),
932
- error: t(f),
933
- connect: t(r),
934
- disconnect: t(l),
935
- emit: t(c),
936
- on: t(p),
937
- off: t(u),
938
- join: t(n),
939
- leave: t(s)
940
- });
941
- }
942
- }), dt = /* @__PURE__ */ T({
943
- __name: "SSEStream",
944
- props: {
945
- url: {},
946
- withCredentials: { type: Boolean, default: !1 },
947
- autoConnect: { type: Boolean, default: !0 },
948
- autoReconnect: { type: Boolean, default: !0 },
949
- maxReconnectAttempts: { default: 5 },
950
- reconnectDelay: { default: 1e3 },
951
- eventTypes: { default: () => ["message"] }
952
- },
953
- emits: ["open", "error", "message", "event", "reconnecting", "reconnected", "reconnectFailed"],
954
- setup(C, { expose: R, emit: S }) {
955
- const e = C, o = S, { url: v } = I(e), {
956
- isConnected: y,
957
- connectionState: g,
958
- lastMessage: i,
959
- lastEventType: d,
960
- lastEventId: f,
961
- error: r,
962
- reconnectAttempts: l,
963
- connect: c,
964
- disconnect: p,
965
- addEventListener: u,
966
- removeEventListener: n
967
- } = le(
968
- {
969
- url: e.url,
970
- withCredentials: e.withCredentials,
971
- autoConnect: e.autoConnect,
972
- autoReconnect: e.autoReconnect,
973
- maxReconnectAttempts: e.maxReconnectAttempts,
974
- reconnectDelay: e.reconnectDelay,
975
- eventTypes: e.eventTypes
976
- },
977
- {
978
- onOpen: () => o("open"),
979
- onError: (s) => o("error", s),
980
- onMessage: (s, a) => o("message", s, a),
981
- onEvent: (s, a, B) => o("event", s, a, B),
982
- onReconnecting: (s, a) => o("reconnecting", s, a),
983
- onReconnected: () => o("reconnected"),
984
- onReconnectFailed: () => o("reconnectFailed")
985
- }
986
- );
987
- return L(v, () => {
988
- p(), c();
989
- }), R({
990
- isConnected: y,
991
- connectionState: g,
992
- lastMessage: i,
993
- lastEventType: d,
994
- lastEventId: f,
995
- error: r,
996
- reconnectAttempts: l,
997
- connect: c,
998
- disconnect: p,
999
- addEventListener: u,
1000
- removeEventListener: n
1001
- }), (s, a) => M(s.$slots, "default", {
1002
- isConnected: t(y),
1003
- connectionState: t(g),
1004
- lastMessage: t(i),
1005
- lastEventType: t(d),
1006
- lastEventId: t(f),
1007
- error: t(r),
1008
- reconnectAttempts: t(l),
1009
- connect: t(c),
1010
- disconnect: t(p),
1011
- addEventListener: t(u),
1012
- removeEventListener: t(n)
1013
- });
1014
- }
1015
- }), pt = /* @__PURE__ */ T({
1016
- __name: "WebSocketStream",
1017
- props: {
1018
- config: {},
1019
- autoConnect: { type: Boolean, default: !0 }
1020
- },
1021
- emits: ["open", "close", "error", "message", "reconnecting", "reconnected", "reconnectFailed"],
1022
- setup(C, { expose: R, emit: S }) {
1023
- const e = C, o = S, { config: v } = I(e), {
1024
- isConnected: y,
1025
- connectionState: g,
1026
- lastMessage: i,
1027
- error: d,
1028
- reconnectAttempts: f,
1029
- connect: r,
1030
- disconnect: l,
1031
- send: c,
1032
- sendJSON: p
1033
- } = ce(e.config, {
1034
- onOpen: () => o("open"),
1035
- onClose: (u, n) => o("close", u, n),
1036
- onError: (u) => o("error", u),
1037
- onMessage: (u, n) => o("message", u, n),
1038
- onReconnecting: (u, n) => o("reconnecting", u, n),
1039
- onReconnected: () => o("reconnected"),
1040
- onReconnectFailed: () => o("reconnectFailed")
1041
- });
1042
- return L(
1043
- () => v.value.url,
1044
- () => {
1045
- l(), r();
1046
- }
1047
- ), R({
1048
- isConnected: y,
1049
- connectionState: g,
1050
- lastMessage: i,
1051
- error: d,
1052
- reconnectAttempts: f,
1053
- connect: r,
1054
- disconnect: l,
1055
- send: c,
1056
- sendJSON: p
1057
- }), (u, n) => M(u.$slots, "default", {
1058
- isConnected: t(y),
1059
- connectionState: t(g),
1060
- lastMessage: t(i),
1061
- error: t(d),
1062
- reconnectAttempts: t(f),
1063
- connect: t(r),
1064
- disconnect: t(l),
1065
- send: t(c),
1066
- sendJson: t(p)
1067
- });
1068
- }
1069
- });
1070
- export {
1071
- nt as H,
1072
- ot as P,
1073
- st as S,
1074
- rt as W,
1075
- at as _,
1076
- it as a,
1077
- lt as b,
1078
- ct as c,
1079
- dt as d,
1080
- ut as e,
1081
- pt as f
1082
- };
1083
- //# sourceMappingURL=WebSocketStream.vue_vue_type_script_setup_true_lang-BzBWoH8H.js.map