加入视频预览

This commit is contained in:
wuhongjian 2022-06-17 17:46:44 +08:00
parent 832d5b2ec4
commit 808e6136b3
2 changed files with 60 additions and 3 deletions

View File

@ -2,7 +2,7 @@
* @Author: hisense.wuhongjian * @Author: hisense.wuhongjian
* @Date: 2022-04-20 17:16:35 * @Date: 2022-04-20 17:16:35
* @LastEditors: hisense.wuhongjian * @LastEditors: hisense.wuhongjian
* @LastEditTime: 2022-05-26 22:40:46 * @LastEditTime: 2022-06-17 17:42:37
* @Description: 告诉大家这是什么 * @Description: 告诉大家这是什么
*/ */
import request from '@/utils/request' import request from '@/utils/request'
@ -46,3 +46,9 @@ export function correct(params) {
export function paddleocr(params) { export function paddleocr(params) {
return axios.post('http://15.72.183.90:7008/paddleocr', params, config2) return axios.post('http://15.72.183.90:7008/paddleocr', params, config2)
} }
export function getHls(id) {
return axios.get(
'http://10.110.205.1:18088/server/device/hisdeviceapplylist/url/' + id,
config2
)
}

View File

@ -147,7 +147,7 @@
免费试用 免费试用
</a-button> </a-button>
</div> </div>
<a-button v-if="cardType == '基础设施'" type="primary" @click="toView('details', item)"> <a-button v-if="cardType == '基础设施'" type="primary" @click="openVideo(item)">
在线预览 在线预览
</a-button> </a-button>
<a-button v-else type="primary" @click="toView('details', item)"> <a-button v-else type="primary" @click="toView('details', item)">
@ -163,13 +163,27 @@
</div> </div>
</div> </div>
</div> </div>
<a-modal
v-model:visible="visible"
title="视频预览"
:width="750"
destroyOnClose
>
<template #footer></template>
<div style="width: 100%; display: flex; justify-content: center">
<div style="width: 100%; height: 100%">
<vue3VideoPlay v-bind="options" />
</div>
</div>
</a-modal>
</div> </div>
</template> </template>
<script> <script>
import { ref } from 'vue' import { ref, reactive } from 'vue'
import { message } from 'ant-design-vue' import { message } from 'ant-design-vue'
import { useRouter } from 'vue-router' import { useRouter } from 'vue-router'
import { getHls } from '@/api/file.js'
import { getUser, sgcInsert } from '@/api/home' import { getUser, sgcInsert } from '@/api/home'
import { scInsert, scDel } from '@/api/personalCenter' import { scInsert, scDel } from '@/api/personalCenter'
import mybus from '@/myplugins/mybus' import mybus from '@/myplugins/mybus'
@ -277,6 +291,34 @@
components: {}, components: {},
setup(props) { setup(props) {
let shoppingKey = ref(1) let shoppingKey = ref(1)
let visible = ref(false)
const options = reactive({
width: '700px', //
height: '400px', //
color: '#409eff', //
title: '', //
src: '', //
type: 'm3u8', //
muted: false, //
webFullScreen: false,
speedRate: ['0.75', '1.0', '1.25', '1.5', '2.0'], //
autoPlay: true, //
loop: false, //
mirror: false, //
ligthOff: false, //
volume: 0.3, //
control: true, //
controlBtns: [
'audioTrack',
'quality',
'speedRate',
'volume',
'setting',
'pip',
'pageFullScreen',
'fullScreen',
], //,
})
// id // id
const selList = ref([ const selList = ref([
{ name: '发布时间', value: 'tdr.create_date' }, { name: '发布时间', value: 'tdr.create_date' },
@ -335,6 +377,15 @@
}) })
} }
} }
//
const openVideo = (item) => {
getHls(item.cameraIndexCode).then((res) => {
console.log('获取视频地址===============>', res)
// videoUrl.value = res.data.data
options.src = res.data.data
visible.value = true
})
}
// //
const addShoppingCart = (item, index) => { const addShoppingCart = (item, index) => {
console.log('item===============>', item) console.log('item===============>', item)