@supraio/client-daemon-js 0.0.0-jvmaster.366-jvdevelop.396 → 0.0.0-jvmaster.366-jvandroid.397

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.
Binary file
Binary file
Binary file
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@supraio/client-daemon-js",
3
- "version": "0.0.0-jvmaster.366-jvdevelop.396",
3
+ "version": "0.0.0-jvmaster.366-jvandroid.397",
4
4
  "description": "",
5
5
  "main": "sdk.js",
6
6
  "types": "sdk.d.ts",
@@ -14,8 +14,7 @@
14
14
  "lint": "eslint \"**/*.ts\""
15
15
  },
16
16
  "devDependencies": {
17
- "@signageos/nacl-decoder": "^0.0.7",
18
- "@signageos/samsung-wasm-decoder": "^0.0.0",
17
+ "@signageos/nacl-decoder": "^0.0.6",
19
18
  "@types/dropboxjs": "0.0.29",
20
19
  "@types/filesystem": "0.0.29",
21
20
  "@types/node": "14.14.34",
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=0.0.0-jvmaster.366-jvdevelop.396"></script>
8
+ <script type="text/javascript" src="screen.js?v=0.0.0-jvmaster.366-jvandroid.397"></script>
9
9
  </body>
10
10
  </html>
package/screen.js CHANGED
@@ -17592,387 +17592,6 @@
17592
17592
  }
17593
17593
  });
17594
17594
 
