Kaynağa Gözat

Merge branch 'master' of http://git.cc-lotus.info/live-platform/live-cms

reloaded 4 yıl önce
ebeveyn
işleme
151b1bd104
2 değiştirilmiş dosya ile 26 ekleme ve 0 silme
  1. 14 0
      src/layout/live/detailInfo.vue
  2. 12 0
      src/store/room.js

+ 14 - 0
src/layout/live/detailInfo.vue

@@ -28,6 +28,7 @@
             <span @click="liveon"><i class="iconfont iconshexiangtou"></i>直播</span>
             <span @click="liveclose">关闭</span>
             <span @click="shareon"><i class="iconfont iconfenxiang"></i>屏幕</span>
+            <span><el-switch @change="recordclick" v-model="isrecord" active-text="录制" inactive-text="停录"> </el-switch></span>
           </el-col>
           <el-col :span="2" class="noVideo"> </el-col>
           <el-col :span="20" class="video">
@@ -78,6 +79,7 @@ import Vue from 'vue';
 import { mapState, createNamespacedHelpers } from 'vuex';
 const { mapActions: gensign } = createNamespacedHelpers('gensign');
 const { mapActions: chat } = createNamespacedHelpers('chat');
+const { mapActions: room } = createNamespacedHelpers('room');
 import TRTC from 'trtc-js-sdk';
 export default {
   name: 'detailInfo',
@@ -104,6 +106,7 @@ export default {
       open_: false,
       content: '',
       dataList: [],
+      isrecord: false,
     };
   },
   created() {
@@ -117,6 +120,17 @@ export default {
   methods: {
     ...gensign(['gensignFetch']),
     ...chat(['query', 'create', 'fetch']),
+    ...room(['startrecord', 'stoprecord']),
+    async recordclick() {
+      console.log(this.isrecord);
+      if (this.isrecord) {
+        const info = { roomid: this.id, roomname: this.name };
+        let res = await this.startrecord({ ...info });
+      } else {
+        const info = { roomid: this.id, roomname: this.name };
+        let res = await this.stoprecord({ ...info });
+      }
+    },
     async chatSearch({ skip = 0, limit = 1000 } = {}) {
       const info = { roomid: this.id };
       let res = await this.query({ skip, limit, ...info });

+ 12 - 0
src/store/room.js

@@ -36,6 +36,18 @@ const actions = {
     const res = await this.$axios.$delete(`${api.roomInfo}/${payload}`);
     return res;
   },
+  async startrecord({ commit }, info) {
+    const res = await this.$axios.$get(`${api.roomInfo}/starttranscode`, info);
+    return res;
+  },
+  async stoprecord({ commit }, info) {
+    const res = await this.$axios.$get(`${api.roomInfo}/stoptranscode`, info);
+    return res;
+  },
+  async deletefile({ commit }, info) {
+    const res = await this.$axios.$get(`${api.roomInfo}/deletefile`, info);
+    return res;
+  },
 };
 
 export default {