@moq/watch 0.2.19 → 0.3.1

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.md CHANGED
@@ -109,7 +109,7 @@ watch.video.media.subscribe((stream) => {
109
109
 
110
110
  ## UI Web Component
111
111
 
112
- `@moq/watch` includes a Web Component UI overlay (`<moq-watch-ui>`) with playback controls, volume, buffering indicator, quality selector, and stats panel. It is built on top of `@moq/signals` with no framework dependency.
112
+ `@moq/watch` includes a Web Component UI overlay (`<moq-watch-ui>`) with playback controls, volume, buffering indicator, unsupported-codec indicator, quality selector, and stats panel. It is built on top of `@moq/signals` with no framework dependency.
113
113
 
114
114
  ```html
115
115
  <script type="module">
@@ -305,7 +305,7 @@ var te = class {
305
305
  sampleRate: n
306
306
  });
307
307
  e.set(this.#e, a), e.cleanup(() => a.close()), e.spawn(async () => {
308
- if (await a.audioWorklet.addModule(D), a.state === "closed") return;
308
+ if (await Promise.race([a.audioWorklet.addModule(D), e.cancel]), a.state === "closed") return;
309
309
  let t = new AudioWorkletNode(a, "render", {
310
310
  channelCount: i,
311
311
  channelCountMode: "explicit",
@@ -1369,35 +1369,49 @@ var Y = class {
1369
1369
  #e = new a({});
1370
1370
  available = this.#e;
1371
1371
  #t = new a(void 0);
1372
- track = this.#t;
1372
+ error = this.#t;
1373
1373
  #n = new a(void 0);
1374
- config = this.#n;
1374
+ track = this.#n;
1375
+ #r = new a(void 0);
1376
+ config = this.#r;
1375
1377
  sync;
1376
1378
  supported;
1377
- #r = new i();
1379
+ #i = new i();
1378
1380
  constructor(e, t) {
1379
- this.broadcast = a.from(t?.broadcast), this.target = a.from(t?.target), this.sync = e, this.supported = a.from(t?.supported), this.catalog = this.#r.computed((e) => {
1381
+ this.broadcast = a.from(t?.broadcast), this.target = a.from(t?.target), this.sync = e, this.supported = a.from(t?.supported), this.catalog = this.#i.computed((e) => {
1380
1382
  let t = e.get(this.broadcast);
1381
1383
  return t ? e.get(t.catalog)?.video : void 0;
1382
- }), this.#r.run(this.#i.bind(this)), this.#r.run(this.#a.bind(this));
1384
+ }), this.#i.run(this.#a.bind(this)), this.#i.run(this.#o.bind(this));
1383
1385
  }
1384
- #i(e) {
1386
+ #a(e) {
1385
1387
  let t = e.get(this.supported);
1386
- if (!t) return;
1388
+ if (!t) {
1389
+ this.#t.set(void 0);
1390
+ return;
1391
+ }
1387
1392
  let n = e.get(this.catalog)?.renditions ?? {};
1388
- e.spawn(async () => {
1393
+ this.#t.set(void 0), e.spawn(async () => {
1389
1394
  let e = {};
1390
- for (let [r, i] of Object.entries(n)) await t(i) && (e[r] = i);
1391
- Object.keys(e).length === 0 && Object.keys(n).length > 0 && console.warn("[Source] No supported video renditions found:", n), this.#e.set(e);
1395
+ for (let [r, i] of Object.entries(n)) {
1396
+ let n = !1;
1397
+ try {
1398
+ n = await t(i);
1399
+ } catch (e) {
1400
+ console.warn(`[Source] video rendition ${r} (${i.codec}) support probe failed; treating as unsupported`, e);
1401
+ }
1402
+ n && (e[r] = i);
1403
+ }
1404
+ let r = Object.keys(e).length === 0 && Object.keys(n).length > 0 ? "unsupported" : void 0;
1405
+ r === "unsupported" && console.warn("[Source] No supported video renditions found:", n), this.#t.set(r), this.#e.set(e);
1392
1406
  });
1393
1407
  }
1394
- #a(e) {
1408
+ #o(e) {
1395
1409
  let t = e.get(this.#e);
1396
1410
  if (Object.keys(t).length === 0) return;
1397
1411
  let n = e.get(this.target);
1398
1412
  if (n?.name && n.name in t) {
1399
1413
  let r = t[n.name];
1400
- e.set(this.#t, n.name), e.set(this.#n, r), e.set(this.sync.video, r.jitter);
1414
+ e.set(this.#n, n.name), e.set(this.#r, r), e.set(this.sync.video, r.jitter);
1401
1415
  return;
1402
1416
  }
1403
1417
  let r = n;
@@ -1414,14 +1428,14 @@ var Y = class {
1414
1428
  }
1415
1429
  }
1416
1430
  }
1417
- let i = this.#o(t, r);
1431
+ let i = this.#s(t, r);
1418
1432
  if (!i) return;
1419
1433
  let a = t[i];
1420
- e.set(this.#t, i), e.set(this.#n, a);
1434
+ e.set(this.#n, i), e.set(this.#r, a);
1421
1435
  let o = a.jitter ?? (a.framerate ? Math.ceil(1e3 / a.framerate) : void 0);
1422
1436
  e.set(this.sync.video, o);
1423
1437
  }
1424
- #o(e, t) {
1438
+ #s(e, t) {
1425
1439
  let n = Object.entries(e);
1426
1440
  if (n.length === 0) return;
1427
1441
  if (n.length === 1) return n[0][0];
@@ -1432,7 +1446,7 @@ var Y = class {
1432
1446
  console.warn("conflicting rendition filters, no rendition satisfies all criteria");
1433
1447
  }
1434
1448
  close() {
1435
- this.#r.close();
1449
+ this.#i.close();
1436
1450
  }
1437
1451
  }, ue = /* @__PURE__ */ f({
1438
1452
  Decoder: () => H,
@@ -1684,4 +1698,4 @@ var ye = class {
1684
1698
  //#endregion
1685
1699
  export { ue as a, N as c, pe as i, $ as n, R as o, ve as r, L as s, ye as t };
1686
1700
 
1687
- //# sourceMappingURL=broadcast-Duw8w3D_.js.map
1701
+ //# sourceMappingURL=broadcast-C2qofUBv.js.map