Browse Source

fix: stash

lvkun996 3 năm trước cách đây
mục cha
commit
657c3eb831

+ 1 - 1
src/api/rts/stream.ts

@@ -124,7 +124,7 @@ export const stopRecord = (id: string) => {
 /** 录制播放 */
 // url: `/record/${id}.${format}`,
 export const playRecord = (id: string, format: 'flv'| 'mp4' | 'm3u8' | 'h264'| 'h265') => {
-  return request<RTS.STREAM.Detail[]>({
+  return request<string>({
     url: `/record/${id}`,
     method: 'GET'
   })

+ 1 - 1
src/components/VideoPlayer/index.tsx

@@ -9,7 +9,7 @@ export const VideoPlayerTsx = defineComponent({
   props: {
     videoUrl: {
       type: String,
-      default: '/rts-api/hdl/live/test.flv'
+      default: '/rts/hdl/live/test.flv'
     }
   },
   setup (props, ctx) {

+ 1 - 2
src/controller/rts/rts.ts

@@ -71,8 +71,7 @@ export class RtsController {
   }
 
   static async playRecord (id: string, format: 'flv'| 'mp4' | 'm3u8' | 'h264'| 'h265') {
-    await playRecord(id, format)
-    message.success('操作成功')
+    return await playRecord(id, format)
   }
 
   static async stopRecord (id: string) {

+ 7 - 2
src/pages/rts/record/index.vue

@@ -169,7 +169,8 @@ const state = reactive({
   detail: {},
   streams: [],
   type: 'flv',
-  videoUrl: ''
+  videoUrl: '',
+  videoStream: ''
 })
 
 watch(
@@ -193,7 +194,11 @@ const recordVideo = async () => {
 }
 
 const recordPlay = async (record) => {
-  await RtsController.playRecord(record.Path, 'flv')
+  const data = await RtsController.playRecord(record.Path, 'flv')
+  state.visible = true
+  state.videoStream = data
+  console.log(data)
+
   getRecordingList()
 }
 

+ 2 - 0
src/service/request.ts

@@ -31,6 +31,8 @@ instance.interceptors.request.use(config => {
 
 instance.interceptors.response.use(function (response) {
   catchErr(response)
+  console.log(response.data)
+
   return response.data
 }, error => Promise.reject(error))