@supraio/client-daemon-js 1.0.0-mzbrightsigndecoder.477 → 1.0.0-mzbrightsigndecoder.478

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@supraio/client-daemon-js",
3
- "version": "1.0.0-mzbrightsigndecoder.477",
3
+ "version": "1.0.0-mzbrightsigndecoder.478",
4
4
  "description": "",
5
5
  "main": "sdk.js",
6
6
  "types": "sdk.d.ts",
@@ -10,7 +10,7 @@
10
10
  "build-sdk": "esbuild --bundle --sourcemap --define:'process.env.VERSION'=\\\"$VERSION\\\" --target=chrome79,firefox86,edge89 --outfile=dist/sdk.js --format=cjs sdk.ts",
11
11
  "build-types": "tsc --declaration --emitDeclarationOnly",
12
12
  "clean": "rm -rf dist/*",
13
- "check": "node --test fs/browserfs_test.js sdk_test.js screen/brightsign_test.js screen/control_test.js screen/h264decoder_test.js screen/options_test.js && tsc --noEmit",
13
+ "check": "node --test fs/browserfs_test.js sdk_test.js screen/brightsign_test.js screen/control_test.js screen/h264decoder_test.js screen/options_test.js screen/plain_test.js && tsc --noEmit",
14
14
  "lint": "eslint \"**/*.ts\""
15
15
  },
16
16
  "devDependencies": {
package/screen.html CHANGED
@@ -5,6 +5,6 @@
5
5
  <link rel="stylesheet" href="screen.css"></link>
6
6
  </head>
7
7
  <body>
8
- <script type="text/javascript" src="screen.js?v=1.0.0-mzbrightsigndecoder.477"></script>
8
+ <script type="text/javascript" src="screen.js?v=1.0.0-mzbrightsigndecoder.478"></script>
9
9
  </body>
10
10
  </html>
package/screen.js CHANGED
@@ -24752,6 +24752,7 @@
24752
24752
  function initBrightSignTCP() {
24753
24753
  registerStreamErrorListener();
24754
24754
  if (window.brightSignTCP) {
24755
+ console.log("BrightSign TCP already initialized");
24755
24756
  return true;
24756
24757
  }
24757
24758
  try {
@@ -24761,6 +24762,7 @@
24761
24762
  maxPacketSize: 65535
24762
24763
  });
24763
24764
  registerTeardown();
24765
+ console.log("BrightSign TCP initialized");
24764
24766
  return true;
24765
24767
  } catch (error) {
24766
24768
  console.log("BrightSign TCP is not available", error);
@@ -24768,11 +24770,14 @@
24768
24770
  }
24769
24771
  }
24770
24772
  async function initBrightSignDecoder(options) {
24771
- var _a;
24773
+ var _a, _b, _c;
24772
24774
  if (window.brightSignDecoder) {
24775
+ console.log("BrightSign decoder already initialized");
24773
24776
  return true;
24774
24777
  }
24775
- if (!(0, import_brightsign_decoder.isBrightSignDecoderSupported)()) {
24778
+ const runtimeAvailable = (0, import_brightsign_decoder.isBrightSignDecoderSupported)();
24779
+ console.log("BrightSign decoder runtime availability", runtimeAvailable);
24780
+ if (!runtimeAvailable) {
24776
24781
  return false;
24777
24782
  }
24778
24783
  try {
@@ -24782,6 +24787,11 @@
24782
24787
  width: window.innerWidth,
24783
24788
  height: window.innerHeight
24784
24789
  };
24790
+ console.log("BrightSign decoder initialization begin", {
24791
+ geometry,
24792
+ streamProtocol: (_b = options.brightSignDecoderStreamProtocol) != null ? _b : "default",
24793
+ streamOptions: (_c = options.brightSignStreamOptions) != null ? _c : null
24794
+ });
24785
24795
  const decoder = (0, import_brightsign_decoder.createBrightSignDecoder)({
24786
24796
  refRegistry: getReferenceRegistry()
24787
24797
  });
@@ -24792,6 +24802,7 @@
24792
24802
  });
24793
24803
  window.brightSignDecoder = decoder;
