yanghao 1 Minggu lalu
induk
melakukan
b5e18832e5

+ 3 - 3
src/api/pms/video/channel.ts

@@ -43,7 +43,7 @@ export function delChannel(channelId) {
 // 开始播放
 export function startPlay(deviceId, channelId) {
   return request.get({
-    url: '/sip/player/play/' + deviceId + '/' + channelId
+    url: '/rq/sip/player/play/' + deviceId + '/' + channelId  // /rq/sip/player/play
   })
 }
 
@@ -56,7 +56,7 @@ export function getStreaminfo(deviceId, channelId) {
 
 export function playback(deviceId, channelId, query) {
   return request.get({
-    url: '/sip/player/playback/' + deviceId + '/' + channelId,
+    url: '/rq/sip/player/playback/' + deviceId + '/' + channelId,
 
     params: query
   })
@@ -64,7 +64,7 @@ export function playback(deviceId, channelId, query) {
 
 export function closeStream(deviceId, channelId, streamId) {
   return request.get({
-    url: '/sip/player/closeStream/' + deviceId + '/' + channelId + '/' + streamId
+    url: '/rq/sip/player/closeStream/' + deviceId + '/' + channelId + '/' + streamId
   })
 }
 

+ 2 - 2
src/views/pms/video_center/device/device-edit.vue

@@ -642,7 +642,7 @@ const sipidGenRef = ref()
 const runningStatusRef = ref()
 const realTimeStatusRef = ref()
 const ChannelRef = ref()
-const deviceLiveStreamRef = ref()
+const deviceLiveStreamRef = ref(null)
 const deviceVideoRef = ref()
 const OssRecordRef = ref()
 const deviceTimerRef = ref()
@@ -794,7 +794,7 @@ const getPlayerData = (data) => {
   activeName.value = data.tabName
   channelId.value = data.channelId
   nextTick(() => {
-    if (channelId.value) {
+    if (channelId.value && deviceLiveStreamRef.value) {
       deviceLiveStreamRef.value.channelId = channelId.value
       deviceLiveStreamRef.value.changeChannel()
     }

+ 3 - 1
src/views/pms/video_center/sip/channel.vue

@@ -61,7 +61,8 @@
       </el-table-column>
       <el-table-column :label="t('sip.channel998532-5')" align="center" prop="status" width="80">
         <template #default="scope">
-          <dict-tag :options="iot_device_status" :value="scope.row.status" size="small" />
+          
+          <dict-tag :type="DICT_TYPE.IOT_DEVICE_STATUS" :value="scope.row.status" />
         </template>
       </el-table-column>
       <el-table-column
@@ -99,6 +100,7 @@ import { ref, reactive, watch, onMounted } from 'vue'
 import { Refresh, VideoPlay } from '@element-plus/icons-vue'
 import { listChannel, getChannel, delChannel } from '@/api/pms/video/channel'
 import { ElMessage, ElMessageBox } from 'element-plus'
+import {DICT_TYPE, getDictLabel, getStrDictOptions } from "@/utils/dict";
 
 const { t } = useI18n() // 国际化
 

+ 14 - 8
src/views/pms/video_center/sip/components/player/deviceLiveStream.vue

@@ -179,10 +179,12 @@ const startPlayer = () => {
   if (playrecord.value) {
     // 录像播放
     startPlayRecord(deviceId.value, channelId.value).then((response) => {
+
+      console.log('录像播放>>>>>>>>>>>>>>>>>>>>>', response)
      
-      const res = response.data
-      streamId.value = res.streamId
-      playurl.value = res.playurl
+      // const res = response.data
+      streamId.value = response.streamId
+      playurl.value = response.playurl
       playerRef.value?.play(playurl.value)
       playing.value = true
       playrecording.value = true
@@ -191,10 +193,10 @@ const startPlayer = () => {
   } else {
     // 直播播放
     startPlay(deviceId.value, channelId.value).then((response) => {
-      
-      const res = response.data
-      streamId.value = res.streamId
-      playurl.value = res.playurl
+      console.log('录像播放****************', response)
+      // const res = response.data
+      streamId.value = response.streamId
+      playurl.value = response.playurl
       playerRef.value?.play(playurl.value)
       playing.value = true
       playrecording.value = false
@@ -248,6 +250,10 @@ const destroy = () => {
 
 // 暴露给父组件的方法
 defineExpose({
-  destroy
+  destroy,
+  channelId,
+  closeDestroy,
+  playing,
+  changeChannel
 })
 </script>