648540858
2022-08-23 8f7e8efc981cf68a3067fb3421fdfbbf6f6275ab
web_src/src/components/dialog/devicePlayer.vue
@@ -871,10 +871,21 @@
            }
        },
        startBroadcast(url){
          // 获取推流鉴权Key
          this.$axios({
            method: 'post',
            url: '/api/user/userInfo',
          }).then( (res)=> {
            if (res.data.code !== 0) {
              this.$message({
                showClose: true,
                message: "获取推流鉴权Key失败",
                type: "error",
              });
            }else {
              let pushKey = res.data.data.pushKey;
          // 获取推流鉴权KEY
          console.log(this.$loginUser)
          console.log(this.$loginUser.pushKey)
          url += "&sign=" + crypto.createHash('md5').update(this.$loginUser.pushKey, "utf8").digest('hex')
              url += "&sign=" + crypto.createHash('md5').update(pushKey, "utf8").digest('hex')
          console.log("开始语音对讲: " + url)
          this.broadcastRtc = new ZLMRTCClient.Endpoint({
            debug: true, // 是否打印日志
@@ -941,6 +952,10 @@
              type: 'error'
            });
          });
            }
          });
        },
        stopBroadcast(){
          this.broadcastStatus = -2;