24794
24804
  registerTeardown();
24805
+ console.log("BrightSign decoder initialization complete");
24795
24806
  return true;
24796
24807
  } catch (error) {
24797
24808
  console.error("Failed to initialize BrightSign decoder", error);
@@ -24818,6 +24829,7 @@
24818
24829
  (event) => console.error("BrightSign native stream error", event)
24819
24830
  ]);
24820
24831
  streamErrorListenerRegistered = true;
24832
+ console.log("BrightSign native stream error listener registered");
24821
24833
  }
24822
24834
  function getReferenceRegistry() {
24823
24835
  if (!referenceRegistry) {
@@ -24834,12 +24846,14 @@
24834
24846
  }
24835
24847
  teardownRegistered = true;
24836
24848
  window.addEventListener("unload", () => {
24849
+ console.log("BrightSign teardown begin");
24837
24850
  const decoder = window.brightSignDecoder;
24838
24851
  const tcp = window.brightSignTCP;
24839
24852
  window.brightSignDecoder = void 0;
24840
24853
  window.brightSignTCP = void 0;
24841
24854
  void (decoder == null ? void 0 : decoder.destroy());
24842
24855
  void (tcp == null ? void 0 : tcp.destroy());
24856
+ console.log("BrightSign teardown dispatched");
24843
24857
  });
24844
24858
  }
24845
24859
 
@@ -25275,15 +25289,41 @@ self.onmessage = function(event) {
25275
25289
  }
25276
25290
 
25277
25291
  // screen/plain.ts
