Compare commits

...

2 Commits

Author SHA1 Message Date
chenchenzai 4259e48c70 Merge branch 'hi-ucs-dev' of http://192.168.124.50:3000/wuhongjian/hi-ucs into hi-ucs-dev 2022-11-21 20:32:54 +08:00
chenchenzai c619d24cf9 h5player播放接口添加 2022-11-21 20:32:28 +08:00
5 changed files with 84 additions and 18 deletions

View File

@ -116,11 +116,22 @@ export function getPlaceType() {
//西
export function CameraConditionPlaceType(params) {
return axios.post(
'http://10.134.135.92:9537/data_service/getCamera/CameraConditionPlaceType',
params,
config2
)
return axios.post(
'http://10.134.135.92:9537/data_service/getCamera/CameraConditionPlaceType' +
params,
config2
)
}
// 西wss
export function getCameraLiveStream(params) {
return axios.get(
'http://10.134.135.92:9537/data_service/getCamera/getCameraLiveStream?cameraIndexCode=' +
params.channelId +
'&protocol=' +
'wss' + '&transmode=1&streamType=1',
config2
)
}
// 西-- (10.134.135.92:9537)
let _cameraUrl =

View File

@ -1734,8 +1734,9 @@ export function MapFun(mapObj) {
// })
// }
marker.on('click', e => {
console.log('点位数据', e)
clickDataList.push(e.resourceData);
//console.log('', e)
//console.log('1', e.sourceTarget.resourceData)
clickDataList.push(e.sourceTarget.resourceData);
// marker
//const layers = layerGroup.get(layerName).getLayers()
// layers.forEach((layer) => {

View File

@ -7,6 +7,7 @@
<script>
const IS_MOVE_DEVICE = document.body.clientWidth < 992 //
const MSE_IS_SUPPORT = !!window.MediaSource // mse
import { message } from 'ant-design-vue'
export default {
name: 'H5Player',
props: {
@ -57,8 +58,20 @@ const MSE_IS_SUPPORT = !!window.MediaSource // 是否支持mse
this.createPlayer()
this.arrangeWindow()
//videoUrl this.realplay(this.videoUrl,0);//index
this.realplay('wss://10.134.135.44:6014/proxy/10.10.20.14:559/openUrl/y3mFfcA',0);
this.realplay(this.videoUrl,0);
//this.realplay('wss://10.134.135.44:6014/proxy/10.10.20.14:559/openUrl/y3mFfcA',0);
},
watch: {
videoUrl: {
//
handler(newVal, oldVal) {
console.log('oldVal:', oldVal)
console.log('newVal:', newVal)
},
//
immediate: true
}
},
methods: {
//
init () {
@ -127,7 +140,10 @@ const MSE_IS_SUPPORT = !!window.MediaSource // 是否支持mse
() => {
console.log('realplay success')
},
e => { console.error(e) }
e => {
console.error(e);
message.error('请联系视频提供方!')
}
)
},
//

View File

@ -28,11 +28,11 @@
<h5-player :video-url="videoUrl"></h5-player>
</div>
<div class="text-label">
<span>{{defaultIndex}}</span>/<span>{{cameraDataList.length}}</span>
<span>{{defaultIndex+1}}</span>/<span>{{cameraDataList.length}}</span>
</div>
<div class="footer-button">
<a-button type="primary" @click="applyNow(url)">立即申请</a-button>
<a-button type="primary" style="margin-left:20px" @click="addIntoCart(url)">加入申购车</a-button>
<a-button type="primary" @click="applyNow(cameraDataList[defaultIndex])">立即申请</a-button>
<a-button type="primary" style="margin-left:20px" @click="addIntoCart(cameraDataList[defaultIndex])">加入申购车</a-button>
</div>
</div>
</div>
@ -46,9 +46,11 @@
LeftCircleOutlined,
RightCircleOutlined,
} from '@ant-design/icons-vue'
import { useRouter } from 'vue-router'
import H5Player from '@/views/home/components/H5Player.vue'
import mybus from '@/myplugins/mybus'
import { getStreamByChannelCode } from '@/api/videoSurveillance'
import {getCameraLiveStream} from '@/api/file'
export default {
name: '',
components: {
@ -65,7 +67,9 @@
},
},
},
mounted() {},
mounted() {
this.getVideoUrl(this.cameraDataList[this.defaultIndex]);
},
// directives: {
// viewer: viewer({
// debug: true,
@ -76,7 +80,8 @@
openVideo: false,
videoStream: '',
videoUrl:'', //url
defaultIndex:0//
defaultIndex:0,//
router:useRouter()
}
},
methods: {
@ -90,32 +95,59 @@
//
applyNow(item){
console.log('applyNowapplyNow',item);
mybus.emit('selectCamera', item)
//
this.router.push({
path: '/apply',
query: {
},
})
},
//
addIntoCart(item){
console.log('addIntoCartaddIntoCart',item);
mybus.emit('selectCamera', item)
},
//
getVideoUrl(data){
let param = data;
getCameraLiveStream(param).then((res) => {
//console.log('555555rrrrr',res)
if(res.data.data){
this.videoUrl = res.data.data.url;
}
//visible.value = true
//options.src = res.data.data
//options.src ="wss://10.134.135.45:6014/proxy/10.10.20.15:559/openUrl/0kIF7La"
})
},
//
handlePrev(){
let maxLength = this.cameraDataList.length-1;
this.defaultIndex = this.defaultIndex - 1;
console.log('opopopop',this.cameraDataList[maxLength]);
if(this.defaultIndex === 0){
this.defaultIndex = maxLength;
console.log('opopopop',this.cameraDataList[maxLength]);
//channelIdurlH5
//this.videoUrl =
this.getVideoUrl(this.cameraDataList[maxLength]);
} else{
this.defaultIndex = this.defaultIndex - 1;
console.log('uyutyuyopopopop',this.cameraDataList[this.defaultIndex]);
this.getVideoUrl(this.cameraDataList[this.defaultIndex]);
}
},
//
handleNext(){
this.defaultIndex = this.defaultIndex + 1;
if(this.defaultIndex === this.cameraDataList.length){
console.log('opopopop',this.cameraDataList[0]);
this.defaultIndex = this.cameraDataList.length;
console.log('opopopop',this.cameraDataList[0]);
this.getVideoUrl(this.cameraDataList[0]);
}else{
this.defaultIndex = this.defaultIndex + 1;
console.log('opopopop',this.cameraDataList[this.defaultIndex]);
this.getVideoUrl(this.cameraDataList[this.defaultIndex]);
}
}

View File

@ -224,6 +224,12 @@ import { ElMessage } from 'element-plus'
this.queryCameraConditionPlace(data)
})
//
mybus.off('clearLeftSelect')
mybus.on('clearLeftSelect', () => {
this.hiMapFun.clearAllLayers();
})
},
methods: {
//