This commit is contained in:
duanxiaohai 2024-08-27 16:29:23 +08:00
parent 5ef521805a
commit 035827670d
4 changed files with 93 additions and 43 deletions

View File

@ -8,11 +8,6 @@
<title>公共服务一体化驾驶舱</title>
<script type="text/javascript"
src="//api.map.baidu.com/api?type=webgl&v=1.0&ak=2KLQUajGSpNL2DInxT6BwdPklMNpG3hw"></script>
<!-- 视频取流 -->
<link href="https://cdn.bootcss.com/video.js/7.20.3/alt/video-js-cdn.min.css" rel="stylesheet">
<script src="https://cdn.bootcss.com/video.js/7.20.3/video.js"></script>
<!-- <script src="https://cdn.bootcss.com/videojs-contrib-hls/5.15.0/videojs-contrib-hls.min.js"></script> -->
</head>
<body>

View File

@ -63,14 +63,12 @@
</div>
</template>
<script setup>
import { ref, reactive, onMounted, defineProps, watch, nextTick } from "vue";
import { CircleCloseFilled } from "@element-plus/icons-vue";
import videojs from "video.js";
import "video.js/dist/video-js.css";
import VideojsZhcnLanguage from 'video.js/dist/lang/zh-CN.json';
videojs.addLanguage('zh-CN',VideojsZhcnLanguage);
// import Hls from 'hls.js';
// import 'videojs-contrib-hls';
import { ref, reactive, onMounted, defineProps, watch, nextTick } from "vue";
import { CircleCloseFilled } from "@element-plus/icons-vue";
import VideojsZhcnLanguage from "video.js/dist/lang/zh-CN.json";
videojs.addLanguage("zh-CN", VideojsZhcnLanguage); //
const props = defineProps({
cameraShow: {
@ -98,7 +96,7 @@ const dp = ref(null);
const attachmentLink = ref("");
const options = {
language: 'zh-CN',
language: "zh-CN",
playbackRates: [1.0],
aspectRatio: "10:5",
notSupportedMessage: "此视频暂无法播放,请稍后再试",
@ -107,6 +105,7 @@ const options = {
preload: "auto",
controls: true,
};
watch(
() => props.cameraShow,
(newVal) => {
@ -170,28 +169,33 @@ const insertVideo = () => {
// console.log(":", videoElement);
};
const loadVideo = () => {
if (dp.value) {
dp.value.dispose();
// console.log("video.js");
dp.value.dispose();
}
dp.value = videojs("videoPlayerInside", options);
// console.log("Video.js", dp.value);
};
const videoPlayer = ref(null);
// 使
onMounted(() => {
cameraShow.value = props.cameraShow;
});
const disposeVideo = () => {
if (dp.value) {
dp.value.dispose(); // dispose()Dom
dp.value = null;
// console.log("Video.js");
}
// videoBox
// const videoBox = document.getElementById("videoBox");
// if (videoBox) {
// videoBox.innerHTML = "";
// console.log("videoBox");
// }
};
// 使
onMounted(() => {
cameraShow.value = props.cameraShow;
});
const closeDialog = () => {
cameraShow.value = false;
disposeVideo();

View File

@ -63,14 +63,14 @@
</div>
</template>
<script setup>
import { ref, reactive, onMounted, defineProps, watch, nextTick } from "vue";
import { CircleCloseFilled } from "@element-plus/icons-vue";
import videojs from "video.js";
import "video.js/dist/video-js.css";
// import 'videojs-contrib-hls';
import { ref, reactive, onMounted, defineProps, watch, nextTick } from "vue";
import { CircleCloseFilled } from "@element-plus/icons-vue";
import VideojsZhcnLanguage from "video.js/dist/lang/zh-CN.json";
videojs.addLanguage("zh-CN", VideojsZhcnLanguage); //
const props = defineProps({
cameraShow: {
type: Boolean,
@ -117,20 +117,20 @@ watch(
cameraShow.value = newVal;
hlsUriSslNow.value = props.hlsUriSsl;
data.title = props.sxtname;
console.log(hlsUriSslNow.value, props.sxtname, 5555);
// console.log(hlsUriSslNow.value, props.sxtname, 5555);
attachmentLink.value = hlsUriSslNow.value;
dp.value = null;
//dom
if (num.value) {
console.log(22222, document.getElementById("videoBox"));
// console.log(22222, document.getElementById("videoBox"));
insertVideo();
}
// nextTick(() => {
nextTick(() => {
setTimeout(() => {
loadVideo();
}, 1000);
// });
});
}
}
);
@ -160,23 +160,15 @@ const options = {
muted: true,
preload: "auto",
controls: true,
hls: {},
hls:{
}
};
const loadVideo = () => {
if (videoPlayer) {
dp.value = videojs("videoPlayer", options);
}
// videojs.hook("beforeerror", (player, err) => {
// // Video.js / source err=null
// console.log("", player, err);
// if (err !== null) {
// dp.value.src(url);
// }
// // error
// return null;
// });
};
// 使
onMounted(() => {

View File

@ -213,6 +213,50 @@
/>
</div>
</div>
<div>
<div class="my-label">
<div class="my-label-title">一卡通</div>
</div>
<div class="my-table">
<el-table
:data="dataMyTag.form.data"
border
style="width: 100%"
height="270"
:header-cell-style="{
border: 'none',
height: '60px',
fontSize: '18px',
color: '#fff',
}"
:row-style="{
letterSpacing: '1px',
fontSize: '16px',
height: '50px',
backgroundColor: 'rgba(31, 63, 113, 1)',
color: '#fff',
}"
>
<template v-for="item in dataMyTag.form.column">
<el-table-column
:width="item.width"
:prop="item.property"
:label="item.label"
/>
</template>
</el-table>
<el-pagination
background
layout="prev, pager, next"
:page-size="zhpagination.pageSize"
:total="zhpagination.total"
prev-text="上一页"
next-text="下一页"
v-model:current-page="zhpagination.current"
@current-change="handlePagination1"
/>
</div>
</div>
</div>
<div v-else-if="rightType == '1'">
<div class="my-label">
@ -941,10 +985,10 @@ onMounted(() => {
align-items: center;
height: 870px;
}
.person-side {
width: 480px;
height: 100%;
overflow-y: auto;
background: linear-gradient(
270deg,
rgba(0, 52, 131, 0.69) 0%,
@ -960,6 +1004,21 @@ onMounted(() => {
border-radius: 8px;
z-index: 2;
padding: 32px;
&::-webkit-scrollbar {
width: 4px;
height: 4px;
}
&::-webkit-scrollbar-thumb {
border-radius: 2px;
background: rgba(173, 221, 255, 1);
}
&::-webkit-scrollbar-track {
border-radius: 2px;
background: rgba(255, 255, 255, 0.2);
}
}
.person-main {