ezuikit-js 0.6.2 → 0.6.3

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/CHANGELOG.md CHANGED
@@ -1,3 +1,14 @@
1
+ v 0.6.3
2
+
3
+ [feta]支持模板内回放时间轴自定义设置拖动防抖间隔
4
+
5
+ [feta]支持模板内网页全屏状态下调用日历切换日期
6
+
7
+ [fix]修复单线程模式下,设备断网视频未保留最后一帧问题
8
+
9
+ [fix]修复模板内使用电子放大开启中切换设备未重置问题
10
+
11
+
1
12
  v 0.6.2
2
13
 
3
14
  [feta] 支持用户通过开启谷歌实验室特性启动多线程解码
package/README.md CHANGED
@@ -268,7 +268,6 @@ themeData将主题数据本地化,设置本地数据,需要删除template参
268
268
  </td><td>N</td></tr>
269
269
  <tr><td>plugin</td><td>String</td><td>按需加载插件,可选值: talk:对讲,示例:plugin:["talk"] </td><td>N</td></tr>
270
270
  <tr><td>handleSuccess</td><td>function</td><td>自动播放成功回调</td><td>N</td></tr>
271
- <tr><td>poster</td><td>String</td><td>视频默认封面 版本号> v0.4.6 </td><td>N</td></tr>
272
271
  </table>
273
272
 
274
273
 
@@ -16112,6 +16112,12 @@ var Rec = /*#__PURE__*/function () {
16112
16112
  this.datepickerVisible = false;
16113
16113
  this.seekTimer = null;
16114
16114
  this.disabled = false;
16115
+ this.seekFrequency = 2000;
16116
+
16117
+ if (this.jSPlugin.params && this.jSPlugin.params.seekFrequency) {
16118
+ this.seekFrequency = this.jSPlugin.params.seekFrequency;
16119
+ }
16120
+
16115
16121
  var canvasItemWidth = parseInt(getComputedStyle(document.getElementById(jSPlugin.id)).width, 10) - 100;
16116
16122
  var canvasContainer = document.createElement('div');
16117
16123
  canvasContainer.style = "display:inline-block;height:48px;";
@@ -16161,12 +16167,12 @@ var Rec = /*#__PURE__*/function () {
16161
16167
  cloudSeek();
16162
16168
  clearTimeout(_this.seekTimer);
16163
16169
  _this.seekTimer = null;
16164
- }, 2000);
16170
+ }, _this.seekFrequency);
16165
16171
  } else {
16166
16172
  var callback = function callback() {
16167
16173
  setTimeout(function () {
16168
16174
  _this.disabled = false;
16169
- }, 2000);
16175
+ }, _this.seekFrequency);
16170
16176
  };
16171
16177
 
16172
16178
  var localRecSeek = function localRecSeek(callback) {
@@ -16220,7 +16226,7 @@ var Rec = /*#__PURE__*/function () {
16220
16226
 
16221
16227
  _this.seekTimer = setTimeout(function () {
16222
16228
  localRecSeek(callback);
16223
- }, 2000);
16229
+ }, _this.seekFrequency);
16224
16230
  } else {
16225
16231
  localRecSeek(callback);
16226
16232
  }
