mtxt-ui3 0.0.34 → 0.0.36

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.
@@ -6497,7 +6497,7 @@ const Endpoint = RTCEndpoint;
6497
6497
  class WebRtcMt$1 {
6498
6498
  constructor(opt) {
6499
6499
  this.opt = opt;
6500
- this.p_player = vue.ref(null);
6500
+ this.p_player = vue.ref();
6501
6501
  this.init(opt);
6502
6502
  }
6503
6503
  opt;
@@ -6561,12 +6561,12 @@ class WebRtcMt$1 {
6561
6561
  resolve(res);
6562
6562
  } else {
6563
6563
  console.log("\u62C9\u6D41\u63A5\u53E3\u8FD4\u56DE\u5931\u8D25");
6564
- reject(false);
6564
+ reject("error");
6565
6565
  }
6566
6566
  });
6567
6567
  }).catch(err => {
6568
6568
  console.log("\u62C9\u6D41\u63A5\u53E3\u5931\u8D25");
6569
- reject(false);
6569
+ reject("error");
6570
6570
  });
6571
6571
  });
6572
6572
  }
@@ -6633,10 +6633,9 @@ class WebRtcMt$1 {
6633
6633
  console.log("\u5E95\u90E8\u505C\u6B62\u64AD\u653E");
6634
6634
  this.stopPlay();
6635
6635
  setTimeout(() => {
6636
- console.log("\u5E95\u90E8\u91CD\u64AD---");
6637
- this.p_player.value = false;
6638
- console.info("v2---", this.p_player.value);
6639
- }, 5 * 1e3);
6636
+ this.p_player.value = "error";
6637
+ console.log("\u5E95\u90E8\u91CD\u64AD", this.p_player.value);
6638
+ }, 3 * 1e3);
6640
6639
  }
6641
6640
  // 播放
