fuliqi
2024-10-28 81e16742530ddcd86b368678bad74fc8eb471c63
src/views/meet/index.vue
@@ -82,9 +82,21 @@
  methods: {
    muteEveryone () {
      this.jitsiApi.executeCommand('muteEveryone', 'audio')
      const h = this.$createElement;
      this.$notify({
        title: '提示',
        message: h('i', { style: 'color: teal'}, '已全体禁音')
      });
    },
    videoEveryone () {
      this.jitsiApi.executeCommand('muteEveryone', 'video')
      const h = this.$createElement;
      this.$notify({
        title: '提示',
        message: h('i', { style: 'color: teal'}, '已关闭全体视频')
      });
    },
    handleCommand (command) {
      this.sendMessage(JSON.stringify(command))
@@ -266,13 +278,15 @@
    this.jitsiApi.addListener('readyToClose', () => {
      window.close()
    })
    // 初始化
    this.initWebSocket()
    // 每三秒更学员在线状态
    this.intervalId = setInterval(() => {
      this.getRoomInfo()
      // 发送心跳数据
      this.ws.send('ping')
    }, 2500)
    // 初始化
    this.initWebSocket()
  },
  beforeDestroy () {
    // 清除定时器,避免内存泄漏