Просмотр исходного кода

2022/3/16 web端与其他端互通无法获取其音频问题

zkl 3 лет назад
Родитель
Сommit
8c4701df2b
2 измененных файлов с 14 добавлено и 13 удалено
  1. 2 2
      minggao/config/index.js
  2. 12 11
      minggao/src/page/commandCenter/realTime.vue

+ 2 - 2
minggao/config/index.js

@@ -12,9 +12,9 @@ module.exports = {
     assetsPublicPath: '/',
     proxyTable: {
       '/api': {
-         target: 'http://192.168.1.17:12345', //翟毅飞
+        //  target: 'http://192.168.1.17:12345', //翟毅飞
         //  target: 'https://yfznscd.com', //线上
-        //  target: 'https://www.toreskj.com', //线上
+         target: 'https://www.toreskj.com', //线上
         // target: 'http://192.168.1.77:12345', //曹世祥
         // target:"http://114.115.147.140:12345",
         // target: 'https://www.yfznscd.com',

+ 12 - 11
minggao/src/page/commandCenter/realTime.vue

@@ -254,7 +254,7 @@
             />
             <img v-else src="../../assets/images/realTime/9.png" alt="" />
           </div> -->
-          <div v-if="audioShow" style="margin: 0 10px 0 0">
+          <!-- <div v-if="audioShow" style="margin: 0 10px 0 0">
             <img
               v-if="camera"
               @click="notPlugFlow"
@@ -267,7 +267,7 @@
               src="../../assets/images/realTime/11.png"
               alt=""
             />
-          </div>
+          </div> -->
           <el-button
             type="danger"
             style="padding: 2px 10px; margin: -2px 10px 0 0"
@@ -752,7 +752,8 @@ export default {
     },
     // 拉流
     async tensile(streamID) {
-      const remoteStream = await this.zg.startPlayingStream(streamID);
+      var playOption = {videoDecodeType: 'H264'}
+      const remoteStream = await this.zg.startPlayingStream(streamID, playOption);
       // remoteVideo 为本地 <video> 或 <audio> 对象
       this.$refs["remoteVideo"].srcObject = remoteStream;
     },
@@ -866,7 +867,7 @@ export default {
           if (this.fullscreenLoading !== null) {
             this.websock.send(JSON.stringify(obj1));
           }
-          this.fullscreenLoading.close(); // 加载关闭
+          // this.fullscreenLoading.close(); // 加载关闭
         };
         this.websock.onmessage = (event) => {
           var data = JSON.parse(event.data);
@@ -949,7 +950,7 @@ export default {
           console.log(event);
           console.log(that.timeoutnum);
           if (that.timeoutnum !== null) {
-            this.openFullScreen2();
+            // this.openFullScreen2();
             setTimeout(() => {
               // that.websock.close(); // 先关闭
               clearTimeout(that.timeoutObj); //清除时间
@@ -1136,12 +1137,12 @@ export default {
 
     // websocket断开加载框
     openFullScreen2() {
-      this.fullscreenLoading = this.$loading({
-        lock: true,
-        text: "通信异常,连接中...",
-        spinner: "el-icon-loading",
-        background: "rgba(0, 0, 0, 0.7)",
-      });
+      // this.fullscreenLoading = this.$loading({
+      //   lock: true,
+      //   text: "通信异常,连接中...",
+      //   spinner: "el-icon-loading",
+      //   background: "rgba(0, 0, 0, 0.7)",
+      // });
     },
   },
   //生命周期 - 创建完成(可以访问当前this实例)