6642
6641
  play(videoElm) {
@@ -6708,7 +6707,7 @@ const VideoPlayerV2 = vue.defineComponent({
6708
6707
  props: props$7,
6709
6708
  emits: ["changeStream"],
6710
6709
  setup(_prop, _context) {
6711
- let play = vue.reactive(null);
6710
+ let play = vue.reactive({});
6712
6711
  const uuid = _prop.domId;
6713
6712
  const videoFull = id => {
6714
6713
  const elm = document.getElementById(`videoPlayer_${uuid}`);
@@ -6734,7 +6733,6 @@ const VideoPlayerV2 = vue.defineComponent({
6734
6733
  }
6735
6734
  };
6736
6735
  const init = () => {
6737
- play = null;
6738
6736
  let camera = videoInfo2.value;
6739
6737
  camera = {
6740
6738
  ...camera,
@@ -6754,7 +6752,21 @@ const VideoPlayerV2 = vue.defineComponent({
6754
6752
  addRtspProxyUrl: url
6755
6753
  }
6756
6754
  }));
6757
- };
6755
+ const {
6756
+ p_player
6757
+ } = vue.toRefs(play);
6758
+ playerRef.value = core.resolveRef(p_player);
6759
+ };
6760
+ const playerRef = vue.ref();
6761
+ vue.watchEffect(() => {
6762
+ if (playerRef.value) {
6763
+ if (playerRef.value.value === "error") {
6764
+ console.log("p_player ===> add 500");
6765
+ stopPlay();
6766
+ getVideoDetail(_prop.camera);
6767
+ }
6768
+ }
6769
+ });
6758
6770
  const releaseUrl = vue.ref("");
6759
6771
  const release = async () => {
6760
6772
  const res = await axios__default["default"].get(releaseUrl.value);
@@ -6809,15 +6821,6 @@ const VideoPlayerV2 = vue.defineComponent({
6809
6821
  immediate: true,
6810
6822
  deep: true
6811
6823
  });
6812
- vue.watch(() => play?.p_player, nval => {
6813
- if (nval) {
6814
- console.info("p_player ===> ", nval);
6815
- } else {
6816
- console.log("p_player ===> add 500000000!");
6817
- stopPlay();
6818
- getVideoDetail(_prop.camera);
6819
- }
6820
- });
6821
6824
  vue.onBeforeUnmount(() => {
6822
6825
  stopPlay();
6823
6826
  });
@@ -1,9 +1,9 @@
1
- import { defineComponent, createVNode, ref, reactive, computed, inject, resolveComponent, withDirectives, vShow, provide, nextTick, watch, onBeforeUnmount, Fragment, isVNode, mergeProps, onBeforeUpdate, onMounted, onUnmounted, createTextVNode } from 'vue';
1
+ import { defineComponent, createVNode, ref, reactive, computed, inject, resolveComponent, withDirectives, vShow, provide, nextTick, watchEffect, watch, onBeforeUnmount, Fragment, toRefs, isVNode, mergeProps, onBeforeUpdate, onMounted, onUnmounted, createTextVNode } from 'vue';
2
2
  import { useRouter } from 'vue-router';
3
3
  import { message, Form, Row, Col, FormItem, SelectOption, Input, Select, Switch, InputNumber } from 'ant-design-vue';
4
4
  import axios$2 from 'axios';
5
5
  import _, { isPlainObject as isPlainObject$1, omit, isObject as isObject$2 } from 'lodash';
6
- import { useBreakpoints, breakpointsAntDesign, useToggle, useVModel, resolveRef, useIntervalFn } from '@vueuse/core';
6
+ import { resolveRef, useBreakpoints, breakpointsAntDesign, useToggle, useVModel, useIntervalFn } from '@vueuse/core';
7
7
  import { SearchOutlined, CaretUpOutlined, CaretRightOutlined, CaretDownOutlined, FileExcelTwoTone, InboxOutlined } from '@ant-design/icons-vue';
8
8
  import dayjs from 'dayjs';
9
9
 
@@ -6487,7 +6487,7 @@ const Endpoint = RTCEndpoint;
6487
6487
  class WebRtcMt$1 {
6488
6488
  constructor(opt) {
6489
6489
  this.opt = opt;
6490
- this.p_player = ref(null);
6490
+ this.p_player = ref();
6491
6491
  this.init(opt);
6492
6492
  }
6493
6493
  opt;
@@ -6551,12 +6551,12 @@ class WebRtcMt$1 {
6551
6551
  resolve(res);
6552
6552
  } else {
6553
6553
  console.log("\u62C9\u6D41\u63A5\u53E3\u8FD4\u56DE\u5931\u8D25");
6554
- reject(false);
6554
+ reject("error");
6555
6555
  }
6556
6556
  });
6557
6557
  }).catch(err => {
6558
6558
  console.log("\u62C9\u6D41\u63A5\u53E3\u5931\u8D25");
6559
- reject(false);
6559
+ reject("error");
6560
6560
  });
6561
6561
  });
6562
6562
  }
@@ -6623,10 +6623,9 @@ class WebRtcMt$1 {
6623
6623
  console.log("\u5E95\u90E8\u505C\u6B62\u64AD\u653E");
6624
6624
  this.stopPlay();
6625
6625
  setTimeout(() => {
6626
- console.log("\u5E95\u90E8\u91CD\u64AD---");
6627
- this.p_player.value = false;
6628
- console.info("v2---", this.p_player.value);
6629
- }, 5 * 1e3);
6626
+ this.p_player.value = "error";
6627
+ console.log("\u5E95\u90E8\u91CD\u64AD", this.p_player.value);
6628
+ }, 3 * 1e3);
6630
6629
  }
6631
6630
  // 播放
