diff --git a/index.html b/index.html index b6d8790..ddea88f 100644 --- a/index.html +++ b/index.html @@ -27,5 +27,6 @@
+ diff --git a/src/views/iot/tplink/camera/components/CameraCommonForm.vue b/src/views/iot/tplink/camera/components/CameraCommonForm.vue index 4c34cba..9e0e7ca 100644 --- a/src/views/iot/tplink/camera/components/CameraCommonForm.vue +++ b/src/views/iot/tplink/camera/components/CameraCommonForm.vue @@ -12,7 +12,7 @@ -
+
@@ -305,9 +305,10 @@ async function preview(deviceIndex, streamType, url) { if (player.value){ player.value.destroy().then(() => { }); // 销毁 + player.value = null; } const TumsPlayer = window['tums-player'].default; - player.value = new TumsPlayer('video-container', { + player.value = new TumsPlayer('video-container-common', { type: "rtsp", // 协议类型,rtsp url: formData.url, // 取流地址, getPreviewUrl接口获取 // url: formData.backupUrl, // 取流地址, getPreviewUrl接口获取 @@ -330,7 +331,6 @@ async function preview(deviceIndex, streamType, url) { * 销毁 */ function destroy(player) { - console.log("commonDestroy"); if (player) { player.value.destroy().then(() => { }); // 销毁 @@ -349,7 +349,6 @@ function getCommon(deviceIndex) { "deviceIndex": deviceIndex, "type": "common" }).then(res => { - console.log(res); formData.chroma = strToInt(res.chroma); //色度 formData.luma = strToInt(res.luma); //亮度 formData.sharpness = strToInt(res.sharpness); //锐度 @@ -440,7 +439,6 @@ onMounted(() => { watch( () => props.data, async () => { - console.log(props.data); formData.deviceIndex = props.data.deviceIndex; getCommon(formData.deviceIndex); getSwitch(formData.deviceIndex); @@ -449,6 +447,20 @@ onMounted(() => { { deep: true, immediate: true } ); }); + +function destroyPlayer(){ + if (player){ + player.value.destroy().then(() => { + }); // 销毁 + player.value = null; + } +} + +// 暴露给父组件的方法 +defineExpose({ + destroyPlayer +}); +