浏览代码

change
1. 调整弹窗播放器与默认的多路播放器

kindring 1 年之前
父节点
当前提交
c3cad31270

+ 2 - 3
web_src/config/index.js

@@ -3,12 +3,11 @@
 // see http://vuejs-templates.github.io/webpack for documentation.
 
 const path = require('path')
-const baseUrl = "https://127.0.0.1:19200"
-// const baseUrl = "https://hofuniot.cn:29072"
+// const baseUrl = "https://127.0.0.1:19200"
+const baseUrl = "https://hofuniot.cn:29072"
 const ZLMServer = "https://192.168.1.60:29010"
 module.exports = {
   dev: {
-
     // Paths
     assetsSubDirectory: 'static',
     assetsPublicPath: '/',

+ 8 - 3
web_src/src/components/dialog/customPlayer.vue

@@ -6,8 +6,8 @@
                :close-on-click-modal="false"
                :visible.sync="showVideoDialog"
                @close="closeHandle()">
-      <div style="width: 100%; height: 100%">
-        <rtc-player ref="webRTC" v-if="useActivePlayer === 'webRTC'" @eventCallback="playEventHandle"  :videoUrl="videoUrl" :error="videoError" :message="videoError" height="100px" :hasAudio="hasAudio" fluent autoplay live ></rtc-player>
+      <div class="playBox">
+        <rtc-player ref="webRTC" v-if="useActivePlayer === 'webRTC'" @eventCallback="playEventHandle"  :videoUrl="videoUrl" :error="videoError" :message="videoError" :hasAudio="hasAudio"  ></rtc-player>
         <mpeg-ts-video ref="flv"
                        :controller="true"
                        v-if="useActivePlayer === 'flv'" ></mpeg-ts-video>
@@ -437,7 +437,12 @@ export default {
   margin-left: 0.5rem;
   float: left;
 }
-
+.playBox{
+  width: 100%;
+  height: 500px;
+  position: relative;
+  max-height: 500px;
+}
 .control-panel {
   position: relative;
   top: 0;

+ 1 - 1
web_src/src/components/dialog/rtcPlayer.vue

@@ -165,7 +165,7 @@ export default {
         height: 100%;
     }
     .rtcPlayer > video{
-        width: 100%;
+        width: auto;
         height: 100%;
     }
 

+ 28 - 0
web_src/src/components/live.vue

@@ -174,6 +174,10 @@ export default {
         console.log("推流成功:" + videoUrl)
         itemData.playUrl = videoUrl;
         this.setPlayUrl(videoUrl, idxTmp);
+        // 添加监听
+        setTimeout(() => {
+          this.loadSsrcList()
+        }, 10 * 1000)
       } else {
         this.$message.error(res.data.msg);
       }
@@ -244,6 +248,30 @@ export default {
     },
     rtcPlayHandle(e){
       console.log(e);
+    },
+
+    addEventHandle(){
+
+    },
+
+    // 加载当前推流的情况
+    async loadSsrcList(){
+      let [err,res] = await handle(this.$axios.axios({
+        method: 'get',
+        url: '/api/play/ssrc'
+      }))
+      if(err){
+        this.$message.error('获取推流列表失败');
+        return
+      }
+
+      let response = res.data;
+      console.log(response);
+      if (response.code === 0){
+
+      }else{
+        this.$message.error(response.msg);
+      }
     }
   }
 };