6632
6631
  play(videoElm) {
@@ -6698,7 +6697,7 @@ const VideoPlayerV2 = defineComponent({
6698
6697
  props: props$7,
6699
6698
  emits: ["changeStream"],
6700
6699
  setup(_prop, _context) {
6701
- let play = reactive(null);
6700
+ let play = reactive({});
6702
6701
  const uuid = _prop.domId;
6703
6702
  const videoFull = id => {
6704
6703
  const elm = document.getElementById(`videoPlayer_${uuid}`);
@@ -6724,7 +6723,6 @@ const VideoPlayerV2 = defineComponent({
6724
6723
  }
6725
6724
  };
6726
6725
  const init = () => {
6727
- play = null;
6728
6726
  let camera = videoInfo2.value;
6729
6727
  camera = {
6730
6728
  ...camera,
@@ -6744,7 +6742,21 @@ const VideoPlayerV2 = defineComponent({
6744
6742
  addRtspProxyUrl: url
6745
6743
  }
6746
6744
  }));
6747
- };
6745
+ const {
6746
+ p_player
6747
+ } = toRefs(play);
6748
+ playerRef.value = resolveRef(p_player);
6749
+ };
6750
+ const playerRef = ref();
6751
+ watchEffect(() => {
6752
+ if (playerRef.value) {
6753
+ if (playerRef.value.value === "error") {
6754
+ console.log("p_player ===> add 500");
6755
+ stopPlay();
6756
+ getVideoDetail(_prop.camera);
6757
+ }
6758
+ }
6759
+ });
6748
6760
  const releaseUrl = ref("");
6749
6761
  const release = async () => {
6750
6762
  const res = await axios$2.get(releaseUrl.value);
@@ -6799,15 +6811,6 @@ const VideoPlayerV2 = defineComponent({
6799
6811
  immediate: true,
6800
6812
  deep: true
6801
6813
  });
6802
- watch(() => play?.p_player, nval => {
6803
- if (nval) {
6804
- console.info("p_player ===> ", nval);
6805
- } else {
6806
- console.log("p_player ===> add 500000000!");
6807
- stopPlay();
6808
- getVideoDetail(_prop.camera);
6809
- }
6810
- });
6811
6814
  onBeforeUnmount(() => {
6812
6815
  stopPlay();
6813
6816
  });
@@ -5907,7 +5907,7 @@ const playOneWebRtcMt = async (uuid, domId, dom, token) => {
5907
5907
  class WebRtcMt {
5908
5908
  constructor(opt) {
5909
5909
  this.opt = opt;
5910
- this.p_player = vue.ref(null);
5910
+ this.p_player = vue.ref();
5911
5911
  this.init(opt);
5912
5912
  }
5913
5913
  opt;
@@ -5971,12 +5971,12 @@ class WebRtcMt {
5971
5971
  resolve(res);
5972
5972
  } else {
5973
5973
  console.log("\u62C9\u6D41\u63A5\u53E3\u8FD4\u56DE\u5931\u8D25");
5974
- reject(false);
5974
+ reject("error");
5975
5975
  }
5976
5976
  });
5977
5977
  }).catch(err => {
5978
5978
  console.log("\u62C9\u6D41\u63A5\u53E3\u5931\u8D25");
5979
- reject(false);
5979
+ reject("error");
5980
5980
  });
5981
5981
  });
5982
5982
  }
@@ -6043,10 +6043,9 @@ class WebRtcMt {
6043
6043
  console.log("\u5E95\u90E8\u505C\u6B62\u64AD\u653E");
6044
6044
  this.stopPlay();
6045
6045
  setTimeout(() => {
6046
- console.log("\u5E95\u90E8\u91CD\u64AD---");
6047
- this.p_player.value = false;
6048
- console.info("v2---", this.p_player.value);
6049
- }, 5 * 1e3);
6046
+ this.p_player.value = "error";
6047
+ console.log("\u5E95\u90E8\u91CD\u64AD", this.p_player.value);
6048
+ }, 3 * 1e3);
6050
6049
  }
6051
6050
  // 播放
6052
6051
  play(videoElm) {
@@ -5898,7 +5898,7 @@ const playOneWebRtcMt = async (uuid, domId, dom, token) => {
5898
5898
  class WebRtcMt {
5899
5899
  constructor(opt) {
5900
5900
  this.opt = opt;
5901
- this.p_player = ref(null);
5901
+ this.p_player = ref();
5902
5902
  this.init(opt);
5903
5903
  }
5904
5904
  opt;
@@ -5962,12 +5962,12 @@ class WebRtcMt {
5962
5962
  resolve(res);
5963
5963
  } else {
5964
5964
  console.log("\u62C9\u6D41\u63A5\u53E3\u8FD4\u56DE\u5931\u8D25");
5965
- reject(false);
5965
+ reject("error");
5966
5966
  }
5967
5967
  });
5968
5968
  }).catch(err => {
5969
5969
  console.log("\u62C9\u6D41\u63A5\u53E3\u5931\u8D25");
5970
- reject(false);
5970
+ reject("error");
5971
5971
  });