17595
- // node_modules/@signageos/samsung-wasm-decoder/dist/WasmDecoder/videoDecoder.js
17596
- var require_videoDecoder2 = __commonJS({
17597
- "node_modules/@signageos/samsung-wasm-decoder/dist/WasmDecoder/videoDecoder.js"(exports) {
17598
- "use strict";
17599
- Object.defineProperty(exports, "__esModule", { value: true });
17600
- exports.ResultStatus = void 0;
17601
- var ResultStatus;
17602
- (function(ResultStatus2) {
17603
- ResultStatus2[ResultStatus2["Ok"] = 0] = "Ok";
17604
- ResultStatus2[ResultStatus2["ErrorFailed"] = -2] = "ErrorFailed";
17605
- ResultStatus2[ResultStatus2["ErrorBadArgument"] = -4] = "ErrorBadArgument";
17606
- ResultStatus2[ResultStatus2["ErrorNoInit"] = -6] = "ErrorNoInit";
17607
- })(ResultStatus || (exports.ResultStatus = ResultStatus = {}));
17608
- }
17609
- });
17610
-
17611
- // node_modules/@signageos/samsung-wasm-decoder/dist/WasmDecoder/wasmDecoder.js
17612
- var require_wasmDecoder = __commonJS({
17613
- "node_modules/@signageos/samsung-wasm-decoder/dist/WasmDecoder/wasmDecoder.js"(exports) {
17614
- "use strict";
17615
- var __awaiter = exports && exports.__awaiter || function(thisArg, _arguments, P, generator) {
17616
- function adopt(value) {
17617
- return value instanceof P ? value : new P(function(resolve) {
17618
- resolve(value);
17619
- });
17620
- }
17621
- return new (P || (P = Promise))(function(resolve, reject) {
17622
- function fulfilled(value) {
17623
- try {
17624
- step(generator.next(value));
17625
- } catch (e) {
17626
- reject(e);
17627
- }
17628
- }
17629
- function rejected(value) {
17630
- try {
17631
- step(generator["throw"](value));
17632
- } catch (e) {
17633
- reject(e);
17634
- }
17635
- }
17636
- function step(result) {
17637
- result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected);
17638
- }
17639
- step((generator = generator.apply(thisArg, _arguments || [])).next());
17640
- });
17641
- };
17642
- var __generator = exports && exports.__generator || function(thisArg, body) {
17643
- var _ = { label: 0, sent: function() {
17644
- if (t[0] & 1) throw t[1];
17645
- return t[1];
17646
- }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype);
17647
- return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() {
17648
- return this;
17649
- }), g;
17650
- function verb(n) {
17651
- return function(v) {
17652
- return step([n, v]);
17653
- };
17654
- }
17655
- function step(op) {
17656
- if (f) throw new TypeError("Generator is already executing.");
17657
- while (g && (g = 0, op[0] && (_ = 0)), _) try {
17658
- if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
17659
- if (y = 0, t) op = [op[0] & 2, t.value];
17660
- switch (op[0]) {
17661
- case 0:
17662
- case 1:
17663
- t = op;
17664
- break;
17665
- case 4:
17666
- _.label++;
17667
- return { value: op[1], done: false };
17668
- case 5:
17669
- _.label++;
17670
- y = op[1];
17671
- op = [0];
17672
- continue;
17673
- case 7:
17674
- op = _.ops.pop();
17675
- _.trys.pop();
17676
- continue;
17677
- default:
17678
- if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) {
17679
- _ = 0;
17680
- continue;
17681
- }
17682
- if (op[0] === 3 && (!t || op[1] > t[0] && op[1] < t[3])) {
17683
- _.label = op[1];
17684
- break;
17685
- }
17686
- if (op[0] === 6 && _.label < t[1]) {
17687
- _.label = t[1];
17688
- t = op;
17689
- break;
17690
- }
17691
- if (t && _.label < t[2]) {
17692
- _.label = t[2];
17693
- _.ops.push(op);
17694
- break;
17695
- }
17696
- if (t[2]) _.ops.pop();
17697
- _.trys.pop();
17698
- continue;
17699
- }
17700
- op = body.call(thisArg, _);
17701
- } catch (e) {
17702
- op = [6, e];
17703
- y = 0;
17704
- } finally {
17705
- f = t = 0;
17706
- }
17707
- if (op[0] & 5) throw op[1];
17708
- return { value: op[0] ? op[1] : void 0, done: true };
17709
- }
17710
- };
17711
- Object.defineProperty(exports, "__esModule", { value: true });
17712
- exports.SamsungWasmDecoder = void 0;
17713
- var videoDecoder_1 = require_videoDecoder2();
17714
- function detectKeyFrameAnnexB(bytes) {
17715
- if (bytes.length === 0)
17716
- return false;
17717
- var nalHeaderIndex = 0;
17718
- if (bytes.length >= 4 && bytes[0] === 0 && bytes[1] === 0 && bytes[2] === 0 && bytes[3] === 1) {
17719
- nalHeaderIndex = 4;
17720
- } else if (bytes.length >= 3 && bytes[0] === 0 && bytes[1] === 0 && bytes[2] === 1) {
17721
- nalHeaderIndex = 3;
17722
- }
17723
- if (nalHeaderIndex >= bytes.length)
17724
- return false;
17725
- var nalType = bytes[nalHeaderIndex] & 31;
17726
- if (nalType === 5 || nalType === 7 || nalType === 8)
17727
- return true;
17728
- for (var i = nalHeaderIndex + 1; i + 4 < bytes.length; i++) {
17729
- var is3 = bytes[i] === 0 && bytes[i + 1] === 0 && bytes[i + 2] === 1;
17730
- var is4 = bytes[i] === 0 && bytes[i + 1] === 0 && bytes[i + 2] === 0 && bytes[i + 3] === 1;
17731
- if (!is3 && !is4)
17732
- continue;
17733
- var idx = i + (is3 ? 3 : 4);
17734
- if (idx >= bytes.length)
17735
- return false;
17736
- var nt = bytes[idx] & 31;
17737
- if (nt === 5 || nt === 7 || nt === 8)
17738
- return true;
17739
- }
17740
- return false;
17741
- }
17742
- function ensureVideoElement(videoElementId) {
17743
- var el = document.getElementById(videoElementId);
17744
- if (!el) {
17745
- el = document.createElement("video");
17746
- el.id = videoElementId;
17747
- el.style.position = "absolute";
17748
- el.style.top = "0";
17749
- el.style.left = "0";
17750
- el.style.width = "1920px";
17751
- el.style.height = "1080px";
17752
- el.style.backgroundColor = "#000";
17753
- document.body.appendChild(el);
17754
- }
17755
- el.autoplay = true;
17756
- el.muted = true;
17757
- el.playsInline = true;
17758
- return el;
17759
- }
17760
- var SamsungWasmDecoder2 = (
17761
- /** @class */
17762
- function() {
17763
- function SamsungWasmDecoder3(videoElementId) {
17764
- this.videoElementId = videoElementId;
17765
- this.initialized = false;
17766
- this.destroyed = false;
17767
- this.native = null;
17768
- this.decoderHandle = 0;
17769
- this.ptsSeconds = 0;
17770
- this.frameDurationSeconds = 1 / 60;
17771
- this.videoElement = ensureVideoElement(videoElementId);
17772
- }
17773
- SamsungWasmDecoder3.prototype.destroy = function() {
17774
- return __awaiter(this, void 0, void 0, function() {
17775
- var _a, _b;
17776
- return __generator(this, function(_c) {
17777
- if (this.destroyed)
17778
- return [
17779
- 2
17780
- /*return*/
17781
- ];
17782
- this.destroyed = true;
17783
- try {
17784
- (_b = (_a = this.native) === null || _a === void 0 ? void 0 : _a.ccall) === null || _b === void 0 ? void 0 : _b.call(_a, "swd_destroy", "void", ["number"], [this.decoderHandle]);
17785
- } catch (_d) {
17786
- }
17787
- this.decoderHandle = 0;
17788
- this.native = null;
17789
- return [
17790
- 2
17791
- /*return*/
17792
- ];
17793
- });
17794
- });
17795
- };
17796
- SamsungWasmDecoder3.prototype.initialize = function(args) {
17797
- return __awaiter(this, void 0, void 0, function() {
17798
- var width, height, mod, create, init, fpsNum, fpsDen, ok, isReady, maxWaitMs, pollIntervalMs, waited;
17799
- var _a, _b, _c;
17800
- return __generator(this, function(_d) {
17801
- switch (_d.label) {
17802
- case 0:
17803
- if (this.destroyed) {
17804
- return [2, videoDecoder_1.ResultStatus.ErrorFailed];
17805
- }
17806
- width = (_a = args.width) !== null && _a !== void 0 ? _a : window.screen.width;
17807
- height = (_b = args.height) !== null && _b !== void 0 ? _b : window.screen.height;
17808
- this.videoElement.width = width;
17809
- this.videoElement.height = height;
17810
- mod = (_c = window.SamsungWasmDecoderModule) === null || _c === void 0 ? void 0 : _c.call(window);
17811
- if (!mod) {
17812
- return [2, videoDecoder_1.ResultStatus.ErrorNoInit];
17813
- }
17814
- return [4, new Promise(function(resolve) {
17815
- mod.onRuntimeInitialized = function() {
17816
- return resolve(null);
17817
- };
17818
- })];
17819
- case 1:
17820
- _d.sent();
17821
- this.native = mod;
17822
- create = mod.cwrap("swd_create", "number", ["string"]);
17823
- init = mod.cwrap("swd_init_h264", "number", ["number", "number", "number", "number"]);
17824
- this.decoderHandle = create(this.videoElementId);
17825
- if (!this.decoderHandle) {
17826
- return [2, videoDecoder_1.ResultStatus.ErrorFailed];
17827
- }
17828
- fpsNum = 60;
17829
- fpsDen = 1;
17830
- this.frameDurationSeconds = fpsDen / fpsNum;
17831
- this.ptsSeconds = 0;
17832
- ok = init(this.decoderHandle, width, height, fpsNum, fpsDen);
17833
- if (ok !== 0) {
17834
- return [2, videoDecoder_1.ResultStatus.ErrorFailed];
17835
- }
17836
- isReady = mod.cwrap("swd_is_ready", "number", ["number"]);
17837
- maxWaitMs = 5e3;
17838
- pollIntervalMs = 50;
17839
- waited = 0;
17840
- _d.label = 2;
17841
- case 2:
17842
- if (!(isReady(this.decoderHandle) === 0 && waited < maxWaitMs)) return [3, 4];
17843
- return [4, new Promise(function(resolve) {
17844
- return setTimeout(resolve, pollIntervalMs);
17845
- })];
17846
- case 3:
17847
- _d.sent();
17848
- waited += pollIntervalMs;
17849
- return [3, 2];
17850
- case 4:
17851
- if (isReady(this.decoderHandle) === 0) {
17852
- console.error("Decoder track did not open in time");
17853
- return [2, videoDecoder_1.ResultStatus.ErrorFailed];
17854
- }
17855
- this.initialized = true;
17856
- return [2, videoDecoder_1.ResultStatus.Ok];
17857
- }
17858
- });
17859
- });
17860
- };
17861
- SamsungWasmDecoder3.prototype.decodeAndRender = function(data) {
17862
- return __awaiter(this, void 0, void 0, function() {
17863
- var bytes, isKey, ptr, append, ok;
17864
- return __generator(this, function(_a) {
17865
- if (!this.initialized || this.destroyed || !this.native) {
17866
- return [2, videoDecoder_1.ResultStatus.ErrorNoInit];
17867
- }
17868
- if (!(data instanceof ArrayBuffer)) {
17869
- return [2, videoDecoder_1.ResultStatus.ErrorBadArgument];
17870
- }
17871
- bytes = new Uint8Array(data);
17872
- isKey = detectKeyFrameAnnexB(bytes);
17873
- ptr = this.native._malloc(bytes.length);
17874
- this.native.HEAPU8.set(bytes, ptr);
17875
- try {
17876
- append = this.native.cwrap("swd_append", "number", [
17877
- "number",
17878
- "number",
17879
- "number",
17880
- "number",
17881
- "number",
17882
- "number"
17883
- ]);
17884
- ok = append(this.decoderHandle, ptr, bytes.length, isKey ? 1 : 0, this.ptsSeconds, this.frameDurationSeconds);
17885
- if (ok === 0) {
17886
- this.ptsSeconds += this.frameDurationSeconds;
17887
- return [2, videoDecoder_1.ResultStatus.Ok];
17888
- }
17889
- return [2, videoDecoder_1.ResultStatus.ErrorFailed];
17890
- } finally {
17891
- this.native._free(ptr);
17892
- }
17893
- return [
17894
- 2
17895
- /*return*/
17896
- ];
17897
- });
17898
- });
17899
- };
17900
- SamsungWasmDecoder3.prototype.flush = function() {
17901
- return __awaiter(this, void 0, void 0, function() {
17902
- var flush;
17903
- return __generator(this, function(_a) {
17904
- if (!this.native || !this.decoderHandle)
17905
- return [2, videoDecoder_1.ResultStatus.ErrorNoInit];
17906
- try {
17907
- flush = this.native.cwrap("swd_flush", "number", ["number"]);
17908
- return [2, flush(this.decoderHandle) === 0 ? videoDecoder_1.ResultStatus.Ok : videoDecoder_1.ResultStatus.ErrorFailed];
17909
- } catch (_b) {
17910
- return [2, videoDecoder_1.ResultStatus.ErrorFailed];
17911
- }
17912
- return [
17913
- 2
17914
- /*return*/
17915
- ];
17916
- });
17917
- });
17918
- };
17919
- SamsungWasmDecoder3.prototype.reset = function() {
17920
- return __awaiter(this, void 0, void 0, function() {
17921
- var reset, rc;
17922
- return __generator(this, function(_a) {
17923
- if (!this.native || !this.decoderHandle)
17924
- return [2, videoDecoder_1.ResultStatus.ErrorNoInit];
17925
- try {
17926
- reset = this.native.cwrap("swd_reset", "number", ["number"]);
17927
- rc = reset(this.decoderHandle);
17928
- this.ptsSeconds = 0;
17929
- return [2, rc === 0 ? videoDecoder_1.ResultStatus.Ok : videoDecoder_1.ResultStatus.ErrorFailed];
17930
- } catch (_b) {
17931
- return [2, videoDecoder_1.ResultStatus.ErrorFailed];
17932
- }
17933
- return [
17934
- 2
17935
- /*return*/
17936
- ];
17937
- });
17938
- });
17939
- };
17940
- return SamsungWasmDecoder3;
17941
- }()
17942
- );
17943
- exports.SamsungWasmDecoder = SamsungWasmDecoder2;
17944
- }
17945
- });
17946
-
17947
- // node_modules/@signageos/samsung-wasm-decoder/dist/index.js
17948
- var require_dist2 = __commonJS({
17949
- "node_modules/@signageos/samsung-wasm-decoder/dist/index.js"(exports) {
17950
- "use strict";
17951
- Object.defineProperty(exports, "__esModule", { value: true });
17952
- exports.SamsungWasmDecoder = exports.ResultStatus = void 0;
17953
- exports.isSamsungWasmSupported = isSamsungWasmSupported2;
17954
- exports.createSamsungWasmDecoder = createSamsungWasmDecoder2;
17955
- var wasmDecoder_1 = require_wasmDecoder();
17956
- Object.defineProperty(exports, "SamsungWasmDecoder", { enumerable: true, get: function() {
17957
- return wasmDecoder_1.SamsungWasmDecoder;
17958
- } });
17959
- var videoDecoder_1 = require_videoDecoder2();
17960
- Object.defineProperty(exports, "ResultStatus", { enumerable: true, get: function() {
17961
- return videoDecoder_1.ResultStatus;
17962
- } });
17963
- function isSamsungWasmSupported2() {
17964
- var _a;
17965
- return typeof window.WebAssembly !== "undefined" && typeof ((_a = window.tizentvwasm) === null || _a === void 0 ? void 0 : _a.ElementaryMediaStreamSource) !== "undefined";
17966
- }
17967
- function createSamsungWasmDecoder2(options) {
17968
- if (!isSamsungWasmSupported2()) {
17969
- throw new Error("Samsung WASM decoder is not supported in this environment.");
17970
- }
17971
- return new wasmDecoder_1.SamsungWasmDecoder(options.videoElementId);
17972
- }
17973
- }
17974
- });
17975
-
17976
17595
  // node_modules/querystring/decode.js
