ezuikit-js 0.4.8 → 0.4.9

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 (2) hide show
  1. package/ezuikit.js +39 -39
  2. package/package.json +1 -1
package/ezuikit.js CHANGED
@@ -324,10 +324,17 @@ class Status {
324
324
  constructor(jSPlugin,id) {
325
325
  this.id = id;
326
326
  this.jSPlugin = jSPlugin;
327
+ this.state = {
328
+ play: false,
329
+ loading: false,
330
+ };
327
331
  }
328
332
  toString() {
329
333
  return `${this.coreX}-${this.coreY}`;
330
334
  }
335
+ setPlayStatus(options) {
336
+ this.state = Object.assign(this.state, options);
337
+ }
331
338
  loadingStart(id) {
332
339
  var oS = document.createElement('style');
333
340
  document.getElementsByTagName("head")[0].appendChild(oS);
@@ -24832,10 +24839,15 @@ class MobileRec {
24832
24839
  this.jSPlugin.changePlayUrl({
24833
24840
  begin: date,
24834
24841
  type: this.type
24842
+ }).then(()=> {
24843
+ setTimeout(()=>{
24844
+ this.syncTimeLine();
24845
+ }, 4000);
24835
24846
  });
24836
24847
  };
24837
24848
  const ontouchstart = () => {
24838
24849
  this.operating = true;
24850
+ this.unSyncTimeLine();
24839
24851
  // if (currentTimer) {
24840
24852
  // clearInterval(currentTimer)
24841
24853
  // }
@@ -24886,32 +24898,7 @@ class MobileRec {
24886
24898
  // $("#cloudType").attr("checked", recType == '2');
24887
24899
  // $("#cloudType .device svg").attr("checked", recType == '2');
24888
24900
  });
24889
- var dateFormat = function (now) {
24890
- var time = new Date(now);
24891
- var h = time.getHours(); //返回日期中的小时数(0到23)
24892
- var m = time.getMinutes(); //返回日期中的分钟数(0到59)
24893
- var s = time.getSeconds(); //返回日期中的秒数(0到59)
24894
- return (h > 9 ? h : '0' + h) + ':' + (m > 9 ? m : '0' + m) + ':' + (s > 9 ? s : '0' + s);
24895
- };
24896
- this.timer = setInterval(() => {
24897
- // 定时器
24898
- console.log("定时器", this.jSPlugin.getOSDTime());
24899
- if (this.operating) {
24900
- console.log("操作中");
24901
- return false;
24902
- }
24903
- this.jSPlugin.getOSDTime()
24904
- .then((data)=>{
24905
- if (data.data > 0) {
24906
- this.TimeLineOBJ.stepScrollTimeLine(dateFormat(data.data * 1000));
24907
- } else {
24908
- console.log("未找到当前获取播放时间,等待中...");
24909
- }
24910
- })
24911
- .catch((err)=>{
24912
- console.log("未找到当前获取播放时间,等待中...");
24913
- });
24914
- }, 1000);
24901
+ this.syncTimeLine();
24915
24902
  }
24916
24903
  fetchDeviceRec() {
24917
24904
  const doRender = (result) => {
@@ -24957,23 +24944,32 @@ class MobileRec {
24957
24944
  }
24958
24945
 
24959
24946
  syncTimeLine() {
24947
+ var dateFormat = function (now) {
24948
+ var time = new Date(now);
24949
+ var h = time.getHours(); //返回日期中的小时数(0到23)
24950
+ var m = time.getMinutes(); //返回日期中的分钟数(0到59)
24951
+ var s = time.getSeconds(); //返回日期中的秒数(0到59)
24952
+ return (h > 9 ? h : '0' + h) + ':' + (m > 9 ? m : '0' + m) + ':' + (s > 9 ? s : '0' + s);
24953
+ };
24960
24954
  if (this.timer) {
24961
24955
  clearInterval(this.timer);
24962
24956
  }
24963
24957
  this.timer = setInterval(() => {
24964
- var getOSDTimePromise = this.jSPlugin.getOSDTime();
24965
- getOSDTimePromise.then((v) => {
24966
- if (v == -1) {
24967
- console.log("获取播放时间错误");
24968
- } else {
24969
- if (v > 0) {
24970
- //console.log("获取播放时间", v, this.timeLine.run);
24971
- this.timeLine.run({ time: new Date(v > 1000000000000 ? v : v * 1000) });
24972
- //$(".current-time").text(new Date(new Date(v > 1000000000000 ? v : v * 1000)).Format('yyyy-MM-dd hh:mm:ss'))
24958
+ // 定时器
24959
+ if (this.operating) {
24960
+ console.log("操作中");
24961
+ return false;
24962
+ }
24963
+ this.jSPlugin.getOSDTime()
24964
+ .then((res)=>{
24965
+ if (res.data > 0) {
24966
+ this.TimeLineOBJ.stepScrollTimeLine(dateFormat(res.data * 1000));
24967
+ } else {
24968
+ console.log("未找到当前获取播放时间,等待中...");
24973
24969
  }
24974
- }
24975
- })
24976
- .catch((err) => {
24970
+ })
24971
+ .catch((err)=>{
24972
+ console.log("未找到当前获取播放时间,等待中...");
24977
24973
  });
24978
24974
  }, 1000);
24979
24975
  }
@@ -26964,7 +26960,7 @@ class Theme {
26964
26960
  }
26965
26961
  var isNeedRenderTimeLine = lodash.findIndex(this.themeData.header.btnList, (v)=>{
26966
26962
  return (v.iconId === 'cloudRec' && v.isrender === 1) || (v.iconId === 'rec' && v.isrender === 1) ;
26967
- }) >= 0 || (this.isMobile &&matchEzopenUrl(jSPlugin.url).type.indexOf('rec') !== -1);
26963
+ }) >= 0 || (this.isMobile &&matchEzopenUrl(this.jSPlugin.url).type.indexOf('rec') !== -1);
26968
26964
  if (isNeedRenderTimeLine) {
26969
26965
  if (this.isMobile) {
26970
26966
  this.Rec = new MobileRec(this.jSPlugin);
@@ -29841,6 +29837,7 @@ class EZUIKitPlayer {
29841
29837
  this.jSPlugin.JS_Play(wsUrl, wsParams, 0).then(() => {
29842
29838
  console.log("播放成功");
29843
29839
  this.pluginStatus.loadingClear();
29840
+ this.pluginStatus.setPlayStatus({play: true, loading: false});
29844
29841
  if (this.Theme) {
29845
29842
  this.Theme.setDecoderState({ play: true });
29846
29843
  }
@@ -29888,6 +29885,7 @@ class EZUIKitPlayer {
29888
29885
  });
29889
29886
  }
29890
29887
  play(options) {
29888
+ this.pluginStatus.setPlayStatus({play: false, loading: true});
29891
29889
  this.playStartTime = new Date().getTime();
29892
29890
  this.Monitor.dclog({
29893
29891
  url: this.url,
@@ -29931,8 +29929,10 @@ class EZUIKitPlayer {
29931
29929
  return promise;
29932
29930
  }
29933
29931
  stop() {
29932
+ this.pluginStatus.setPlayStatus({loading: true});
29934
29933
  return this.jSPlugin.JS_Stop(0).then(() => {
29935
29934
  console.log("停止成功");
29935
+ this.pluginStatus.setPlayStatus({play: false,loading: false});
29936
29936
  if (this.Theme) {
29937
29937
  this.Theme.setDecoderState({ play: false });
29938
29938
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ezuikit-js",
3
- "version": "0.4.8",
3
+ "version": "0.4.9",
4
4
  "description": "ezuikit javascript for npm",
5
5
  "main": "ezuikit.js",
6
6
  "scripts": {