| | |
| | | <div class="sjm-header-left"> |
| | | <span class="moni-name">监控点位名称: {{ currentEvent.name }} </span> |
| | | <span class="moni-area">{{ currentEvent.street }}</span> |
| | | <span>{{ currentEvent.address }}</span> |
| | | </div> |
| | | <div class="sjm-header-right"> |
| | | <el-button size="small">实时预览</el-button> |
| | |
| | | import { CATEGOTY, EVENT_SOURCE } from "@/utils/helper"; |
| | | |
| | | export default { |
| | | name: 'video-upload-page', |
| | | components: { updateInterface }, |
| | | data() { |
| | | return { |
| | |
| | | <style lang="scss" scoped> |
| | | .mainContent { |
| | | display: flex; |
| | | justify-content: start; |
| | | justify-content: flex-start; |
| | | flex-wrap: nowrap; |
| | | |
| | | .grid-content { |
| | |
| | | {{ item.name }}{{ item.community }} |
| | | </div> |
| | | <video |
| | | id="my-video" |
| | | :src="item.urlAddress" |
| | | class="video-js" |
| | | :id="item.id" |
| | | class="video-js vjs-default-skin" |
| | | controls |
| | | preload="auto" |
| | | width="210px" |
| | | height="150px" |
| | | ></video> |
| | | width="300px" |
| | | height="300px" |
| | | type="video/mp4" |
| | | :src="item.urlAddress" |
| | | > |
| | | </video> |
| | | </div> |
| | | </el-main> |
| | | <el-footer> |
| | |
| | | </el-container> |
| | | </el-container> |
| | | </template> |
| | | <script> |
| | | import departmentAside from "@/views/operate/fivepack/threepack/components/aside"; |
| | | import videoPoint from "@/api/system/videoPoint"; |
| | | |
| | | export default { |
| | | name: 'point', |
| | | components: { departmentAside }, |
| | | created() { |
| | | this.hls = new Hls(); |
| | | this.getVideoPointList(); |
| | | }, |
| | | data() { |
| | | return { |
| | | currentPage: 1, |
| | | totalNum: 10, |
| | | pageSize: 10, |
| | | videoData: [], |
| | | searchData: null, |
| | | hls: null |
| | | }; |
| | | }, |
| | | methods: { |
| | | async getVideoPointList(data) { |
| | | let communityId, streetId; |
| | | if (data) { |
| | | communityId = data.parentId; |
| | | streetId = data.id; |
| | | } |
| | | await videoPoint.getVideoPointList({ |
| | | current: this.currentPage, |
| | | size: this.pageSize, |
| | | communityId, |
| | | streetId, |
| | | }) |
| | | .then(({ records, total }) => { |
| | | this.videoData = records; |
| | | this.totalNum = total; |
| | | }) |
| | | .catch((err) => this.$message.error(err)); |
| | | this.setVideo(); |
| | | }, |
| | | setVideo() { |
| | | if (Hls.isSupported()) { |
| | | this.videoData.forEach(video => { |
| | | const videoPlayer = document.getElementById(video.id); |
| | | this.hls.loadSource(video.urlAddress); |
| | | this.hls.attachMedia(videoPlayer); |
| | | }) |
| | | } |
| | | }, |
| | | selectedDepartment(data) { |
| | | this.currentPage = 1; |
| | | data.parentId = data.id; |
| | | data.id = null; |
| | | this.searchData = data; |
| | | this.getVideoPointList(data); |
| | | }, |
| | | current_change(e) { |
| | | this.currentPage = e; |
| | | this.getVideoPointList(this.searchData); |
| | | }, |
| | | }, |
| | | beforeDestroy() { |
| | | this.hls = null; |
| | | } |
| | | }; |
| | | </script> |
| | | <style lang="scss" scoped> |
| | | .button-one { |
| | | height: 40px; |
| | |
| | | line-height: 30px; |
| | | font-size: 14px; |
| | | } |
| | | </style> |
| | | <script> |
| | | import departmentAside from "@/views/operate/fivepack/threepack/components/aside"; |
| | | import videoPoint from "@/api/system/videoPoint"; |
| | | |
| | | export default { |
| | | components: { departmentAside }, |
| | | created() { |
| | | this.getVideoPointList(); |
| | | }, |
| | | data() { |
| | | return { |
| | | currentPage: 1, |
| | | totalNum: 10, |
| | | pageSize: 10, |
| | | videoData: [], |
| | | searchData: null, |
| | | }; |
| | | }, |
| | | methods: { |
| | | getVideoPointList(data) { |
| | | let communityId, streetId; |
| | | if (data) { |
| | | communityId = data.parentId; |
| | | streetId = data.id; |
| | | } |
| | | videoPoint |
| | | .getVideoPointList({ |
| | | current: this.currentPage, |
| | | size: this.pageSize, |
| | | communityId, |
| | | streetId, |
| | | }) |
| | | .then(({ records, total }) => { |
| | | this.videoData = records; |
| | | this.totalNum = total; |
| | | }) |
| | | .catch((err) => this.$message.error(err)); |
| | | }, |
| | | selectedDepartment(data) { |
| | | this.currentPage = 1; |
| | | data.parentId = data.id; |
| | | data.id = null; |
| | | this.searchData = data; |
| | | this.getVideoPointList(data); |
| | | }, |
| | | current_change(e) { |
| | | this.currentPage = e; |
| | | this.getVideoPointList(this.searchData); |
| | | }, |
| | | }, |
| | | }; |
| | | </script> |
| | | </style> |
| | |
| | | var hls = new Hls(); |
| | | videoPoint.getVideoPointUrl(item.platResourceId).then((res) => { |
| | | |
| | | if (res.code == 0) { |
| | | if (res.code === 0) { |
| | | hls.loadSource(res.data); |
| | | hls.attachMedia(video); |
| | | hls.on(Hls.Events.MANIFEST_PARSED, function () { |