@@ -16234,15 +16240,25 @@ var Rec = /*#__PURE__*/function () {
16234
16240
  addJs("".concat(_this.jSPlugin.staticPath, "/rec/datepicker.js"), function () {
16235
16241
  addJs("".concat(_this.jSPlugin.staticPath, "/rec/datepicker.zh-CN.js"), function () {
16236
16242
  // 日期选择:
16237
- $("#".concat(_this.jSPlugin.id, "-datepicker")).datepicker({
16238
- autoShow: false,
16239
- autoHide: true,
16240
- autoPick: true,
16241
- language: 'zh-CN',
16242
- defaultDate: new Date(),
16243
- format: 'yyyy-mm-dd',
16244
- endDate: new Date()
16245
- });
16243
+ if (!document.getElementsByClassName("datepicker-container")[0]) {
16244
+ $("#".concat(_this.jSPlugin.id, "-datepicker")).datepicker({
16245
+ autoShow: false,
16246
+ autoHide: true,
16247
+ autoPick: true,
16248
+ language: 'zh-CN',
16249
+ defaultDate: new Date(),
16250
+ format: 'yyyy-mm-dd',
16251
+ endDate: new Date(),
16252
+ inline: true,
16253
+ container: document.getElementById("".concat(_this.jSPlugin.id, "-wrap"))
16254
+ });
16255
+ }
16256
+
16257
+ if (document.getElementsByClassName("datepicker-container")[0]) {
16258
+ document.getElementsByClassName("datepicker-container")[0].style.display = "none";
16259
+ }
16260
+
16261
+ _this.datepickerVisible = false;
16246
16262
  $("#".concat(_this.jSPlugin.id, "-datepicker")).on('pick.datepicker', function (e) {
16247
16263
  console.log("重新选择日期", e.date, new Date(e.date).Format('yyyyMMdd'), new Date(document.getElementById("".concat(_this.jSPlugin.id, "-datepicker")).value).Format('yyyyMMdd'));
16248
16264
 
@@ -16256,16 +16272,27 @@ var Rec = /*#__PURE__*/function () {
16256
16272
  });
16257
16273
  }
16258
16274
 
16259
- $('#datepicker').datepicker('hide');
16275
+ if (document.getElementsByClassName("datepicker-container")[0]) {
16276
+ document.getElementsByClassName("datepicker-container")[0].style.display = "none";
16277
+ }
16278
+
16260
16279
  _this.datepickerVisible = false;
16261
- }); // $(`#${this.jSPlugin.id}-datepicker`).click((e) => {
16262
- // if (this.datepickerVisible) {
16263
- // $(`#${this.jSPlugin.id}-datepicker`).datepicker('hide');
16264
- // } else {
16265
- // $(`#${this.jSPlugin.id}-datepicker`).datepicker('show');
16266
- // }
16267
- // this.datepickerVisible = !this.datepickerVisible;
16268
- // });
16280
+ });
16281
+ $("#".concat(_this.jSPlugin.id, "-datepicker")).off('click').on("click", function (e) {
16282
+ console.log("点击日期");
16283
+
16284
+ if (!_this.datepickerVisible) {
16285
+ if (document.getElementsByClassName("datepicker-container")[0]) {
16286
+ document.getElementsByClassName("datepicker-container")[0].style.display = "inline";
16287
+ }
16288
+ } else {
16289
+ if (document.getElementsByClassName("datepicker-container")[0]) {
16290
+ document.getElementsByClassName("datepicker-container")[0].style.display = "none";
16291
+ }
16292
+ }
16293
+
16294
+ _this.datepickerVisible = !_this.datepickerVisible;
16295
+ });
16269
16296
  });
16270
16297
  });
16271
16298
  }); // 尺度变化监听
