ezuikit-js 0.5.5 → 0.5.8-beta

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 (45) hide show
  1. package/CHANGELOG.md +7 -0
  2. package/demos/base-demo/ezuikit.js +77 -16
  3. package/demos/base-demo/index.html +2 -9
  4. package/demos/base-demo/jsPlugin-2.0.0.min.js +5210 -0
  5. package/demos/base-demo/server.js +67 -0
  6. package/demos/nginx-demo/conf/fastcgi.conf +26 -0
  7. package/demos/nginx-demo/conf/fastcgi_params +25 -0
  8. package/demos/nginx-demo/conf/koi-utf +109 -0
  9. package/demos/nginx-demo/conf/koi-win +103 -0
  10. package/demos/nginx-demo/conf/mime.types +95 -0
  11. package/demos/nginx-demo/conf/nginx.conf +123 -0
  12. package/demos/nginx-demo/conf/scgi_params +17 -0
  13. package/demos/nginx-demo/conf/uwsgi_params +17 -0
  14. package/demos/nginx-demo/conf/win-utf +126 -0
  15. package/demos/nginx-demo/contrib/README +21 -0
  16. package/demos/nginx-demo/contrib/geo2nginx.pl +58 -0
  17. package/demos/nginx-demo/contrib/unicode2nginx/koi-utf +131 -0
  18. package/demos/nginx-demo/contrib/unicode2nginx/unicode-to-nginx.pl +48 -0
  19. package/demos/nginx-demo/contrib/unicode2nginx/win-utf +130 -0
  20. package/demos/nginx-demo/contrib/vim/ftdetect/nginx.vim +4 -0
  21. package/demos/nginx-demo/contrib/vim/ftplugin/nginx.vim +1 -0
  22. package/demos/nginx-demo/contrib/vim/indent/nginx.vim +11 -0
  23. package/demos/nginx-demo/contrib/vim/syntax/nginx.vim +2268 -0
  24. package/demos/nginx-demo/docs/CHANGES +8115 -0
  25. package/demos/nginx-demo/docs/CHANGES.ru +8252 -0
  26. package/demos/nginx-demo/docs/LICENSE +26 -0
  27. package/demos/nginx-demo/docs/OpenSSL.LICENSE +127 -0
  28. package/demos/nginx-demo/docs/PCRE.LICENCE +93 -0
  29. package/demos/nginx-demo/docs/README +3 -0
  30. package/demos/nginx-demo/docs/zlib.LICENSE +20 -0
  31. package/demos/nginx-demo/html/50x.html +21 -0
  32. package/demos/nginx-demo/html/ezuikit5/ezuikit.js +33328 -0
  33. package/demos/nginx-demo/html/ezuikit5/index.html +110 -0
  34. package/demos/nginx-demo/html/ezuikit5/server.js +67 -0
  35. package/demos/nginx-demo/html/index.html +16 -0
  36. package/demos/nginx-demo/html/js/adapeter.js +5497 -0
  37. package/demos/nginx-demo/html/js/janus.js +3507 -0
  38. package/demos/nginx-demo/html/js/jquery.min.js +2 -0
  39. package/demos/nginx-demo/html/js/sts.js +340 -0
  40. package/demos/nginx-demo/logs/access.log +73 -0
  41. package/demos/nginx-demo/logs/error.log +12 -0
  42. package/demos/nginx-demo/logs/nginx.pid +1 -0
  43. package/demos/nginx-demo/nginx.exe +0 -0
  44. package/ezuikit.js +22348 -15983
  45. package/package.json +1 -1
package/CHANGELOG.md CHANGED
@@ -1,3 +1,10 @@
1
+ v 0.5.7
2
+ [feta]新增对讲成功回调,用于国标对讲成功,开启视频声音
3
+
4
+ [feta]新增对讲失败回调,返回对讲失败错误信息
5
+
6
+ [fix]修复无子账号对讲权限不足,错误未捕获问题
7
+
1
8
  v 0.5.5
