inl-ui 0.1.124 → 0.1.126-video
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/dist/components/index.cjs +43 -40
- package/dist/components/index.js +44 -41
- package/dist/hooks/index.cjs +9 -13
- package/dist/hooks/index.js +9 -13
- package/dist/index.cjs +44 -41
- package/dist/index.d.ts +1 -1
- package/dist/index.js +45 -42
- package/dist/theme/style/themes/default.less +1 -1
- package/dist/theme/style/themes/variable.less +1 -1
- package/dist/tplib/index.cjs +11 -13
- package/dist/tplib/index.js +11 -13
- package/dist/video/index.cjs +28 -18
- package/dist/video/index.js +29 -19
- package/dist/videoMobile/index.cjs +28 -18
- package/dist/videoMobile/index.js +29 -19
- package/package.json +1 -1
|
@@ -211,20 +211,18 @@ function getIframeUrl(url) {
|
|
|
211
211
|
async function checkIframeUrl(url) {
|
|
212
212
|
const iframeUrl = getIframeUrl(url);
|
|
213
213
|
let code = 200;
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
code = 500;
|
|
224
|
-
}
|
|
214
|
+
try {
|
|
215
|
+
const res = await fetch(`/api/common/v1/sysconfig/curlForResponseCode?requestMethod=get&url=${encodeURIComponent(iframeUrl)}`, {
|
|
216
|
+
headers: getCommonHeaders()
|
|
217
|
+
});
|
|
218
|
+
if (res.status !== 404) {
|
|
219
|
+
const json = await res.json();
|
|
220
|
+
code = json.data;
|
|
221
|
+
if (json.code === "M5001") {
|
|
222
|
+
code = 500;
|
|
225
223
|
}
|
|
226
|
-
}
|
|
227
|
-
}
|
|
224
|
+
}
|
|
225
|
+
} catch (e) {}
|
|
228
226
|
return code;
|
|
229
227
|
}
|
|
230
228
|
|
|
@@ -6382,6 +6380,7 @@ const Endpoint = RTCEndpoint;
|
|
|
6382
6380
|
class WebRtcMt$1 {
|
|
6383
6381
|
constructor(opt) {
|
|
6384
6382
|
this.opt = opt;
|
|
6383
|
+
this.p_player = vue.ref();
|
|
6385
6384
|
this.init(opt);
|
|
6386
6385
|
}
|
|
6387
6386
|
opt;
|
|
@@ -6421,7 +6420,7 @@ class WebRtcMt$1 {
|
|
|
6421
6420
|
if (opt.h) this.config.h = opt.h;
|
|
6422
6421
|
if (opt.w) this.config.w = opt.w;
|
|
6423
6422
|
if (Object.prototype.toString.call(opt.plays) === "[object Object]") {
|
|
6424
|
-
this.p_player = this.createVideo(opt.plays);
|
|
6423
|
+
this.p_player.value = this.createVideo(opt.plays);
|
|
6425
6424
|
} else {
|
|
6426
6425
|
for (const i of opt.plays) {
|
|
6427
6426
|
this.createVideo(i);
|
|
@@ -6442,19 +6441,15 @@ class WebRtcMt$1 {
|
|
|
6442
6441
|
response.json().then(res => {
|
|
6443
6442
|
if (res.code === 0) {
|
|
6444
6443
|
this.startPlay(plays);
|
|
6444
|
+
resolve(res);
|
|
6445
6445
|
} else {
|
|
6446
6446
|
console.log("\u62C9\u6D41\u63A5\u53E3\u8FD4\u56DE\u5931\u8D25");
|
|
6447
|
-
|
|
6448
|
-
this.rePlay();
|
|
6449
|
-
}, 3 * 60 * 1e3);
|
|
6447
|
+
reject("error");
|
|
6450
6448
|
}
|
|
6451
|
-
resolve(res);
|
|
6452
6449
|
});
|
|
6453
6450
|
}).catch(err => {
|
|
6454
6451
|
console.log("\u62C9\u6D41\u63A5\u53E3\u5931\u8D25");
|
|
6455
|
-
|
|
6456
|
-
this.rePlay();
|
|
6457
|
-
}, 3 * 60 * 1e3);
|
|
6452
|
+
reject("error");
|
|
6458
6453
|
});
|
|
6459
6454
|
});
|
|
6460
6455
|
}
|
|
@@ -6510,7 +6505,7 @@ class WebRtcMt$1 {
|
|
|
6510
6505
|
this.rePlay(videoElm);
|
|
6511
6506
|
});
|
|
6512
6507
|
player.on(Events.WEBRTC_ON_CONNECTION_STATE_CHANGE, state => {
|
|
6513
|
-
|
|
6508
|
+
console.log("webrtc:" + state);
|
|
6514
6509
|
if (state === "disconnected" || state === "failed") {
|
|
6515
6510
|
this.rePlay(videoElm);
|
|
6516
6511
|
}
|
|
@@ -6521,13 +6516,12 @@ class WebRtcMt$1 {
|
|
|
6521
6516
|
console.log("\u5E95\u90E8\u505C\u6B62\u64AD\u653E");
|
|
6522
6517
|
this.stopPlay();
|
|
6523
6518
|
setTimeout(() => {
|
|
6524
|
-
|
|
6525
|
-
|
|
6526
|
-
},
|
|
6519
|
+
this.p_player.value = "error";
|
|
6520
|
+
console.log("\u5E95\u90E8\u91CD\u64AD", this.p_player.value);
|
|
6521
|
+
}, 3 * 1e3);
|
|
6527
6522
|
}
|
|
6528
6523
|
// 播放
|
|
6529
6524
|
play(videoElm) {
|
|
6530
|
-
console.log("\u5F00\u59CB\u89C6\u9891\u521D\u59CB\u5316");
|
|
6531
6525
|
const plays = this.mediaServerAddrMap.get(videoElm);
|
|
6532
6526
|
const {
|
|
6533
6527
|
sdpUrl
|
|
@@ -8732,24 +8726,20 @@ const getDetailContainer = () => vue.defineComponent({
|
|
|
8732
8726
|
}
|
|
8733
8727
|
};
|
|
8734
8728
|
const addTab = ___default["default"].debounce(newRoute => {
|
|
8735
|
-
dataId.value = newRoute.params.id
|
|
8729
|
+
dataId.value = newRoute.params.id;
|
|
8736
8730
|
const {
|
|
8737
|
-
name
|
|
8738
|
-
newTab
|
|
8731
|
+
name
|
|
8739
8732
|
} = route.query;
|
|
8740
|
-
if (newTab) {
|
|
8741
|
-
dataId.value = newTab;
|
|
8742
|
-
}
|
|
8743
8733
|
const tab = {
|
|
8744
8734
|
name,
|
|
8745
8735
|
url: route.fullPath,
|
|
8746
8736
|
key: props.name,
|
|
8747
|
-
uniqueKey:
|
|
8737
|
+
uniqueKey: newRoute.params.id,
|
|
8748
8738
|
icon: props.icon,
|
|
8749
8739
|
isExtraTab: true,
|
|
8750
8740
|
params: ___default["default"].omit(route.query, "name")
|
|
8751
8741
|
};
|
|
8752
|
-
const detail = detailList.value.find(item => item.
|
|
8742
|
+
const detail = detailList.value.find(item => item.uniqueKey === tab.uniqueKey);
|
|
8753
8743
|
if (detail) {
|
|
8754
8744
|
detail.url = newRoute.fullPath;
|
|
8755
8745
|
if (Array.isArray(qiankunState.value.extraTabs)) {
|
|
@@ -8765,7 +8755,7 @@ const getDetailContainer = () => vue.defineComponent({
|
|
|
8765
8755
|
detailList.value.push({
|
|
8766
8756
|
...tab,
|
|
8767
8757
|
refreshKey: Date.now(),
|
|
8768
|
-
id:
|
|
8758
|
+
id: newRoute.params.id
|
|
8769
8759
|
});
|
|
8770
8760
|
console.log("detailList.value", detailList.value);
|
|
8771
8761
|
setTimeout(() => {
|
|
@@ -8944,7 +8934,7 @@ const VideoPlayerV2 = vue.defineComponent({
|
|
|
8944
8934
|
props: props$8,
|
|
8945
8935
|
emits: ["changeStream"],
|
|
8946
8936
|
setup(_prop, _context) {
|
|
8947
|
-
let play;
|
|
8937
|
+
let play = vue.reactive({});
|
|
8948
8938
|
const uuid = _prop.domId;
|
|
8949
8939
|
const videoFull = id => {
|
|
8950
8940
|
const elm = document.getElementById(`videoPlayer_${uuid}`);
|
|
@@ -8965,19 +8955,18 @@ const VideoPlayerV2 = vue.defineComponent({
|
|
|
8965
8955
|
};
|
|
8966
8956
|
const videoInfo2 = vue.ref({});
|
|
8967
8957
|
const stopPlay = () => {
|
|
8968
|
-
if (play) {
|
|
8958
|
+
if ("stopPlay" in play) {
|
|
8969
8959
|
play.stopPlay(`videoPlayer_${uuid}`);
|
|
8970
8960
|
}
|
|
8971
8961
|
};
|
|
8972
8962
|
const init = () => {
|
|
8973
|
-
play = null;
|
|
8974
8963
|
let camera = videoInfo2.value;
|
|
8975
8964
|
camera = {
|
|
8976
8965
|
...camera,
|
|
8977
8966
|
..._prop.cameraConfig
|
|
8978
8967
|
};
|
|
8979
8968
|
let url = camera.webrtcTemplateMerged;
|
|
8980
|
-
play = new WebRtcMt$1({
|
|
8969
|
+
play = vue.reactive(new WebRtcMt$1({
|
|
8981
8970
|
plays: {
|
|
8982
8971
|
videoElm: `videoPlayer_${uuid}`,
|
|
8983
8972
|
mediaServerAddr: camera.mediaServerPo.url,
|
|
@@ -8989,8 +8978,22 @@ const VideoPlayerV2 = vue.defineComponent({
|
|
|
8989
8978
|
cameraStream: camera.streamType,
|
|
8990
8979
|
addRtspProxyUrl: url
|
|
8991
8980
|
}
|
|
8992
|
-
});
|
|
8981
|
+
}));
|
|
8982
|
+
const {
|
|
8983
|
+
p_player
|
|
8984
|
+
} = vue.toRefs(play);
|
|
8985
|
+
playerRef.value = core.resolveRef(p_player);
|
|
8993
8986
|
};
|
|
8987
|
+
const playerRef = vue.ref();
|
|
8988
|
+
vue.watchEffect(() => {
|
|
8989
|
+
if (playerRef.value) {
|
|
8990
|
+
if (playerRef.value.value === "error") {
|
|
8991
|
+
console.log("p_player ===> add 500");
|
|
8992
|
+
stopPlay();
|
|
8993
|
+
getVideoDetail(_prop.camera);
|
|
8994
|
+
}
|
|
8995
|
+
}
|
|
8996
|
+
});
|
|
8994
8997
|
const releaseUrl = vue.ref("");
|
|
8995
8998
|
const release = async () => {
|
|
8996
8999
|
const res = await axios__default["default"].get(releaseUrl.value);
|
package/dist/components/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { defineComponent, createVNode, ref, watch, resolveComponent, isVNode, computed, onBeforeUnmount, inject, onActivated, onDeactivated, nextTick, watchEffect, Fragment, withDirectives, vShow, toRaw, reactive, provide, createTextVNode, onMounted, KeepAlive, shallowRef, onBeforeMount, mergeProps, onBeforeUpdate, Teleport } from 'vue';
|
|
1
|
+
import { defineComponent, createVNode, ref, watch, resolveComponent, isVNode, computed, onBeforeUnmount, inject, onActivated, onDeactivated, nextTick, watchEffect, Fragment, withDirectives, vShow, toRaw, reactive, provide, createTextVNode, onMounted, KeepAlive, toRefs, shallowRef, onBeforeMount, mergeProps, onBeforeUpdate, Teleport } from 'vue';
|
|
2
2
|
import { createFromIconfontCN, SearchOutlined, DownOutlined, PoweroffOutlined, MenuUnfoldOutlined, MenuFoldOutlined, SkinFilled, FullscreenOutlined, CaretUpOutlined, CaretRightOutlined, CaretDownOutlined, FileExcelTwoTone, InboxOutlined, MessageOutlined } from '@ant-design/icons-vue';
|
|
3
3
|
import { useRoute, useRouter } from 'vue-router';
|
|
4
4
|
import { useMounted, resolveRef, useThrottleFn, useLocalStorage, useFullscreen, useMouseInElement, useVModel, useMagicKeys, whenever, watchArray, useEventListener, useSessionStorage, useElementBounding, useToggle, useMemory, useWindowSize, useClipboard, useBreakpoints, breakpointsAntDesign } from '@vueuse/core';
|
|
@@ -183,20 +183,18 @@ function getIframeUrl(url) {
|
|
|
183
183
|
async function checkIframeUrl(url) {
|
|
184
184
|
const iframeUrl = getIframeUrl(url);
|
|
185
185
|
let code = 200;
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
code = 500;
|
|
196
|
-
}
|
|
186
|
+
try {
|
|
187
|
+
const res = await fetch(`/api/common/v1/sysconfig/curlForResponseCode?requestMethod=get&url=${encodeURIComponent(iframeUrl)}`, {
|
|
188
|
+
headers: getCommonHeaders()
|
|
189
|
+
});
|
|
190
|
+
if (res.status !== 404) {
|
|
191
|
+
const json = await res.json();
|
|
192
|
+
code = json.data;
|
|
193
|
+
if (json.code === "M5001") {
|
|
194
|
+
code = 500;
|
|
197
195
|
}
|
|
198
|
-
}
|
|
199
|
-
}
|
|
196
|
+
}
|
|
197
|
+
} catch (e) {}
|
|
200
198
|
return code;
|
|
201
199
|
}
|
|
202
200
|
|
|
@@ -6354,6 +6352,7 @@ const Endpoint = RTCEndpoint;
|
|
|
6354
6352
|
class WebRtcMt$1 {
|
|
6355
6353
|
constructor(opt) {
|
|
6356
6354
|
this.opt = opt;
|
|
6355
|
+
this.p_player = ref();
|
|
6357
6356
|
this.init(opt);
|
|
6358
6357
|
}
|
|
6359
6358
|
opt;
|
|
@@ -6393,7 +6392,7 @@ class WebRtcMt$1 {
|
|
|
6393
6392
|
if (opt.h) this.config.h = opt.h;
|
|
6394
6393
|
if (opt.w) this.config.w = opt.w;
|
|
6395
6394
|
if (Object.prototype.toString.call(opt.plays) === "[object Object]") {
|
|
6396
|
-
this.p_player = this.createVideo(opt.plays);
|
|
6395
|
+
this.p_player.value = this.createVideo(opt.plays);
|
|
6397
6396
|
} else {
|
|
6398
6397
|
for (const i of opt.plays) {
|
|
6399
6398
|
this.createVideo(i);
|
|
@@ -6414,19 +6413,15 @@ class WebRtcMt$1 {
|
|
|
6414
6413
|
response.json().then(res => {
|
|
6415
6414
|
if (res.code === 0) {
|
|
6416
6415
|
this.startPlay(plays);
|
|
6416
|
+
resolve(res);
|
|
6417
6417
|
} else {
|
|
6418
6418
|
console.log("\u62C9\u6D41\u63A5\u53E3\u8FD4\u56DE\u5931\u8D25");
|
|
6419
|
-
|
|
6420
|
-
this.rePlay();
|
|
6421
|
-
}, 3 * 60 * 1e3);
|
|
6419
|
+
reject("error");
|
|
6422
6420
|
}
|
|
6423
|
-
resolve(res);
|
|
6424
6421
|
});
|
|
6425
6422
|
}).catch(err => {
|
|
6426
6423
|
console.log("\u62C9\u6D41\u63A5\u53E3\u5931\u8D25");
|
|
6427
|
-
|
|
6428
|
-
this.rePlay();
|
|
6429
|
-
}, 3 * 60 * 1e3);
|
|
6424
|
+
reject("error");
|
|
6430
6425
|
});
|
|
6431
6426
|
});
|
|
6432
6427
|
}
|
|
@@ -6482,7 +6477,7 @@ class WebRtcMt$1 {
|
|
|
6482
6477
|
this.rePlay(videoElm);
|
|
6483
6478
|
});
|
|
6484
6479
|
player.on(Events.WEBRTC_ON_CONNECTION_STATE_CHANGE, state => {
|
|
6485
|
-
|
|
6480
|
+
console.log("webrtc:" + state);
|
|
6486
6481
|
if (state === "disconnected" || state === "failed") {
|
|
6487
6482
|
this.rePlay(videoElm);
|
|
6488
6483
|
}
|
|
@@ -6493,13 +6488,12 @@ class WebRtcMt$1 {
|
|
|
6493
6488
|
console.log("\u5E95\u90E8\u505C\u6B62\u64AD\u653E");
|
|
6494
6489
|
this.stopPlay();
|
|
6495
6490
|
setTimeout(() => {
|
|
6496
|
-
|
|
6497
|
-
|
|
6498
|
-
},
|
|
6491
|
+
this.p_player.value = "error";
|
|
6492
|
+
console.log("\u5E95\u90E8\u91CD\u64AD", this.p_player.value);
|
|
6493
|
+
}, 3 * 1e3);
|
|
6499
6494
|
}
|
|
6500
6495
|
// 播放
|
|
6501
6496
|
play(videoElm) {
|
|
6502
|
-
console.log("\u5F00\u59CB\u89C6\u9891\u521D\u59CB\u5316");
|
|
6503
6497
|
const plays = this.mediaServerAddrMap.get(videoElm);
|
|
6504
6498
|
const {
|
|
6505
6499
|
sdpUrl
|
|
@@ -8704,24 +8698,20 @@ const getDetailContainer = () => defineComponent({
|
|
|
8704
8698
|
}
|
|
8705
8699
|
};
|
|
8706
8700
|
const addTab = _.debounce(newRoute => {
|
|
8707
|
-
dataId.value = newRoute.params.id
|
|
8701
|
+
dataId.value = newRoute.params.id;
|
|
8708
8702
|
const {
|
|
8709
|
-
name
|
|
8710
|
-
newTab
|
|
8703
|
+
name
|
|
8711
8704
|
} = route.query;
|
|
8712
|
-
if (newTab) {
|
|
8713
|
-
dataId.value = newTab;
|
|
8714
|
-
}
|
|
8715
8705
|
const tab = {
|
|
8716
8706
|
name,
|
|
8717
8707
|
url: route.fullPath,
|
|
8718
8708
|
key: props.name,
|
|
8719
|
-
uniqueKey:
|
|
8709
|
+
uniqueKey: newRoute.params.id,
|
|
8720
8710
|
icon: props.icon,
|
|
8721
8711
|
isExtraTab: true,
|
|
8722
8712
|
params: _.omit(route.query, "name")
|
|
8723
8713
|
};
|
|
8724
|
-
const detail = detailList.value.find(item => item.
|
|
8714
|
+
const detail = detailList.value.find(item => item.uniqueKey === tab.uniqueKey);
|
|
8725
8715
|
if (detail) {
|
|
8726
8716
|
detail.url = newRoute.fullPath;
|
|
8727
8717
|
if (Array.isArray(qiankunState.value.extraTabs)) {
|
|
@@ -8737,7 +8727,7 @@ const getDetailContainer = () => defineComponent({
|
|
|
8737
8727
|
detailList.value.push({
|
|
8738
8728
|
...tab,
|
|
8739
8729
|
refreshKey: Date.now(),
|
|
8740
|
-
id:
|
|
8730
|
+
id: newRoute.params.id
|
|
8741
8731
|
});
|
|
8742
8732
|
console.log("detailList.value", detailList.value);
|
|
8743
8733
|
setTimeout(() => {
|
|
@@ -8916,7 +8906,7 @@ const VideoPlayerV2 = defineComponent({
|
|
|
8916
8906
|
props: props$8,
|
|
8917
8907
|
emits: ["changeStream"],
|
|
8918
8908
|
setup(_prop, _context) {
|
|
8919
|
-
let play;
|
|
8909
|
+
let play = reactive({});
|
|
8920
8910
|
const uuid = _prop.domId;
|
|
8921
8911
|
const videoFull = id => {
|
|
8922
8912
|
const elm = document.getElementById(`videoPlayer_${uuid}`);
|
|
@@ -8937,19 +8927,18 @@ const VideoPlayerV2 = defineComponent({
|
|
|
8937
8927
|
};
|
|
8938
8928
|
const videoInfo2 = ref({});
|
|
8939
8929
|
const stopPlay = () => {
|
|
8940
|
-
if (play) {
|
|
8930
|
+
if ("stopPlay" in play) {
|
|
8941
8931
|
play.stopPlay(`videoPlayer_${uuid}`);
|
|
8942
8932
|
}
|
|
8943
8933
|
};
|
|
8944
8934
|
const init = () => {
|
|
8945
|
-
play = null;
|
|
8946
8935
|
let camera = videoInfo2.value;
|
|
8947
8936
|
camera = {
|
|
8948
8937
|
...camera,
|
|
8949
8938
|
..._prop.cameraConfig
|
|
8950
8939
|
};
|
|
8951
8940
|
let url = camera.webrtcTemplateMerged;
|
|
8952
|
-
play = new WebRtcMt$1({
|
|
8941
|
+
play = reactive(new WebRtcMt$1({
|
|
8953
8942
|
plays: {
|
|
8954
8943
|
videoElm: `videoPlayer_${uuid}`,
|
|
8955
8944
|
mediaServerAddr: camera.mediaServerPo.url,
|
|
@@ -8961,8 +8950,22 @@ const VideoPlayerV2 = defineComponent({
|
|
|
8961
8950
|
cameraStream: camera.streamType,
|
|
8962
8951
|
addRtspProxyUrl: url
|
|
8963
8952
|
}
|
|
8964
|
-
});
|
|
8953
|
+
}));
|
|
8954
|
+
const {
|
|
8955
|
+
p_player
|
|
8956
|
+
} = toRefs(play);
|
|
8957
|
+
playerRef.value = resolveRef(p_player);
|
|
8965
8958
|
};
|
|
8959
|
+
const playerRef = ref();
|
|
8960
|
+
watchEffect(() => {
|
|
8961
|
+
if (playerRef.value) {
|
|
8962
|
+
if (playerRef.value.value === "error") {
|
|
8963
|
+
console.log("p_player ===> add 500");
|
|
8964
|
+
stopPlay();
|
|
8965
|
+
getVideoDetail(_prop.camera);
|
|
8966
|
+
}
|
|
8967
|
+
}
|
|
8968
|
+
});
|
|
8966
8969
|
const releaseUrl = ref("");
|
|
8967
8970
|
const release = async () => {
|
|
8968
8971
|
const res = await axios$2.get(releaseUrl.value);
|
package/dist/hooks/index.cjs
CHANGED
|
@@ -5989,6 +5989,7 @@ const playOneWebRtcMt = async (uuid, domId, dom, token) => {
|
|
|
5989
5989
|
class WebRtcMt {
|
|
5990
5990
|
constructor(opt) {
|
|
5991
5991
|
this.opt = opt;
|
|
5992
|
+
this.p_player = vue.ref();
|
|
5992
5993
|
this.init(opt);
|
|
5993
5994
|
}
|
|
5994
5995
|
opt;
|
|
@@ -6028,7 +6029,7 @@ class WebRtcMt {
|
|
|
6028
6029
|
if (opt.h) this.config.h = opt.h;
|
|
6029
6030
|
if (opt.w) this.config.w = opt.w;
|
|
6030
6031
|
if (Object.prototype.toString.call(opt.plays) === "[object Object]") {
|
|
6031
|
-
this.p_player = this.createVideo(opt.plays);
|
|
6032
|
+
this.p_player.value = this.createVideo(opt.plays);
|
|
6032
6033
|
} else {
|
|
6033
6034
|
for (const i of opt.plays) {
|
|
6034
6035
|
this.createVideo(i);
|
|
@@ -6049,19 +6050,15 @@ class WebRtcMt {
|
|
|
6049
6050
|
response.json().then(res => {
|
|
6050
6051
|
if (res.code === 0) {
|
|
6051
6052
|
this.startPlay(plays);
|
|
6053
|
+
resolve(res);
|
|
6052
6054
|
} else {
|
|
6053
6055
|
console.log("\u62C9\u6D41\u63A5\u53E3\u8FD4\u56DE\u5931\u8D25");
|
|
6054
|
-
|
|
6055
|
-
this.rePlay();
|
|
6056
|
-
}, 3 * 60 * 1e3);
|
|
6056
|
+
reject("error");
|
|
6057
6057
|
}
|
|
6058
|
-
resolve(res);
|
|
6059
6058
|
});
|
|
6060
6059
|
}).catch(err => {
|
|
6061
6060
|
console.log("\u62C9\u6D41\u63A5\u53E3\u5931\u8D25");
|
|
6062
|
-
|
|
6063
|
-
this.rePlay();
|
|
6064
|
-
}, 3 * 60 * 1e3);
|
|
6061
|
+
reject("error");
|
|
6065
6062
|
});
|
|
6066
6063
|
});
|
|
6067
6064
|
}
|
|
@@ -6117,7 +6114,7 @@ class WebRtcMt {
|
|
|
6117
6114
|
this.rePlay(videoElm);
|
|
6118
6115
|
});
|
|
6119
6116
|
player.on(Events.WEBRTC_ON_CONNECTION_STATE_CHANGE, state => {
|
|
6120
|
-
|
|
6117
|
+
console.log("webrtc:" + state);
|
|
6121
6118
|
if (state === "disconnected" || state === "failed") {
|
|
6122
6119
|
this.rePlay(videoElm);
|
|
6123
6120
|
}
|
|
@@ -6128,13 +6125,12 @@ class WebRtcMt {
|
|
|
6128
6125
|
console.log("\u5E95\u90E8\u505C\u6B62\u64AD\u653E");
|
|
6129
6126
|
this.stopPlay();
|
|
6130
6127
|
setTimeout(() => {
|
|
6131
|
-
|
|
6132
|
-
|
|
6133
|
-
},
|
|
6128
|
+
this.p_player.value = "error";
|
|
6129
|
+
console.log("\u5E95\u90E8\u91CD\u64AD", this.p_player.value);
|
|
6130
|
+
}, 3 * 1e3);
|
|
6134
6131
|
}
|
|
6135
6132
|
// 播放
|
|
6136
6133
|
play(videoElm) {
|
|
6137
|
-
console.log("\u5F00\u59CB\u89C6\u9891\u521D\u59CB\u5316");
|
|
6138
6134
|
const plays = this.mediaServerAddrMap.get(videoElm);
|
|
6139
6135
|
const {
|
|
6140
6136
|
sdpUrl
|
package/dist/hooks/index.js
CHANGED
|
@@ -5980,6 +5980,7 @@ const playOneWebRtcMt = async (uuid, domId, dom, token) => {
|
|
|
5980
5980
|
class WebRtcMt {
|
|
5981
5981
|
constructor(opt) {
|
|
5982
5982
|
this.opt = opt;
|
|
5983
|
+
this.p_player = ref();
|
|
5983
5984
|
this.init(opt);
|
|
5984
5985
|
}
|
|
5985
5986
|
opt;
|
|
@@ -6019,7 +6020,7 @@ class WebRtcMt {
|
|
|
6019
6020
|
if (opt.h) this.config.h = opt.h;
|
|
6020
6021
|
if (opt.w) this.config.w = opt.w;
|
|
6021
6022
|
if (Object.prototype.toString.call(opt.plays) === "[object Object]") {
|
|
6022
|
-
this.p_player = this.createVideo(opt.plays);
|
|
6023
|
+
this.p_player.value = this.createVideo(opt.plays);
|
|
6023
6024
|
} else {
|
|
6024
6025
|
for (const i of opt.plays) {
|
|
6025
6026
|
this.createVideo(i);
|
|
@@ -6040,19 +6041,15 @@ class WebRtcMt {
|
|
|
6040
6041
|
response.json().then(res => {
|
|
6041
6042
|
if (res.code === 0) {
|
|
6042
6043
|
this.startPlay(plays);
|
|
6044
|
+
resolve(res);
|
|
6043
6045
|
} else {
|
|
6044
6046
|
console.log("\u62C9\u6D41\u63A5\u53E3\u8FD4\u56DE\u5931\u8D25");
|
|
6045
|
-
|
|
6046
|
-
this.rePlay();
|
|
6047
|
-
}, 3 * 60 * 1e3);
|
|
6047
|
+
reject("error");
|
|
6048
6048
|
}
|
|
6049
|
-
resolve(res);
|
|
6050
6049
|
});
|
|
6051
6050
|
}).catch(err => {
|
|
6052
6051
|
console.log("\u62C9\u6D41\u63A5\u53E3\u5931\u8D25");
|
|
6053
|
-
|
|
6054
|
-
this.rePlay();
|
|
6055
|
-
}, 3 * 60 * 1e3);
|
|
6052
|
+
reject("error");
|
|
6056
6053
|
});
|
|
6057
6054
|
});
|
|
6058
6055
|
}
|
|
@@ -6108,7 +6105,7 @@ class WebRtcMt {
|
|
|
6108
6105
|
this.rePlay(videoElm);
|
|
6109
6106
|
});
|
|
6110
6107
|
player.on(Events.WEBRTC_ON_CONNECTION_STATE_CHANGE, state => {
|
|
6111
|
-
|
|
6108
|
+
console.log("webrtc:" + state);
|
|
6112
6109
|
if (state === "disconnected" || state === "failed") {
|
|
6113
6110
|
this.rePlay(videoElm);
|
|
6114
6111
|
}
|
|
@@ -6119,13 +6116,12 @@ class WebRtcMt {
|
|
|
6119
6116
|
console.log("\u5E95\u90E8\u505C\u6B62\u64AD\u653E");
|
|
6120
6117
|
this.stopPlay();
|
|
6121
6118
|
setTimeout(() => {
|
|
6122
|
-
|
|
6123
|
-
|
|
6124
|
-
},
|
|
6119
|
+
this.p_player.value = "error";
|
|
6120
|
+
console.log("\u5E95\u90E8\u91CD\u64AD", this.p_player.value);
|
|
6121
|
+
}, 3 * 1e3);
|
|
6125
6122
|
}
|
|
6126
6123
|
// 播放
|
|
6127
6124
|
play(videoElm) {
|
|
6128
|
-
console.log("\u5F00\u59CB\u89C6\u9891\u521D\u59CB\u5316");
|
|
6129
6125
|
const plays = this.mediaServerAddrMap.get(videoElm);
|
|
6130
6126
|
const {
|
|
6131
6127
|
sdpUrl
|