17977
17596
  var require_decode = __commonJS({
17978
17597
  "node_modules/querystring/decode.js"(exports, module) {
@@ -18461,17 +18080,6 @@
18461
18080
  }
18462
18081
  }
18463
18082
 
18464
- // screen/samsungwasmdecoder.ts
18465
- var import_samsung_wasm_decoder = __toESM(require_dist2());
18466
- async function initSamsungWasmDecoder() {
18467
- if ((0, import_samsung_wasm_decoder.isSamsungWasmSupported)()) {
18468
- window.samsungWasmDecoder = (0, import_samsung_wasm_decoder.createSamsungWasmDecoder)({
18469
- videoElementId: "samsung-wasm-video"
18470
- });
18471
- await window.samsungWasmDecoder.initialize({});
18472
- }
18473
- }
18474
-
18475
18083
  // screen/shared.ts
18476
18084
  var import_querystring = __toESM(require_querystring());
18477
18085
  function parseQueryOptions() {
@@ -18515,11 +18123,10 @@
18515
18123
  }
18516
18124
 
18517
18125
  // screen/plain.ts
18518
- var SCREEN_JS_URL = "supra-client-screen.js?v=0.0.0-jvmaster.366-jvdevelop.396";
18126
+ var SCREEN_JS_URL = "supra-client-screen.js?v=0.0.0-jvmaster.366-jvandroid.397";
18519
18127
  async function startPlainScreen(options) {
18520
18128
  options = options != null ? options : parseQueryOptions();
18521
18129
  initNaCLDecoder();
18522
- await initSamsungWasmDecoder();
18523
18130
  const fs = await initBrowserFS();
18524
18131
  window.fs = fs;
18525
18132
  process.argv = ["go", ...getGoArgv(SCREEN_JS_URL, options)];
@@ -18541,10 +18148,9 @@
18541
18148
  }
18542
18149
 
18543
18150
  // screen/wasm.ts
18544
- var SCREEN_WASM_URL = "supra-client-screen.wasm?v=0.0.0-jvmaster.366-jvdevelop.396";
18151
+ var SCREEN_WASM_URL = "supra-client-screen.wasm?v=0.0.0-jvmaster.366-jvandroid.397";
18545
18152
  async function startWasmScreen(options) {
18546
18153
  options = options != null ? options : parseQueryOptions();
18547
- await initSamsungWasmDecoder();
18548
18154
  await initH264Decoder();
18549
18155
  await initGoEnvironment();
18550
18156
  await startGoScreen(options);