25278
- var SCREEN_JS_URL = "supra-client-screen.js?v=1.0.0-mzbrightsigndecoder.477";
25292
+ var SCREEN_JS_URL = "supra-client-screen.js?v=1.0.0-mzbrightsigndecoder.478";
25279
25293
  async function startPlainScreen(options) {
25294
+ var _a, _b, _c, _d;
25280
25295
  console.log("[Supra screen plain] initialization begin");
25281
25296
  options = options != null ? options : parseQueryOptions();
25282
25297
  options = { ...options, geometry: normalizeGeometry(options.geometry) };
25298
+ console.log("[Supra screen plain] resolved start options", {
25299
+ screenID: options.screenID,
25300
+ screenDriver: options.screenDriver,
25301
+ metadataDriver: options.metadataDriver,
25302
+ secure: options.secure,
25303
+ interactive: options.interactive,
25304
+ netInWorker: options.netInWorker === true,
25305
+ forceScreenSize: (_a = options.forceScreenSize) != null ? _a : null,
25306
+ geometry: (_b = options.geometry) != null ? _b : null,
25307
+ brightSignDecoderStreamProtocol: (_c = options.brightSignDecoderStreamProtocol) != null ? _c : "default",
25308
+ hasBrightSignStreamOptions: options.brightSignStreamOptions !== void 0,
25309
+ encodingPreferences: (_d = options.encodingPreferences) != null ? _d : null
25310
+ });
25283
25311
  initNaCLDecoder(options);
25284
25312
  initWorkerFrameConnection(options.netInWorker === true);
25285
- initBrightSignTCP();
25286
- await initBrightSignDecoder(options);
25313
+ const brightSignTCPReady = initBrightSignTCP();
25314
+ console.log("[Supra screen plain] BrightSign TCP ready", brightSignTCPReady);
25315
+ const brightSignDecoderReady = await initBrightSignDecoder(options);
25316
+ console.log("[Supra screen plain] BrightSign decoder ready", brightSignDecoderReady);
25317
+ if (brightSignDecoderReady) {
25318
+ const sos = Reflect.get(globalThis, "sos");
25319
+ if (typeof sos === "object" && sos !== null) {
25320
+ const config2 = Reflect.get(sos, "config");
25321
+ if (typeof config2 === "object" && config2 !== null) {
25322
+ Reflect.set(config2, "stream", false);
25323
+ console.log("[Supra screen plain] disabled sos.stream fallback for native decoder");
25324
+ }
25325
+ }
25326
+ }
25287
25327
  await initNaClTCP(options);
25288
25328
  await initSamsungWasmTCP();
25289
25329
  await initSamsungWasmDecoder(options);
@@ -25291,13 +25331,17 @@ self.onmessage = function(event) {
25291
25331
  window.fs = fs;
25292
25332
  process.argv = ["go", ...getGoArgv(SCREEN_JS_URL, options)];
25293
25333
  Object.assign(process.env, getGoEnv());
25334
+ console.log("[Supra screen plain] Go argv prepared", {
25335
+ argvLength: process.argv.length,
25336
+ screenID: options.screenID
25337
+ });
25294
25338
  console.log("[Supra screen plain] script injection begin");
25295
25339
  await injectScript(SCREEN_JS_URL);
25296
25340
  console.log("[Supra screen plain] script injection complete; waiting for close");
25297
25341
  await new Promise((resolve) => {
25298
25342
  const interval = setInterval(() => {
25299
- var _a;
25300
- if (((_a = window.__supra) == null ? void 0 : _a.screenStopCompleted) === true) {
25343
+ var _a2;
25344
+ if (((_a2 = window.__supra) == null ? void 0 : _a2.screenStopCompleted) === true) {
25301
25345
  clearInterval(interval);
25302
25346
  console.log("[Supra screen plain] lifecycle complete");
25303
25347
  resolve();
@@ -25307,7 +25351,7 @@ self.onmessage = function(event) {
25307
25351
  }
25308
25352
 
25309
25353
  // screen/h264decoder.ts
25310
- var H264_DECODER_URL = "h264decoder.js?v=1.0.0-mzbrightsigndecoder.477";
25354
+ var H264_DECODER_URL = "h264decoder.js?v=1.0.0-mzbrightsigndecoder.478";
25311
25355
  async function initH264Decoder() {
25312
25356
  if (window.VideoDecoder !== void 0) {
25313
25357
  return void 0;
@@ -25346,7 +25390,7 @@ self.onmessage = function(event) {
25346
25390
  }
25347
25391
 
25348
25392
  // screen/wasm.ts
25349
- var SCREEN_WASM_URL = "supra-client-screen.wasm?v=1.0.0-mzbrightsigndecoder.477";
25393
+ var SCREEN_WASM_URL = "supra-client-screen.wasm?v=1.0.0-mzbrightsigndecoder.478";
25350
25394
  async function initializePhase(name, initialize) {
25351
25395
  const startedAt = Date.now();
25352
25396
  console.log(`[Supra screen WASM] ${name} begin`);
@@ -25423,18 +25467,27 @@ self.onmessage = function(event) {
25423
25467
  ev.returnValue = "Are you sure you want to leave?";
25424
25468
  });
25425
25469
  window.addEventListener("load", async () => {
25426
- var _a;
25470
+ var _a, _b, _c, _d;
25427
25471
  try {
25472
+ console.log("Supra screen lifecycle load handler start");
25428
25473
  await startScreen();
25429
25474
  if (window.__supra) {
25430
25475
  window.__supra.screenLifecycleExited = true;
25431
25476
  }
25477
+ console.log("Supra screen lifecycle startScreen resolved");
25432
25478
  } catch (error) {
25433
25479
  console.error("Error process", error);
25434
25480
  } finally {
25435
- if (((_a = window.__supra) == null ? void 0 : _a.screenStopped) !== true) {
25481
+ console.log("Supra screen lifecycle finally state", {
25482
+ screenStopped: ((_a = window.__supra) == null ? void 0 : _a.screenStopped) === true,
25483
+ screenStopCompleted: ((_b = window.__supra) == null ? void 0 : _b.screenStopCompleted) === true,
25484
+ screenLifecycleExited: ((_c = window.__supra) == null ? void 0 : _c.screenLifecycleExited) === true
25485
+ });
25486
+ if (((_d = window.__supra) == null ? void 0 : _d.screenStopped) !== true) {
25436
25487
  console.log("Reloading window");
25437
25488
  location.reload();
25489
+ } else {
25490
+ console.log("Supra screen lifecycle stop acknowledged; skip reload");
25438
25491
  }
25439
25492
  }
25440
25493
  });