@@ -16989,6 +17016,12 @@ var MobileRec = /*#__PURE__*/function () {
16989
17016
  this.operating = false;
16990
17017
  this.seekTimer = null;
16991
17018
  this.disabled = false;
17019
+ this.seekFrequency = 2000;
17020
+
17021
+ if (this.jSPlugin.params && this.jSPlugin.params.seekFrequency) {
17022
+ this.seekFrequency = this.jSPlugin.params.seekFrequency;
17023
+ }
17024
+
16992
17025
  var oS = document.createElement('style');
16993
17026
  oS.innerHTML = "\n body{\n padding: 0;\n margin: 0;\n }\n .time-line-container {\n text-align: left;\n height: 300px;\n /* outline: 1px solid red; */\n /* background: gray; */\n position: relative;\n /* padding-top: 60px; */\n margin-top: 20px;\n }\n\n .time-line-container .time-line-item-container {\n display: inline-block;\n /* height: 400px; */\n width: 30%;\n /* background: indianred; */\n overflow-y: scroll;\n overflow-x: hidden;\n /* padding-top: 60px; */\n height: 300px;\n box-sizing: border-box;\n white-space: nowrap;\n position: relative;\n }\n\n .time-line-container .time-line-item-container::-webkit-scrollbar {\n width: 0px;\n /*\u6EDA\u52A8\u6761\u5BBD\u5EA6*/\n height: 0px;\n /*\u6EDA\u52A8\u6761\u9AD8\u5EA6*/\n }\n\n .time-line-item .time-item {\n position: relative;\n box-sizing: border-box;\n height: 60px;\n font-size: 12px;\n color: rgb(150, 150, 150);\n border-right: 6px solid;\n border-right-color: #ddd;\n }\n\n .time-line-item .time-item .scale {\n width: 6px;\n height: 9px;\n border-bottom: 1px solid #ccc;\n float: right;\n clear: both;\n }\n\n .time-line-item .time-item .item-unavail {\n width: 6px;\n position: absolute;\n left: 100%;\n background-color: #ddd;\n }\n\n .time-line-container .current-time {\n position: absolute;\n left: 0;\n top: 40px;\n height: 29px;\n /* line-height: 58px; */\n border-bottom: 1px solid #648FFC;\n width: 60%;\n margin-left: 26%;\n }\n\n .time-line-container .current-time .current-time-bg {\n position: relative;\n top: 15px;\n width: 100px;\n height: 29px;\n line-height: 29px;\n left: -70px;\n font-size: 12px;\n color: #2C2C2C;\n }\n\n .time-line-container .current-time .current-time-bg::before {\n content: '';\n display: inline-block;\n width: 6px;\n height: 6px;\n border-radius: 100%;\n background: #648FFC;\n top: 11px;\n position: absolute;\n right: 30px;\n }\n\n .date-switch-container {\n height: 40px;\n position: relative;\n text-align: center;\n margin: 20px 10px;\n }\n\n .date-switch-container .current-date {\n line-height: 40px;\n height: 22px;\n font-size: 16px;\n color: #2C2C2C;\n text-align: center;\n font-weight: bold;\n }\n\n .date-container {\n width: 40px;\n height: 40px;\n position: absolute;\n right: 0;\n top: 0;\n }\n\n .rec-type-container {\n display: flex;\n justify-content: space-between;\n }\n\n .rec-type-container .rec-type-text {\n padding: 0 15px;\n font-size: 12px;\n color: #2C2C2C;\n }\n\n .rec-type-container .rec-type-switch {\n padding: 0 20px;\n }\n\n .date-container input {\n position: absolute;\n opacity: 0;\n display: inline-block;\n width: 40px;\n height: 40px;\n z-index: 10;\n left: 0;\n }\n\n .date-container label {\n position: absolute;\n left: 0;\n top: 0;\n /* display: none; */\n z-index: 0;\n }\n\n .date-icon {\n display: inline-block;\n width: 40px;\n height: 40px;\n background: url('https://resource.eziot.com/group2/M00/00/6A/CtwQF2F6VieAQrU9AAABP-_Nsqo949.png') no-repeat 100% 100%;\n }\n .select-container {\n padding: 10px;\n display: flex;\n justify-content: space-between;\n }\n\n .advice {\n height: 24px;\n width: 70px;\n display: flex;\n justify-content: space-between;\n line-height: 24px;\n background: #F8F8F8;\n border-radius: 8px;\n }\n\n .advice span {\n width: 40px;\n display: inline-block;\n }\n\n input[type=\"checkbox\"]:not(:checked)+.advice span:first-child {\n box-shadow: 0px 2px 5px 0px rgb(23 45 101 / 20%);\n border-radius: 8px;\n text-align: center;\n\n }\n\n input[type=\"checkbox\"]:checked+.advice span:last-child {\n box-shadow: 0px 2px 5px 0px rgb(23 45 101 / 20%);\n border-radius: 8px;\n text-align: center;\n }\n\n input[type=\"checkbox\"]:not(:checked)+.advice span:first-child svg {\n fill: #648FFC !important;\n }\n\n input[type=\"checkbox\"]:checked+.advice span:last-child svg {\n fill: #648FFC !important;\n }";
16994
17027
  document.getElementsByTagName("head")[0].appendChild(oS);
@@ -17057,19 +17090,20 @@ var MobileRec = /*#__PURE__*/function () {
17057
17090
  clearTimeout(_this.seekTimer);
17058
17091
  } else {
17059
17092
  cloudSeek();
17060
- } // 限制每2秒只触发一次拖动
17093
+ }
17061
17094
 
17095
+ console.log("this.jsPlug", _this.jSPlugin.params); // 限制每2秒只触发一次拖动
17062
17096
 