2
9
  [fix]修复无子账号对讲权限不足,错误未捕获问题
3
10
 
@@ -110,6 +110,7 @@ var addJs = function addJs(filepath, callback, isReadyFun) {
110
110
  if (!isReady) {
111
111
  var oJs = document.createElement("script");
112
112
  oJs.setAttribute("src", filepath);
113
+ oJs.setAttribute("crossorigin", true);
113
114
  oJs.onload = callback;
114
115
  document.getElementsByTagName("head")[0].appendChild(oJs);
115
116
  } else {
@@ -27436,7 +27437,12 @@ Janus.init({
27436
27437
  "codec": "opus",
27437
27438
  "dir": "sendrecv",
27438
27439
  "audio_debug": 1
27439
- }; //tts.send({"message": body});
27440
+ };
27441
+
27442
+ if (window.EZUIKit.opt.talkType === 'gb28181') {
27443
+ body['devProto'] = 'gb28181';
27444
+ } //tts.send({"message": body});
27445
+
27440
27446
 
27441
27447
  Janus.debug("Trying a createOffer too (audio/video sendrecv)");
27442
27448
  tts.createOffer({
@@ -27640,6 +27646,8 @@ window.tts = tts;
27640
27646
 
27641
27647
  var Talk = /*#__PURE__*/function () {
27642
27648
  function Talk(jSPlugin) {
27649
+ var _this = this;
27650
+
27643
27651
  _classCallCheck$1(this, Talk);
27644
27652
 
27645
27653
  this.jSPlugin = jSPlugin;
@@ -27664,11 +27672,22 @@ var Talk = /*#__PURE__*/function () {
27664
27672
  // addJs(`${this.jSPlugin.staticPath}/talk/tts-v4.js`, () => {
27665
27673
  // 临时处理
27666
27674
 
27667
- window.EZUIKit["handleTalkError"] = {
27668
- handleTalkError: function handleTalkError(err) {
27669
- console.log("talk err", err);
27675
+ window.EZUIKit["handleTalkError"] = function (err) {
27676
+ console.log("talk err", err);
27677
+
27678
+ if (typeof _this.jSPlugin.handleTalkError !== 'undefined') {
27679
+ _this.jSPlugin.handleTalkError(err);
27670
27680
  }
27671
27681
  };
27682
+
27683
+ window.EZUIKit["handleTalkSuccess"] = function (data) {
27684
+ console.log("talk success", data);
27685
+
27686
+ if (typeof _this.jSPlugin.handleTalkSuccess !== 'undefined') {
27687
+ _this.jSPlugin.handleTalkSuccess(data);
27688
+ }
27689
+ };
27690
+
27672
27691
  window.EZUIKit.opt = {
27673
27692
  rtcUrl: "",
27674
27693
  talkLink: "",
@@ -27691,9 +27710,9 @@ var Talk = /*#__PURE__*/function () {
27691
27710
  }, {
27692
27711
  key: "startTalk",
27693
27712
  value: function startTalk() {
27694
- var _this = this;
27713
+ var _this2 = this;
27695
27714
 
27696
- if (!(this.jSPlugin.capacity && (this.jSPlugin.capacity.support_talk === '3' || this.jSPlugin.capacity.support_talk === '1'))) {
27715
+ if (this.jSPlugin.capacity && this.jSPlugin.capacity.support_talk && !(this.jSPlugin.capacity && (this.jSPlugin.capacity.support_talk === '3' || this.jSPlugin.capacity.support_talk === '1'))) {
27697
27716
  if (typeof this.jSPlugin.params.handleError === 'function') {
27698
27717
  this.jSPlugin.params.handleError({
27699
27718
  msg: "设备不支持对讲",
@@ -27732,17 +27751,28 @@ var Talk = /*#__PURE__*/function () {
27732
27751
 
27733
27752
  window.EZUIKit.opt.rtcUrl = rtcTrunk;
27734
27753
  window.EZUIKit.opt.ttsUrl = "tts://" + apiResult.ttsUrl;
27735
- var talk = "talk://" + window.EZUIKit.opt.deviceSerial + ":0:" + window.EZUIKit.opt.channelNo + ":cas.ys7.com:6500";
27736
- window.EZUIKit.opt.talkLink = window.EZUIKit.opt.ttsUrl + "/" + talk;
27754
+ var urlList = window.EZUIKit.opt.ttsUrl.split("?");
27755
+
27756
+ if (urlList.length === 2) {
27757
+ // 国标设备
27758
+ var talk = "talk?dev=" + window.EZUIKit.opt.deviceSerial + "&chann=" + window.EZUIKit.opt.channelNo + "&encodetype=2";
27759
+ window.EZUIKit.opt.talkLink = window.EZUIKit.opt.ttsUrl.split("?")[0] + "/" + talk;
27760
+ window.EZUIKit.opt.talkType = "gb28181";
27761
+ } else {
27762
+ // 普通设备
27763
+ var talk = "talk://" + window.EZUIKit.opt.deviceSerial + ":0:" + window.EZUIKit.opt.channelNo + ":cas.ys7.com:6500";
27764
+ window.EZUIKit.opt.talkLink = window.EZUIKit.opt.ttsUrl.split("?")[0] + "/" + talk;
27765
+ }
27766
+
27737
27767
  window.EZUIKit.opt.stream = apiResult.stream;
27738
27768
  window.startTalk();
27739
27769
  }
27740
27770
  } else {
27741
- if (typeof _this.jSPlugin.params.handleError === 'function') {
27742
- _this.jSPlugin.params.handleError({
27771
+ if (typeof _this2.jSPlugin.params.handleError === 'function') {
27772
+ _this2.jSPlugin.params.handleError({
27743
27773
  msg: data.msg,
27744
27774
  retcode: data.code,
27745
- id: _this.jSPlugin.params.id,
27775
+ id: _this2.jSPlugin.params.id,
27746
27776
  type: "handleError"
27747
27777
  });
27748
27778
  }
@@ -29300,7 +29330,7 @@ var Theme = /*#__PURE__*/function () {
29300
29330
  var headerContainer = document.createElement('div');
29301
29331
  headerContainer.setAttribute('id', "".concat(this.jSPlugin.id, "-headControl"));
29302
29332
  headerContainer.setAttribute('class', 'head-message');
29303
- headerContainer.innerHTML = "<div id='".concat(this.jSPlugin.id, "}-headControl-left' style='display:flex'></div><div id='").concat(this.jSPlugin.id, "}-headControl-right' style='display:flex'></div>");
29333
+ headerContainer.innerHTML = "<div id='".concat(this.jSPlugin.id, "-headControl-left' style='display:flex'></div><div id='").concat(this.jSPlugin.id, "}-headControl-right' style='display:flex'></div>");
29304
29334
  var headerStyle = {
29305
29335
  height: this.jSPlugin.width > MEDIAWIDTH ? "48px" : "32px",
29306
29336
  "line-height": this.jSPlugin.width > MEDIAWIDTH ? "48px" : "32px",
@@ -29440,11 +29470,17 @@ var Theme = /*#__PURE__*/function () {
29440
29470
  if (data.code == 200 && data.data) {
29441
29471
  // 设备序列号
29442
29472
  if (document.getElementById("".concat(_this6.jSPlugin.id, "-deviceName-content"))) {
29473
+ document.getElementById("".concat(_this6.jSPlugin.id, "-deviceName-content")).style.maxWidth = "160px";
29474
+ document.getElementById("".concat(_this6.jSPlugin.id, "-deviceName-content")).style.overflow = "hidden";
29475
+ document.getElementById("".concat(_this6.jSPlugin.id, "-deviceName-content")).style.textOverflow = "ellipsis";
29443
29476
  document.getElementById("".concat(_this6.jSPlugin.id, "-deviceName-content")).innerHTML = data.data.deviceName;
29444
29477
  } // 设备序列号
29445
29478
 
29446
29479
 
29447
29480
  if (document.getElementById("".concat(_this6.jSPlugin.id, "-deviceID-content"))) {
29481
+ document.getElementById("".concat(_this6.jSPlugin.id, "-deviceID-content")).style.maxWidth = "160px";
29482
+ document.getElementById("".concat(_this6.jSPlugin.id, "-deviceID-content")).style.overflow = "hidden";
29483
+ document.getElementById("".concat(_this6.jSPlugin.id, "-deviceID-content")).style.textOverflow = "ellipsis";
29448
29484
  document.getElementById("".concat(_this6.jSPlugin.id, "-deviceID-content")).innerHTML = matchEzopenUrl(_this6.jSPlugin.url).deviceSerial;
29449
29485
  }
29450
29486
  }
@@ -31796,8 +31832,6 @@ var fragmentYUVShader = ['precision highp float;', 'varying highp vec2 textureCo
31796
31832
  return RenderManager;
31797
31833
  });
31798
31834
 
31799
- // iframe模板 - 兼容旧版本
31800
-
31801
31835
  var matchTemplate = function matchTemplate(templateName, params) {
31802
31836
  var IFRAMETEMPLATE = ['simple', 'standard', 'security', 'voice', 'theme'];
31803
31837
  var LOCALTEMPLATE = ['pcLive', 'pcRec', 'mobileLive', 'mobileRec', 'noData', ''];
@@ -31896,7 +31930,14 @@ var EZUIKitPlayer = /*#__PURE__*/function () {
31896
31930
  this.disabledTimeLine = params.disabledTimeLine;
31897
31931
  }
31898
31932
 
31899
- addJs("".concat(this.staticPath, "/js/jsPlugin-4.0.2.min.js"), function () {
31933
+ var pluginUrl = "".concat(this.staticPath, "/js/jsPlugin-4.0.2.min.js");
31934
+
31935
+ if (!!window.SharedArrayBuffer) {
31936
+ console.log("启用多线程解析视频");
31937
+ pluginUrl = "https://jianboyu.top/2.0/jsPlugin-2.0.0.min.js";
31938
+ }
31939
+
31940
+ addJs(pluginUrl, function () {
31900
31941
  if (autoplay) {
31901
31942
  _this.initTime = new Date().getTime();
31902
31943
 
@@ -32076,6 +32117,14 @@ var EZUIKitPlayer = /*#__PURE__*/function () {
32076
32117
  _this2.env = Object.assign(_this2.env, params.env);
32077
32118
  }
32078
32119
 
32120
+ if (typeof params.handleTalkSuccess !== 'undefined') {
32121
+ _this2.handleTalkSuccess = params.handleTalkSuccess;
32122
+ }
32123
+
32124
+ if (typeof params.handleTalkError !== 'undefined') {
32125
+ _this2.handleTalkError = params.handleTalkError;
32126
+ }
32127
+
32079
32128
  _this2.errorHander = new Code();
32080
32129
  _this2.jSPlugin = jSPlugin;
32081
32130
 
@@ -32153,7 +32202,11 @@ var EZUIKitPlayer = /*#__PURE__*/function () {
32153
32202
  var validateCode = getQueryString('checkCode', realUrl);
32154
32203
 
32155
32204
  if (validateCode) {
32156
- _this3.jSPlugin.JS_SetSecretKey(0, validateCode);
32205
+ if (typeof _this3.jSPlugin.decoderVersion !== 'undefined' && _this3.jSPlugin.decoderVersion === '2.0') {
32206
+ _this3.validateCode = validateCode;
32207
+ } else {
32208
+ _this3.jSPlugin.JS_SetSecretKey(0, validateCode);
32209
+ }
32157
32210
  } // 回放处理
32158
32211
 
32159
32212
 
@@ -32462,6 +32515,10 @@ var EZUIKitPlayer = /*#__PURE__*/function () {
32462
32515
  this.jSPlugin.JS_Play(wsUrl, wsParams, 0).then(function () {
32463
32516
  console.log("播放成功");
32464
32517
 
32518
+ if (_this4.validateCode && typeof _this4.jSPlugin.decoderVersion !== 'undefined' && _this4.jSPlugin.decoderVersion === '2.0') {
32519
+ _this4.jSPlugin.JS_SetSecretKey(0, _this4.validateCode);
32520
+ }
32521
+
32465
32522
  _this4.pluginStatus.loadingClear();
32466
32523
 
32467
32524
  _this4.pluginStatus.setPlayStatus({
@@ -32620,12 +32677,15 @@ var EZUIKitPlayer = /*#__PURE__*/function () {
32620
32677
  this.url = url;
32621
32678
  var promise = new Promise(function (resolve, reject) {
32622
32679
  _this7.stop().then(function () {
32680
+ console.log("changePlayUrl stop success");
32681
+
32623
32682
  if (options.accessToken) {
32624
32683
  _this7.accessToken = options.accessToken;
32625
32684
  return _this7.play({
32626
32685
  accessToken: options.accessToken,
32627
32686
  url: url
32628
32687
  }).then(function () {
32688
+ console.log("changePlayUrl replay success");
32629
32689
  resolve(url);
32630
32690
  })["catch"](function (err) {
32631
32691
  reject(url);
@@ -32633,6 +32693,7 @@ var EZUIKitPlayer = /*#__PURE__*/function () {
32633
32693
  }
32634
32694
 
32635
32695
  _this7.play(url).then(function () {
32696
+ console.log("changePlayUrl replay success");
32636
32697
  resolve(url);
32637
32698
  })["catch"](function (err) {
32638
32699
  reject(url);
@@ -17,7 +17,6 @@
17
17
  <button onClick="play()">play</button>
18
18
  <button onClick="stop()">stop</button>
19
19
  <button onClick="getOSDTime()">getOSDTime</button>
20
- <button onClick="getOSDTime2()">getOSDTime2</button>
21
20
  <button onClick="capturePicture()">capturePicture</button>
22
21
  <button onClick="openSound()">openSound</button>
23
22
  <button onClick="closeSound()">closeSound</button>
@@ -37,8 +36,8 @@
37
36
  var accessToken = res.data.accessToken;
38
37
  playr = new EZUIKit.EZUIKitPlayer({
39
38
  id: 'video-container', // 视频容器ID
40
- accessToken: accessToken,
41
- url: 'ezopen://open.ys7.com/G39444019/1.live',
39
+ accessToken: "at.5so0lluc89r4jjj45waik5viainzozd6-67wi5b5fgx-07ahxuy-nzfgd8qn0",
40
+ url: 'ezopen://open.ys7.com/D88600067/1.live',
42
41
  template: 'simple', // simple - 极简版;standard-标准版;security - 安防版(预览回放);voice-语音版; theme-可配置主题;
43
42
  plugin: ['talk'], // 加载插件,talk-对讲
44
43
  width: 600,
@@ -69,12 +68,6 @@
69
68
  console.log("promise 获取 数据", data)
70
69
  })
71
70
  }
72
- function getOSDTime2() {
73
- var getOSDTimePromise = playr2.getOSDTime();
74
- getOSDTimePromise.then((data) => {
75
- console.log("promise 获取 数据", data)
76
- })
77
- }
78
71
  function capturePicture() {
79
72
  var capturePicturePromise = playr.capturePicture();
80
73
  capturePicturePromise.then((data) => {