|
@@ -57,8 +57,8 @@ const router = useRouter();
|
|
|
// 当前监控地址
|
|
// 当前监控地址
|
|
|
const currentUrl = ref("");
|
|
const currentUrl = ref("");
|
|
|
|
|
|
|
|
-// 当前监控通道
|
|
|
|
|
-const currentD = ref("");
|
|
|
|
|
|
|
+// 当前监控通道 默认学习大门
|
|
|
|
|
+const currentD = ref("D70");
|
|
|
|
|
|
|
|
const treeProps = {
|
|
const treeProps = {
|
|
|
label: "spotName",
|
|
label: "spotName",
|
|
@@ -69,6 +69,7 @@ const treeProps = {
|
|
|
const dataSource = ref([]);
|
|
const dataSource = ref([]);
|
|
|
|
|
|
|
|
onMounted(() => {
|
|
onMounted(() => {
|
|
|
|
|
+ startVideo();
|
|
|
// 获取列表数据
|
|
// 获取列表数据
|
|
|
getVideoList();
|
|
getVideoList();
|
|
|
});
|
|
});
|
|
@@ -88,7 +89,7 @@ const getVideoList = async () => {
|
|
|
};
|
|
};
|
|
|
|
|
|
|
|
// 点击树状结构每一个节点触发的回调
|
|
// 点击树状结构每一个节点触发的回调
|
|
|
-const handleNodeClick = async (data: any) => {
|
|
|
|
|
|
|
+const handleNodeClick = (data: any) => {
|
|
|
if (currentD.value) {
|
|
if (currentD.value) {
|
|
|
// 关流请求
|
|
// 关流请求
|
|
|
stopVideo();
|
|
stopVideo();
|
|
@@ -97,19 +98,23 @@ const handleNodeClick = async (data: any) => {
|
|
|
if (data.d) {
|
|
if (data.d) {
|
|
|
currentD.value = data.d;
|
|
currentD.value = data.d;
|
|
|
// 监控拉流
|
|
// 监控拉流
|
|
|
- const res = await reqVideoPull({
|
|
|
|
|
- d: currentD.value,
|
|
|
|
|
- nowLine: "1",
|
|
|
|
|
- isNvr: "1",
|
|
|
|
|
- });
|
|
|
|
|
- // console.log(res);
|
|
|
|
|
-
|
|
|
|
|
- currentUrl.value = res.data.mp4;
|
|
|
|
|
|
|
+ startVideo(currentD.value);
|
|
|
} else {
|
|
} else {
|
|
|
currentUrl.value = "";
|
|
currentUrl.value = "";
|
|
|
}
|
|
}
|
|
|
};
|
|
};
|
|
|
|
|
|
|
|
|
|
+// 拉流请求
|
|
|
|
|
+const startVideo = async (d: string = currentD.value) => {
|
|
|
|
|
+ const res = await reqVideoPull({
|
|
|
|
|
+ d,
|
|
|
|
|
+ nowLine: "1",
|
|
|
|
|
+ isNvr: "1",
|
|
|
|
|
+ });
|
|
|
|
|
+ // console.log(res);
|
|
|
|
|
+ currentUrl.value = res.data.mp4;
|
|
|
|
|
+};
|
|
|
|
|
+
|
|
|
// 关流请求
|
|
// 关流请求
|
|
|
const stopVideo = async () => {
|
|
const stopVideo = async () => {
|
|
|
await reqVideoStop({
|
|
await reqVideoStop({
|
|
@@ -199,6 +204,10 @@ const handleClose = () => {
|
|
|
width: 100%;
|
|
width: 100%;
|
|
|
height: 100%;
|
|
height: 100%;
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
|
|
+ video::-webkit-media-controls-timeline {
|
|
|
|
|
+ display: none !important;
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|