17063
17097
  _this.seekTimer = setTimeout(function () {
17064
17098
  cloudSeek();
17065
17099
  clearTimeout(_this.seekTimer);
17066
17100
  _this.seekTimer = null;
17067
- }, 2000);
17101
+ }, _this.seekFrequency);
17068
17102
  } else {
17069
17103
  var callback = function callback() {
17070
17104
  setTimeout(function () {
17071
17105
  _this.disabled = false;
17072
- }, 2000);
17106
+ }, _this.seekFrequency);
17073
17107
  };
17074
17108
 
17075
17109
  var localRecSeek = function localRecSeek(callback) {
@@ -17123,7 +17157,7 @@ var MobileRec = /*#__PURE__*/function () {
17123
17157
 
17124
17158
  _this.seekTimer = setTimeout(function () {
17125
17159
  localRecSeek(callback);
17126
- }, 2000);
17160
+ }, _this.seekFrequency);
17127
17161
  } else {
17128
17162
  // 限制每2秒只触发一次拖动
17129
17163
  localRecSeek(callback);
@@ -29769,6 +29803,14 @@ var Theme = /*#__PURE__*/function () {
29769
29803
  // this.startAutoFocus();
29770
29804
  // })
29771
29805
  }
29806
+ } else {
29807
+ var _checkTimer = setInterval(function () {
29808
+ if (window.EZUIKit[_this4.jSPlugin.id].state.EZUIKitPlayer.init) {
29809
+ clearInterval(_checkTimer);
29810
+
29811
+ _this4.jSPlugin.play();
29812
+ }
29813
+ }, 50);
29772
29814
  }
29773
29815
 