5972
5972
  });
5973
5973
  }
@@ -6034,10 +6034,9 @@ class WebRtcMt {
6034
6034
  console.log("\u5E95\u90E8\u505C\u6B62\u64AD\u653E");
6035
6035
  this.stopPlay();
6036
6036
  setTimeout(() => {
6037
- console.log("\u5E95\u90E8\u91CD\u64AD---");
6038
- this.p_player.value = false;
6039
- console.info("v2---", this.p_player.value);
6040
- }, 5 * 1e3);
6037
+ this.p_player.value = "error";
6038
+ console.log("\u5E95\u90E8\u91CD\u64AD", this.p_player.value);
6039
+ }, 3 * 1e3);
6041
6040
  }
6042
6041
  // 播放
6043
6042
  play(videoElm) {
package/dist/index.cjs CHANGED
@@ -21,7 +21,7 @@ var ___default = /*#__PURE__*/_interopDefaultLegacy(_);
21
21
  var dayjs__default = /*#__PURE__*/_interopDefaultLegacy(dayjs);
22
22
  var zhCN__default = /*#__PURE__*/_interopDefaultLegacy(zhCN);
23
23
 
24
- var version = "0.0.33";
24
+ var version = "0.0.35";
25
25
 
26
26
  const setRem = opt => {
27
27
  const fontSize = opt.fontSize || 14;
@@ -6513,7 +6513,7 @@ const playOneWebRtcMt = async (uuid, domId, dom, token) => {
6513
6513
  class WebRtcMt$1 {
6514
6514
  constructor(opt) {
6515
6515
  this.opt = opt;
6516
- this.p_player = vue.ref(null);
6516
+ this.p_player = vue.ref();
6517
6517
  this.init(opt);
6518
6518
  }
6519
6519
  opt;
@@ -6577,12 +6577,12 @@ class WebRtcMt$1 {
6577
6577
  resolve(res);
6578
6578
  } else {
6579
6579
  console.log("\u62C9\u6D41\u63A5\u53E3\u8FD4\u56DE\u5931\u8D25");
6580
- reject(false);
6580
+ reject("error");
6581
6581
  }
6582
6582
  });
6583
6583
  }).catch(err => {
6584
6584
  console.log("\u62C9\u6D41\u63A5\u53E3\u5931\u8D25");
6585
- reject(false);
6585
+ reject("error");
6586
6586
  });
6587
6587
  });
6588
6588
  }
@@ -6649,10 +6649,9 @@ class WebRtcMt$1 {
6649
6649
  console.log("\u5E95\u90E8\u505C\u6B62\u64AD\u653E");
6650
6650
  this.stopPlay();
6651
6651
  setTimeout(() => {
6652
- console.log("\u5E95\u90E8\u91CD\u64AD---");
6653
- this.p_player.value = false;
6654
- console.info("v2---", this.p_player.value);
6655
- }, 5 * 1e3);
6652
+ this.p_player.value = "error";
6653
+ console.log("\u5E95\u90E8\u91CD\u64AD", this.p_player.value);
6654
+ }, 3 * 1e3);
6656
6655
  }
6657
6656
  // 播放
