Compare commits

...

2 Commits

Author SHA1 Message Date
姚宇浩 2f71fcf2f5 Merge branch 'main' of https://git.cityme.com.cn/xiangshan/ggfwjsc 2024-08-23 15:26:12 +08:00
姚宇浩 1f7ce08341 gx 2024-08-23 15:26:07 +08:00
2 changed files with 47 additions and 83 deletions

View File

@ -53,17 +53,9 @@
controls
playsinline
autoplay="autoplay"
width="1080px"
>
<source :src="attachmentLink" type="application/x-mpegURL" />
</video>
<!-- <video width="1080" ref="video" controls>
<source
src="https://www.runoob.com/try/demo_source/mov_bbb.mp4"
type="video/mp4"
/>
</video> -->
</div>
</div>
</el-dialog>
@ -72,17 +64,7 @@
<script setup>
import videojs from "video.js";
import "video.js/dist/video-js.css";
import {
ref,
reactive,
onMounted,
defineProps,
onBeforeMount,
onBeforeUnmount,
watch,
nextTick,
} from "vue";
import { ref, reactive, onMounted, defineProps, watch, nextTick } from "vue";
import { CircleCloseFilled } from "@element-plus/icons-vue";
const props = defineProps({
cameraShow: {
@ -91,24 +73,12 @@ const props = defineProps({
return false;
},
},
// columns: {
// type: Array,
// default: () => {
// return [];
// },
// },
// tableData: {
// type: Array,
// default: () => {
// return [];
// },
// },
// title: {
// type: String,
// default: () => {
// return "";
// },
// },
hlsUriSsl: {
type: String,
default: () => {
return '';
},
},
});
const emit = defineEmits(["close"]);
@ -120,38 +90,27 @@ const data = reactive({
tableData: [],
});
// const videoElement = video.value;
// const videoSrc = "https://test-streams.mux.dev/x36xhzz/x36xhzz.m3u8";
const gridData = [];
//
watch(
() => props.cameraShow,
(newVal, oldVal) => {
cameraShow.value = newVal;
attachmentLink.value=props.hlsUriSsl;
nextTick(() => {
loadVideo();
// data.columns = props.columns;
});
}
);
// watch(
// () => props.tableData,
// (newVal, oldVal) => {
// data.tableData = props.tableData;
// }
// );
// const video = ref(null);
// // videoPlayer
// const videoPlayer = ref(null);
// let player = null;
const dp = ref(null);
const videoElement = ref(null);
const attachmentLink = ref(
"https://test-streams.mux.dev/x36xhzz/url_6/193039199_mp4_h264_aac_hq_7.m3u8"
""
);
const options = {
playbackRates: [0.7, 1.0, 1.5, 2.0],
aspectRatio: "16:9",
playbackRates: [0.5, 1.0, 1.5, 2.0],
aspectRatio: "10:5",
notSupportedMessage: "此视频暂无法播放,请稍后再试",
autoplay: false,
muted: true,
@ -160,41 +119,22 @@ const options = {
};
const loadVideo = () => {
if (videoElement.value) {
dp.value = videojs(videoElement.value, options);
}
dp.value = videojs("videoPlayer", options);
};
// 使
onMounted(() => {
cameraShow.value = props.cameraShow;
loadVideo();
// data.columns = props.columns;
// data.title = props.title;
// data.tableData = props.tableData;
});
// onBeforeUnmount(() => {
// // if (player) {
// // player.dispose(); //
// // }
// if (dp.value) {
// dp.value.dispose();
// }
// });
const closeDialog = () => {
cameraShow.value = false;
if (dp.value) {
dp.value.dispose(); // dispose()Dom
}
emit("close");
};
</script>
<style lang="scss" scoped>
.video-box {
width: 100%;
max-width: 500px;
max-height: 500px;
}
//
::v-deep .video-js .vjs-big-play-button {
top: 50%;
@ -208,7 +148,7 @@ const closeDialog = () => {
:deep(.el-dialog) {
--el-dialog-bg-color: none;
--el-dialog-width: 76% !important;
--el-dialog-width: 50% !important;
}
.my-header {

View File

@ -329,7 +329,12 @@
@handle="handlePaginationDialog"
>
</Dialog>
<DialogCamera :cameraShow="cameraShow" @close="close1"> </DialogCamera>
<DialogCamera
:cameraShow="camera.show"
:hlsUriSsl="camera.hlsUriSsl"
@close="close1"
>
</DialogCamera>
</div>
</template>
@ -503,7 +508,11 @@ const paginationDialog = reactive({
});
const baseInfo = ref({});
const dialogShow = ref(false);
const cameraShow = ref(false);
const camera = reactive({
show: false,
deviceCode: "",
hlsUriSsl: "",
});
const tableType = reactive({
url: "",
//
@ -792,7 +801,7 @@ const close = () => {
dialogShow.value = false;
};
const close1 = () => {
cameraShow.value = false;
camera.show = false;
};
//
const handlePagination = (currentPage) => {
@ -841,7 +850,20 @@ const oneCardSolution = () => {
};
//
const openCamera = () => {
cameraShow.value = true;
getCameraUrl();
camera.show = true;
};
//
const getCameraUrl = () => {
// camera.deviceCode = dataMyTag.camera.sbbm;
camera.deviceCode = "3KSCP274757F2JU";
http
.get(`/api/ggfwyth/ysyzt/getPlayAddress?deviceCode=${camera.deviceCode}`)
.then((res) => {
if (res.code == 200) {
camera.hlsUriSsl = res.data.hlsUriSsl;
}
});
};
const back = () => {
if (jump.value == "detail") {
@ -859,6 +881,7 @@ watch(
onClickTag2("出生", "出生");
jump.value = "map";
getshs();
getCameraUrl();
}
);
onMounted(() => {
@ -871,6 +894,7 @@ onMounted(() => {
}
onClickTag2("出生", "出生");
getshs();
getCameraUrl();
} else {
jump.value = "map";
}