29774
29816
  var isNeedRoom = lodash.findIndex(this.themeData.footer.btnList, function (v) {
@@ -31090,9 +31132,9 @@ var Theme = /*#__PURE__*/function () {
31090
31132
  headerContainer.style = styleToString(headerStyle);
31091
31133
  document.getElementById("".concat(videoId, "-wrap")).insertBefore(headerContainer, document.getElementById(videoId)); // 头部预留x像素空间
31092
31134
 
31093
- var _checkTimer = setInterval(function () {
31135
+ var _checkTimer2 = setInterval(function () {
31094
31136
  if (window.EZUIKit[_this10.jSPlugin.id].state.EZUIKitPlayer.init) {
31095
- clearInterval(_checkTimer); // 检测到渲染头部,执行一次reSize
31137
+ clearInterval(_checkTimer2); // 检测到渲染头部,执行一次reSize
31096
31138
  // this.jSPlugin.reSize(this.jSPlugin.params.width,this.jSPlugin.params.height);
31097
31139
  }
31098
31140
  }, 50);
@@ -31168,9 +31210,9 @@ var Theme = /*#__PURE__*/function () {
31168
31210
  } else {
31169
31211
  this.Rec = new Rec(this.jSPlugin); // 回放时间轴预留48像素空间
31170
31212
 
31171
- var _checkTimer2 = setInterval(function () {
31213
+ var _checkTimer3 = setInterval(function () {
31172
31214
  if (window.EZUIKit[_this10.jSPlugin.id].state.EZUIKitPlayer.init) {
31173
- clearInterval(_checkTimer2); // 检测到渲染回放时间轴,执行一次reSize
31215
+ clearInterval(_checkTimer3); // 检测到渲染回放时间轴,执行一次reSize
31174
31216
  // this.jSPlugin.reSize(this.jSPlugin.params.width, this.jSPlugin.params.height);
31175
31217
  }
31176
31218
  }, 50);
@@ -31300,6 +31342,99 @@ var Theme = /*#__PURE__*/function () {
31300
31342
  isEditing: false
31301
31343
  });
31302
31344
  }
31345
+ }, {
31346
+ key: "webExpend",
31347
+ value: function webExpend() {
31348
+ var _this12 = this;
31349
+
31350
+ var _this$decoderState$st = this.decoderState.state;
31351
+ _this$decoderState$st.webExpend;
31352
+ var expend = _this$decoderState$st.expend,
31353
+ play = _this$decoderState$st.play;
31354
+
31355
+ if (!play) {
31356
+ return false;
31357
+ }
31358
+
31359
+ if (expend) {
31360
+ console.log("正在全局全屏");
31361
+ return false;
31362
+ }
31363
+
31364
+ console.log("执行网页全屏");
31365
+ var footerDOMHeight = 0;
31366
+ var headerDOMHeight = 0; // ['fullscreenchange', 'webkitfullscreenchange', 'mozfullscreenchange'].forEach((item) => {
31367
+ // window.addEventListener(item, (data) => fullscreenchange("fullscreenchange", data));
31368
+ // });
31369
+ // // 监听全屏事件触发
31370
+ // function fullscreenchange() {
31371
+ // let isFullScreen = document.fullScreen || document.mozFullScreen || document.webkitIsFullScreen;
31372
+ // return isFullScreen;
31373
+ // }
31374
+
31375
+ var promise = requestFullScreenPromise(document.getElementById("".concat(this.jSPlugin.id, "-wrap")));
31376
+ promise.then(function (data) {
31377
+ console.log("全屏promise", window.screen.availWidth);
31378
+
31379
+ if (document.getElementById("".concat(_this12.jSPlugin.id, "-canvas-container"))) {
31380
+ footerDOMHeight = parseInt(window.getComputedStyle(document.getElementById("".concat(_this12.jSPlugin.id, "-canvas-container"))).height, 10);
31381
+ }
31382
+
31383
+ if (document.getElementById("".concat(_this12.jSPlugin.id, "-headControl"))) {
31384
+ headerDOMHeight = parseInt(window.getComputedStyle(document.getElementById("".concat(_this12.jSPlugin.id, "-headControl"))).height, 10);
31385
+ }
31386
+
31387
+ console.log("this.jSPlugin.JS_Resiz", footerDOMHeight, headerDOMHeight, document.body.clientWidth);
31388
+
31389
+ _this12.jSPlugin.jSPlugin.JS_Resize(window.screen.availWidth, window.screen.availHeight - footerDOMHeight - headerDOMHeight);
31390
+ })["catch"](function (err) {
31391
+ console.log(err);
31392
+ });
31393
+ }
31394
+ }, {
31395
+ key: "expend",
31396
+ value: function expend() {
31397
+ var _this13 = this;
31398
+
31399
+ var _this$decoderState$st2 = this.decoderState.state,
31400
+ webExpend = _this$decoderState$st2.webExpend;
31401
+ _this$decoderState$st2.expend;
31402
+ var play = _this$decoderState$st2.play;
31403
+ _this$decoderState$st2.pantile;
31404
+
31405
+ if (!play) {
31406
+ return false;
31407
+ }
31408
+
31409
+ if (webExpend) {
31410
+ console.log("正在网站全屏");
31411
+ return false;
31412
+ }
31413
+
31414
+ console.log("执行全局全屏");
31415
+
31416
+ if (this.isMobile) {
31417
+ var heightIntercept = parseInt(getComputedStyle(document.getElementById("".concat(this.jSPlugin.id, "-wrap"))).height, 10) - parseInt(getComputedStyle(document.getElementById(this.jSPlugin.id)).height, 10);
31418
+ requestMobileFullScreen(document.getElementById("".concat(this.jSPlugin.id, "-wrap")));
31419
+ setTimeout(function () {
31420
+ var width = document.documentElement.clientWidth;
31421
+ var height = document.documentElement.clientHeight; // 兼容微信浏览器footer被隐藏
31422
+ // document.getElementById(`${this.jSPlugin.id}-ez-iframe-footer-container`).style.marginTop = "0px";
31423
+ // document.getElementById(`${this.jSPlugin.id}-headControl`).style.position = "absolute";
31424
+
31425
+ document.getElementById("".concat(_this13.jSPlugin.id)).style["backface-visibility"] = "hidden";
31426
+
31427
+ _this13.jSPlugin.jSPlugin.JS_Resize(height, width - heightIntercept);
31428
+ }, 100);
31429
+ } else {
31430
+ var promise = requestFullScreenPromise(document.getElementById("".concat(this.jSPlugin.id)));
31431
+ promise.then(function (data) {
31432
+ _this13.jSPlugin.jSPlugin.JS_Resize(window.screen.availWidth, window.screen.availHeight);
31433
+ })["catch"](function (err) {
31434
+ console.log(err);
31435
+ });
31436
+ }
31437
+ }
31303
31438
  }]);
31304
31439
 
31305
31440
  return Theme;
@@ -34168,6 +34303,11 @@ var EZUIKitPlayer = /*#__PURE__*/function () {
34168
34303
  if (this.themeId) {
34169
34304
  this.Theme = new Theme(this, params.id);
34170
34305
  window.EZUIKit[params.id].state.EZUIKitPlayer.themeInit = true;
34306
+ this.Monitor.dclog({
34307
+ url: this.url,
34308
+ action: 2,
34309
+ text: this.themeId
34310
+ });
34171
34311
 
34172
34312
  if (typeof this.params.handleThemeChange === 'function') {
34173
34313
  this.handleThemeChange = this.params.handleThemeChange;
@@ -34204,6 +34344,30 @@ var EZUIKitPlayer = /*#__PURE__*/function () {
34204
34344
  text: '初始化播放器完成'
34205
34345
  });
34206
34346
 
34347
+ jSPlugin.EventCallback = {
34348
+ pluginErrorHandler: function pluginErrorHandler(iWndIndex, iErrorCode, oError) {
34349
+ //插件错误回调
34350
+ console.log(iWndIndex, iErrorCode, oError);
34351
+
34352
+ if (iErrorCode === 1003) {
34353
+ console.log("断流");
34354
+
34355
+ _this2.pluginStatus.loadingSetText({
34356
+ text: "连接断开,请重试",
34357
+ color: 'red'
34358
+ });
34359
+
34360
+ if (typeof _this2.params.handleError === 'function') {
34361
+ _this2.params.handleError({
34362
+ msg: "连接断开,请重试",
34363
+ retcode: 1003,
34364
+ id: _this2.params.id,
34365
+ type: "handleError"
34366
+ });
34367
+ }
34368
+ }
34369
+ }
34370
+ };
34207
34371
  _this2.env = {
34208
34372
  domain: "https://open.ys7.com"
34209
34373
  };
@@ -34997,6 +35161,10 @@ var EZUIKitPlayer = /*#__PURE__*/function () {
34997
35161
  _this8.Theme.setDecoderState({
34998
35162
  zoom: false
34999
35163
  });
35164
+
35165
+ if (_this8.Zoom) {
35166
+ _this8.Zoom.stopZoom();
35167
+ }
35000
35168
  } // 对讲初始化
35001
35169
 
35002
35170
 
@@ -35014,7 +35182,17 @@ var EZUIKitPlayer = /*#__PURE__*/function () {
35014
35182
  accessToken: options.accessToken,
35015
35183
  url: url
35016
35184
  }).then(function () {
35017
- console.log("changePlayUrl replay success");
35185
+ console.log("changePlayUrl replay success"); // 当前处于网页全屏状态
35186
+
35187
+ if (_this8.Theme && _this8.Theme.decoderState.state.webExpend) {
35188
+ _this8.Theme.webExpend();
35189
+ } // 当前处于全屏状态
35190
+
35191
+
35192
+ if (_this8.Theme && _this8.Theme.decoderState.state.expend) {
35193
+ _this8.Theme.expend();
35194
+ }
35195
+
35018
35196
  resolve(url);
35019
35197
  })["catch"](function (err) {
35020
35198
  reject(url);
@@ -35022,7 +35200,17 @@ var EZUIKitPlayer = /*#__PURE__*/function () {
35022
35200
  }
35023
35201
 
35024
35202
  _this8.play(url).then(function () {
35025
- console.log("changePlayUrl replay success");
35203
+ console.log("changePlayUrl replay success"); // 当前处于网页全屏状态
35204
+
35205
+ if (_this8.Theme && _this8.Theme.decoderState.state.webExpend) {
35206
+ _this8.Theme.webExpend();
35207
+ } // 当前处于全屏状态
35208
+
35209
+
35210
+ if (_this8.Theme && _this8.Theme.decoderState.state.expend) {
35211
+ _this8.Theme.expend();
35212
+ }
35213
+
35026
35214
  resolve(url);
35027
35215
  })["catch"](function (err) {
35028
35216
  reject(url);