6658
6657
  play(videoElm) {
@@ -7239,7 +7238,7 @@ const VideoPlayerV2 = vue.defineComponent({
7239
7238
  props: props$7,
7240
7239
  emits: ["changeStream"],
7241
7240
  setup(_prop, _context) {
7242
- let play = vue.reactive(null);
7241
+ let play = vue.reactive({});
7243
7242
  const uuid = _prop.domId;
7244
7243
  const videoFull = id => {
7245
7244
  const elm = document.getElementById(`videoPlayer_${uuid}`);
@@ -7265,7 +7264,6 @@ const VideoPlayerV2 = vue.defineComponent({
7265
7264
  }
7266
7265
  };
7267
7266
  const init = () => {
7268
- play = null;
7269
7267
  let camera = videoInfo2.value;
7270
7268
  camera = {
7271
7269
  ...camera,
@@ -7285,7 +7283,21 @@ const VideoPlayerV2 = vue.defineComponent({
7285
7283
  addRtspProxyUrl: url
7286
7284
  }
7287
7285
  }));
7288
- };
7286
+ const {
7287
+ p_player
7288
+ } = vue.toRefs(play);
7289
+ playerRef.value = core.resolveRef(p_player);
7290
+ };
7291
+ const playerRef = vue.ref();
7292
+ vue.watchEffect(() => {
7293
+ if (playerRef.value) {
7294
+ if (playerRef.value.value === "error") {
7295
+ console.log("p_player ===> add 500");
7296
+ stopPlay();
7297
+ getVideoDetail(_prop.camera);
7298
+ }
7299
+ }
7300
+ });
7289
7301
  const releaseUrl = vue.ref("");
7290
7302
  const release = async () => {
7291
7303
  const res = await axios__default["default"].get(releaseUrl.value);
@@ -7340,15 +7352,6 @@ const VideoPlayerV2 = vue.defineComponent({
7340
7352
  immediate: true,
7341
7353
  deep: true
7342
7354
  });
7343
- vue.watch(() => play?.p_player, nval => {
7344
- if (nval) {
7345
- console.info("p_player ===> ", nval);
7346
- } else {
7347
- console.log("p_player ===> add 500000000!");
7348
- stopPlay();
7349
- getVideoDetail(_prop.camera);
7350
- }
7351
- });
7352
7355
  vue.onBeforeUnmount(() => {
7353
7356
  stopPlay();
7354
7357
  });
package/dist/index.d.ts CHANGED
@@ -7,7 +7,7 @@ import { MaybeRef, MaybeComputedRef } from '@vueuse/core';
7
7
  import { Key } from 'ant-design-vue/lib/table/interface';
8
8
  import * as vue_jsx_runtime from 'vue/jsx-runtime';
9
9
 
10
- var version = "0.0.33";
10
+ var version = "0.0.35";
11
11
 
12
12
  /**
13
13
  *
package/dist/index.js CHANGED
@@ -1,7 +1,7 @@
1
1
  import axios$2 from 'axios';
2
2
  import ant, { message, Form, Row, Col, FormItem, SelectOption, Input, Select, Switch, InputNumber } from 'ant-design-vue';
3
3
  import _, { isPlainObject as isPlainObject$1, omit, cloneDeep, isObject as isObject$2 } from 'lodash';
4
- import { ref, reactive, computed, watch, onBeforeUnmount, watchEffect, defineComponent, createVNode, inject, resolveComponent, withDirectives, vShow, provide, nextTick, Fragment, isVNode, mergeProps, onBeforeUpdate, onMounted, onUnmounted, createTextVNode } from 'vue';
4
+ import { ref, reactive, computed, watch, onBeforeUnmount, watchEffect, defineComponent, createVNode, inject, resolveComponent, withDirectives, vShow, provide, nextTick, Fragment, toRefs, isVNode, mergeProps, onBeforeUpdate, onMounted, onUnmounted, createTextVNode } from 'vue';
5
5
  import { useIntervalFn, useEventBus, resolveRef, useEventListener, useBreakpoints, breakpointsAntDesign, useToggle, useVModel } from '@vueuse/core';
6
6
  import dayjs from 'dayjs';
7
7
  import { useRouter } from 'vue-router';
@@ -9,7 +9,7 @@ import { SearchOutlined, CaretUpOutlined, CaretRightOutlined, CaretDownOutlined,
9
9
  import 'ant-design-vue/dist/antd.less';
10
10
  import zhCN from 'dayjs/locale/zh-cn';
11
11
 
12
- var version = "0.0.33";
12
+ var version = "0.0.35";
13
13
 
14
14
  const setRem = opt => {
15
15
  const fontSize = opt.fontSize || 14;
@@ -6501,7 +6501,7 @@ const playOneWebRtcMt = async (uuid, domId, dom, token) => {
6501
6501
  class WebRtcMt$1 {
6502
6502
  constructor(opt) {
6503
6503
  this.opt = opt;
6504
- this.p_player = ref(null);
6504
+ this.p_player = ref();
6505
6505
  this.init(opt);
6506
6506
  }
6507
6507
  opt;
@@ -6565,12 +6565,12 @@ class WebRtcMt$1 {
6565
6565
  resolve(res);
6566
6566
  } else {
6567
6567
  console.log("\u62C9\u6D41\u63A5\u53E3\u8FD4\u56DE\u5931\u8D25");
6568
- reject(false);
6568
+ reject("error");
6569
6569
  }
6570
6570
  });
6571
6571
  }).catch(err => {
6572
6572
  console.log("\u62C9\u6D41\u63A5\u53E3\u5931\u8D25");
6573
- reject(false);
6573
+ reject("error");
6574
6574
  });
6575
6575
  });
6576
6576
  }
@@ -6637,10 +6637,9 @@ class WebRtcMt$1 {
6637
6637
  console.log("\u5E95\u90E8\u505C\u6B62\u64AD\u653E");
6638
6638
  this.stopPlay();
6639
6639
  setTimeout(() => {
6640
- console.log("\u5E95\u90E8\u91CD\u64AD---");
6641
- this.p_player.value = false;
6642
- console.info("v2---", this.p_player.value);
6643
- }, 5 * 1e3);
6640
+ this.p_player.value = "error";
6641
+ console.log("\u5E95\u90E8\u91CD\u64AD", this.p_player.value);
6642
+ }, 3 * 1e3);
6644
6643
  }
6645
6644
  // 播放
6646
6645
  play(videoElm) {
@@ -7227,7 +7226,7 @@ const VideoPlayerV2 = defineComponent({
7227
7226
  props: props$7,
7228
7227
  emits: ["changeStream"],
7229
7228
  setup(_prop, _context) {
7230
- let play = reactive(null);
7229
+ let play = reactive({});
7231
7230
  const uuid = _prop.domId;
7232
7231
  const videoFull = id => {
7233
7232
  const elm = document.getElementById(`videoPlayer_${uuid}`);
@@ -7253,7 +7252,6 @@ const VideoPlayerV2 = defineComponent({
7253
7252
  }
7254
7253
  };
7255
7254
  const init = () => {
7256
- play = null;
7257
7255
  let camera = videoInfo2.value;
7258
7256
  camera = {
7259
7257
  ...camera,
@@ -7273,7 +7271,21 @@ const VideoPlayerV2 = defineComponent({
7273
7271
  addRtspProxyUrl: url
7274
7272
  }
7275
7273
  }));
7276
- };
7274
+ const {
7275
+ p_player
7276
+ } = toRefs(play);
7277
+ playerRef.value = resolveRef(p_player);
7278
+ };
7279
+ const playerRef = ref();
7280
+ watchEffect(() => {
7281
+ if (playerRef.value) {
7282
+ if (playerRef.value.value === "error") {
7283
+ console.log("p_player ===> add 500");
7284
+ stopPlay();
7285
+ getVideoDetail(_prop.camera);
7286
+ }
7287
+ }
7288
+ });
7277
7289
  const releaseUrl = ref("");
7278
7290
  const release = async () => {
7279
7291
  const res = await axios$2.get(releaseUrl.value);
@@ -7328,15 +7340,6 @@ const VideoPlayerV2 = defineComponent({
7328
7340
  immediate: true,
7329
7341
  deep: true
7330
7342
  });
7331
- watch(() => play?.p_player, nval => {
7332
- if (nval) {
7333
- console.info("p_player ===> ", nval);
7334
- } else {
7335
- console.log("p_player ===> add 500000000!");
7336
- stopPlay();
7337
- getVideoDetail(_prop.camera);
7338
- }
7339
- });
7340
7343
  onBeforeUnmount(() => {
7341
7344
  stopPlay();
7342
7345
  });
@@ -4,6 +4,7 @@ Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  var vue = require('vue');
6
6
  var axios$2 = require('axios');
7
+ var core = require('@vueuse/core');
7
8
 
8
9
  function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
9
10
 
@@ -5722,7 +5723,7 @@ const Endpoint = RTCEndpoint;
5722
5723
  class WebRtcMt$1 {
5723
5724
  constructor(opt) {
5724
5725
  this.opt = opt;
5725
- this.p_player = vue.ref(null);
5726
+ this.p_player = vue.ref();
5726
5727
  this.init(opt);
5727
5728
  }
5728
5729
  opt;
@@ -5786,12 +5787,12 @@ class WebRtcMt$1 {
5786
5787
  resolve(res);
5787
5788
  } else {
5788
5789
  console.log("\u62C9\u6D41\u63A5\u53E3\u8FD4\u56DE\u5931\u8D25");
5789
- reject(false);
5790
+ reject("error");
5790
5791
  }
5791
5792
  });
5792
5793
  }).catch(err => {
5793
5794
  console.log("\u62C9\u6D41\u63A5\u53E3\u5931\u8D25");
5794
- reject(false);
5795
+ reject("error");
5795
5796
  });
5796
5797
  });
5797
5798
  }
@@ -5858,10 +5859,9 @@ class WebRtcMt$1 {
5858
5859
  console.log("\u5E95\u90E8\u505C\u6B62\u64AD\u653E");
5859
5860
  this.stopPlay();
5860
5861
  setTimeout(() => {
5861
- console.log("\u5E95\u90E8\u91CD\u64AD---");
5862
- this.p_player.value = false;
5863
- console.info("v2---", this.p_player.value);
5864
- }, 5 * 1e3);
5862
+ this.p_player.value = "error";
5863
+ console.log("\u5E95\u90E8\u91CD\u64AD", this.p_player.value);
5864
+ }, 3 * 1e3);
5865
5865
  }
5866
5866
  // 播放
5867
5867
  play(videoElm) {
@@ -5950,7 +5950,7 @@ const VideoPlayerV2 = vue.defineComponent({
5950
5950
  props: props$1,
5951
5951
  emits: ["changeStream"],
5952
5952
  setup(_prop, _context) {
5953
- let play = vue.reactive(null);
5953
+ let play = vue.reactive({});
5954
5954
  const uuid = _prop.domId;
5955
5955
  const videoFull = id => {
5956
5956
  const elm = document.getElementById(`videoPlayer_${uuid}`);
@@ -5976,7 +5976,6 @@ const VideoPlayerV2 = vue.defineComponent({
5976
5976
  }
5977
5977
  };
5978
5978
  const init = () => {
5979
- play = null;
5980
5979
  let camera = videoInfo2.value;
5981
5980
  camera = {
5982
5981
  ...camera,
@@ -5996,7 +5995,21 @@ const VideoPlayerV2 = vue.defineComponent({
5996
5995
  addRtspProxyUrl: url
5997
5996
  }
5998
5997
  }));
5998
+ const {
5999
+ p_player
6000
+ } = vue.toRefs(play);
6001
+ playerRef.value = core.resolveRef(p_player);
5999
6002
  };
6003
+ const playerRef = vue.ref();
6004
+ vue.watchEffect(() => {
6005
+ if (playerRef.value) {
6006
+ if (playerRef.value.value === "error") {
6007
+ console.log("p_player ===> add 500");
6008
+ stopPlay();
6009
+ getVideoDetail(_prop.camera);
6010
+ }
6011
+ }
6012
+ });
6000
6013
  const releaseUrl = vue.ref("");
6001
6014
  const release = async () => {
6002
6015
  const res = await axios__default["default"].get(releaseUrl.value);
@@ -6051,15 +6064,6 @@ const VideoPlayerV2 = vue.defineComponent({
6051
6064
  immediate: true,
6052
6065
  deep: true
6053
6066
  });
6054
- vue.watch(() => play?.p_player, nval => {
6055
- if (nval) {
6056
- console.info("p_player ===> ", nval);
6057
- } else {
6058
- console.log("p_player ===> add 500000000!");
6059
- stopPlay();
6060
- getVideoDetail(_prop.camera);
6061
- }
6062
- });
6063
6067
  vue.onBeforeUnmount(() => {
6064
6068
  stopPlay();
6065
6069
  });
@@ -1,5 +1,6 @@
1
- import { ref, defineComponent, reactive, watch, onBeforeUnmount, createVNode, Fragment } from 'vue';
1
+ import { ref, defineComponent, reactive, watchEffect, watch, onBeforeUnmount, createVNode, Fragment, toRefs } from 'vue';
2
2
  import axios$2 from 'axios';
3
+ import { resolveRef } from '@vueuse/core';
3
4
 
4
5
  const Events$1 = {
5
6
  WEBRTC_NOT_SUPPORT: "WEBRTC_NOT_SUPPORT",
@@ -5714,7 +5715,7 @@ const Endpoint = RTCEndpoint;
5714
5715
  class WebRtcMt$1 {
5715
5716
  constructor(opt) {
5716
5717
  this.opt = opt;
5717
- this.p_player = ref(null);
5718
+ this.p_player = ref();
5718
5719
  this.init(opt);
5719
5720
  }
5720
5721
  opt;
@@ -5778,12 +5779,12 @@ class WebRtcMt$1 {
5778
5779
  resolve(res);
5779
5780
  } else {
5780
5781
  console.log("\u62C9\u6D41\u63A5\u53E3\u8FD4\u56DE\u5931\u8D25");
5781
- reject(false);
5782
+ reject("error");
5782
5783
  }
5783
5784
  });
5784
5785
  }).catch(err => {
5785
5786
  console.log("\u62C9\u6D41\u63A5\u53E3\u5931\u8D25");
5786
- reject(false);
5787
+ reject("error");
5787
5788
  });
5788
5789
  });
5789
5790
  }
@@ -5850,10 +5851,9 @@ class WebRtcMt$1 {
5850
5851
  console.log("\u5E95\u90E8\u505C\u6B62\u64AD\u653E");
5851
5852
  this.stopPlay();
5852
5853
  setTimeout(() => {
5853
- console.log("\u5E95\u90E8\u91CD\u64AD---");
5854
- this.p_player.value = false;
5855
- console.info("v2---", this.p_player.value);
5856
- }, 5 * 1e3);
5854
+ this.p_player.value = "error";
5855
+ console.log("\u5E95\u90E8\u91CD\u64AD", this.p_player.value);
5856
+ }, 3 * 1e3);
5857
5857
  }
5858
5858
  // 播放
5859
5859
  play(videoElm) {
@@ -5942,7 +5942,7 @@ const VideoPlayerV2 = defineComponent({
5942
5942
  props: props$1,
5943
5943
  emits: ["changeStream"],
5944
5944
  setup(_prop, _context) {
5945
- let play = reactive(null);
5945
+ let play = reactive({});
5946
5946
  const uuid = _prop.domId;
5947
5947
  const videoFull = id => {
5948
5948
  const elm = document.getElementById(`videoPlayer_${uuid}`);
@@ -5968,7 +5968,6 @@ const VideoPlayerV2 = defineComponent({
5968
5968
  }
5969
5969
  };
5970
5970
  const init = () => {
5971
- play = null;
5972
5971
  let camera = videoInfo2.value;
5973
5972
  camera = {
5974
5973
  ...camera,
@@ -5988,7 +5987,21 @@ const VideoPlayerV2 = defineComponent({
5988
5987
  addRtspProxyUrl: url
5989
5988
  }
5990
5989
  }));
5990
+ const {
5991
+ p_player
5992
+ } = toRefs(play);
5993
+ playerRef.value = resolveRef(p_player);
5991
5994
  };
5995
+ const playerRef = ref();
5996
+ watchEffect(() => {
5997
+ if (playerRef.value) {
5998
+ if (playerRef.value.value === "error") {
5999
+ console.log("p_player ===> add 500");
6000
+ stopPlay();
6001
+ getVideoDetail(_prop.camera);
6002
+ }
6003
+ }
6004
+ });
5992
6005
  const releaseUrl = ref("");
5993
6006
  const release = async () => {
5994
6007
  const res = await axios$2.get(releaseUrl.value);
@@ -6043,15 +6056,6 @@ const VideoPlayerV2 = defineComponent({
6043
6056
  immediate: true,
6044
6057
  deep: true
6045
6058
  });
6046
- watch(() => play?.p_player, nval => {
6047
- if (nval) {
6048
- console.info("p_player ===> ", nval);
6049
- } else {
6050
- console.log("p_player ===> add 500000000!");
6051
- stopPlay();
6052
- getVideoDetail(_prop.camera);
6053
- }
6054
- });
6055
6059
  onBeforeUnmount(() => {
6056
6060
  stopPlay();
6057
6061
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mtxt-ui3",
3
- "version": "0.0.34",
3
+ "version": "0.0.36",
4
4
  "description": "系统运营组件库",
5
5
  "main": "dist/index.cjs",
6
6
  "module": "dist/index.js",