仲裁视频会议H5

038eac8fe5ed8dbabba8f9eff9bd6e6eba5c866542dd4012d491727391399cb4.json 13KB

1
  1. {"ast":null,"code":"import \"core-js/modules/es.array.push.js\";\nimport { getUsersig, reserveConferenceList } from '@/api/home';\nimport { getWidth, getHeight } from \"@/utils/utils\";\nimport roomFooter from './components/roomFooter.vue';\nimport TRTC from 'trtc-sdk-v5';\nlet trtc = null;\nexport default {\n name: 'App',\n components: {\n roomFooter\n },\n data() {\n return {\n userClass: \"userVideo5\",\n userList: [],\n userHeight: '100%',\n userSign: \"\",\n roomId: \"\",\n userId: null,\n showFlag: false\n };\n },\n methods: {\n // 鼠标滑过显示操作栏\n mouseHover() {\n this.showFlag = true;\n setTimeout(() => {\n this.showFlag = false;\n }, 4000);\n },\n async exitRoom() {\n debugger;\n await trtc.exitRoom();\n await trtc.updateLocalVideo({\n publish: false\n });\n await trtc.updateLocalAudio({\n publish: false\n });\n await trtc.destroy();\n this.$router.push({\n name: \"Home\"\n });\n // this.$router.go(-1)\n },\n\n // 获取拉流信息\n getPushVideo() {\n trtc.on(TRTC.EVENT.REMOTE_VIDEO_AVAILABLE, event => {\n const userId = event.userId;\n const streamType = event.streamType;\n this.userList.push(userId);\n this.userClass = getWidth(this.userList);\n this.userHeight = getHeight(this.userList);\n setTimeout(() => {\n trtc.startRemoteVideo({\n userId,\n streamType,\n view: `${userId}`\n });\n });\n });\n },\n // 删除退出会议人员列表\n deletePushVideo() {\n trtc.on(TRTC.EVENT.REMOTE_VIDEO_UNAVAILABLE, event => {\n const userId = event.userId;\n // debugger\n // if(this.hostId == userId){\n // alert('主持人已经解散会议')\n // this.$router.push({\n // name:'Home'\n // })\n // this.userList=[];\n // return\n // }\n let deleteIndex = this.userList.indexOf(userId);\n this.userList = this.userList.filter(item => item !== userId);\n if (deleteIndex !== -1) {\n this.userList.splice(deleteIndex, 1);\n }\n this.userClass = getWidth(this.userList);\n this.userHeight = getHeight(this.userList);\n });\n },\n // 根据caseId查询房间相关信息\n reserveConferenceListFn(data) {\n reserveConferenceList(data).then(res => {\n this.hostId = res.data[0].userId;\n });\n }\n },\n async mounted() {\n let roomId = this.$route.query.roomId;\n this.roomId = this.$route.query.roomId;\n let userId = this.$route.query.userId;\n this.userId = this.$route.query.userId;\n this.caseId = this.$route.query.caseId;\n // 获取主持人的userId\n this.reserveConferenceListFn(this.caseId);\n const sdkAppId = 1600011167;\n // 获取usersign\n await getUsersig(userId).then(res => {\n this.userSign = res.msg;\n });\n this.getPushVideo();\n this.deletePushVideo();\n try {\n await trtc.enterRoom({\n roomId: Number(roomId),\n scene: 'rtc',\n sdkAppId,\n userId,\n userSig: this.userSign\n });\n await trtc.startLocalVideo({\n view: document.getElementById('localStream') // 在 DOM 中的 elementId 为 localStream 的标签上预览视频。\n });\n\n await trtc.startLocalAudio();\n console.log('进房成功');\n this.$message({\n message: \"进房成功\",\n type: 'success'\n });\n } catch (error) {\n console.error('进房失败 ' + error);\n this.$message({\n message: \"进房失败\",\n type: 'error'\n });\n this.$router.push({\n name: 'Home'\n });\n }\n },\n created() {\n trtc = TRTC.create();\n }\n};","map":{"version":3,"names":["getUsersig","reserveConferenceList","getWidth","getHeight","roomFooter","TRTC","trtc","name","components","data","userClass","userList","userHeight","userSign","roomId","userId","showFlag","methods","mouseHover","setTimeout","exitRoom","updateLocalVideo","publish","updateLocalAudio","destroy","$router","push","getPushVideo","on","EVENT","REMOTE_VIDEO_AVAILABLE","event","streamType","startRemoteVideo","view","deletePushVideo","REMOTE_VIDEO_UNAVAILABLE","deleteIndex","indexOf","filter","item","splice","reserveConferenceListFn","then","res","hostId","mounted","$route","query","caseId","sdkAppId","msg","enterRoom","Number","scene","userSig","startLocalVideo","document","getElementById","startLocalAudio","console","log","$message","message","type","error","created","create"],"sources":["src/views/room.vue"],"sourcesContent":["<template>\n <div class=\"roompage\" @mouseover=\"mouseHover\">\n <div :class=\"userClass\" :style=\"{ height: userHeight }\" id=\"localStream\">\n <div class=\"userName\">{{ userId }}</div>\n </div>\n <div :class=\"userClass\" :style=\"{ height: userHeight }\" v-for=\"(item, index) in userList\" :key=\"index\" :id=\"item\">\n <div class=\"userName\">{{item}}</div>\n </div>\n <div class=\"footer\" v-show=\"showFlag\">\n <roomFooter @exitRoom=\"exitRoom\" :roomId=\"roomId\"></roomFooter>\n </div>\n </div>\n</template>\n \n<script>\nimport { getUsersig,reserveConferenceList } from '@/api/home';\nimport { getWidth, getHeight } from \"@/utils/utils\";\nimport roomFooter from './components/roomFooter.vue';\nimport TRTC from 'trtc-sdk-v5';\nlet trtc = null;\nexport default {\n name: 'App',\n components: {\n roomFooter\n },\n data() {\n return {\n userClass: \"userVideo5\",\n userList: [],\n userHeight: '100%',\n userSign: \"\",\n roomId: \"\",\n userId:null,\n showFlag:false,\n };\n },\n methods: {\n // 鼠标滑过显示操作栏\n mouseHover(){\n this.showFlag = true;\n setTimeout(()=>{\n this.showFlag = false;\n },4000)\n },\n async exitRoom() {\n debugger\n await trtc.exitRoom();\n await trtc.updateLocalVideo({ publish: false });\n await trtc.updateLocalAudio({ publish: false });\n await trtc.destroy();\n this.$router.push({\n name: \"Home\"\n })\n // this.$router.go(-1)\n },\n // 获取拉流信息\n getPushVideo() {\n trtc.on(TRTC.EVENT.REMOTE_VIDEO_AVAILABLE, event => {\n const userId = event.userId;\n const streamType = event.streamType;\n this.userList.push(userId);\n this.userClass = getWidth(this.userList);\n this.userHeight = getHeight(this.userList);\n setTimeout(() => {\n trtc.startRemoteVideo({ userId, streamType, view: `${userId}` })\n })\n })\n },\n // 删除退出会议人员列表\n deletePushVideo() {\n trtc.on(TRTC.EVENT.REMOTE_VIDEO_UNAVAILABLE, event => {\n const userId = event.userId;\n // debugger\n // if(this.hostId == userId){\n // alert('主持人已经解散会议')\n // this.$router.push({\n // name:'Home'\n // })\n // this.userList=[];\n // return\n // }\n let deleteIndex = this.userList.indexOf(userId);\n this.userList = this.userList.filter(item => item !== userId);\n if (deleteIndex !== -1) {\n this.userList.splice(deleteIndex, 1)\n }\n this.userClass = getWidth(this.userList);\n this.userHeight = getHeight(this.userList);\n })\n },\n // 根据caseId查询房间相关信息\n reserveConferenceListFn(data){\n reserveConferenceList(data).then(res=>{\n this.hostId = res.data[0].userId;\n })\n }\n },\n async mounted() {\n let roomId = this.$route.query.roomId;\n this.roomId = this.$route.query.roomId;\n let userId = this.$route.query.userId;\n this.userId = this.$route.query.userId;\n this.caseId = this.$route.query.caseId;\n // 获取主持人的userId\n this.reserveConferenceListFn(this.caseId)\n const sdkAppId = 1600011167;\n // 获取usersign\n await getUsersig(userId).then(res => {\n this.userSign = res.msg;\n })\n this.getPushVideo();\n this.deletePushVideo();\n try {\n await trtc.enterRoom({ roomId: Number(roomId), scene: 'rtc', sdkAppId, userId, userSig: this.userSign });\n await trtc.startLocalVideo({\n view: document.getElementById('localStream'), // 在 DOM 中的 elementId 为 localStream 的标签上预览视频。\n });\n await trtc.startLocalAudio();\n console.log('进房成功');\n this.$message({\n message: \"进房成功\",\n type: 'success'\n })\n } catch (error) {\n console.error('进房失败 ' + error);\n this.$message({\n message: \"进房失败\",\n type: 'error'\n });\n this.$router.push({\n name: 'Home'\n })\n }\n },\n created() {\n trtc = TRTC.create();\n },\n};\n</script>\n \n<style scoped>\n.roompage {\n width: 100%;\n height: 100vh;\n display: flex;\n align-items: center;\n justify-content: space-around;\n flex-wrap: wrap;\n position: relative;\n}\n.userVideo,.userVideo1,.userVideo2,.userVideo3,.userVideo4,.userVideo5{\n position: relative;\n}\n.userVideo5 {\n width: 100%;\n background-color: yellow;\n}\n\n.userVideo {\n width: 48%;\n background-color: yellow;\n}\n\n.userVideo1 {\n width: 33%;\n background-color: yellow;\n}\n\n.userVideo2 {\n width: 33%;\n background-color: yellow;\n}\n\n.userVideo3 {\n width: 33%;\n background-color: yellow;\n}\n\n.userVideo4 {\n width: 100%;\n background-color: yellow;\n}\n\n.footer {\n width: 100%;\n height: 10%;\n background: rgb(46 43 43 / 90%);\n position: absolute;\n bottom: 0;\n z-index: 10;\n}\n.userName{\n border-radius: 10px;\n width: 90px;\n height: 40px;\n text-align: center;\n line-height: 40px;\n background-color: black;\n position: absolute;\n right: 0;\n bottom: 0;\n z-index: 9;\n color: #ffffff;\n}\n</style>\n \n \n "],"mappings":";AAeA,SAAAA,UAAA,EAAAC,qBAAA;AACA,SAAAC,QAAA,EAAAC,SAAA;AACA,OAAAC,UAAA;AACA,OAAAC,IAAA;AACA,IAAAC,IAAA;AACA;EACAC,IAAA;EACAC,UAAA;IACAJ;EACA;EACAK,KAAA;IACA;MACAC,SAAA;MACAC,QAAA;MACAC,UAAA;MACAC,QAAA;MACAC,MAAA;MACAC,MAAA;MACAC,QAAA;IACA;EACA;EACAC,OAAA;IACA;IACAC,WAAA;MACA,KAAAF,QAAA;MACAG,UAAA;QACA,KAAAH,QAAA;MACA;IACA;IACA,MAAAI,SAAA;MACA;MACA,MAAAd,IAAA,CAAAc,QAAA;MACA,MAAAd,IAAA,CAAAe,gBAAA;QAAAC,OAAA;MAAA;MACA,MAAAhB,IAAA,CAAAiB,gBAAA;QAAAD,OAAA;MAAA;MACA,MAAAhB,IAAA,CAAAkB,OAAA;MACA,KAAAC,OAAA,CAAAC,IAAA;QACAnB,IAAA;MACA;MACA;IACA;;IACA;IACAoB,aAAA;MACArB,IAAA,CAAAsB,EAAA,CAAAvB,IAAA,CAAAwB,KAAA,CAAAC,sBAAA,EAAAC,KAAA;QACA,MAAAhB,MAAA,GAAAgB,KAAA,CAAAhB,MAAA;QACA,MAAAiB,UAAA,GAAAD,KAAA,CAAAC,UAAA;QACA,KAAArB,QAAA,CAAAe,IAAA,CAAAX,MAAA;QACA,KAAAL,SAAA,GAAAR,QAAA,MAAAS,QAAA;QACA,KAAAC,UAAA,GAAAT,SAAA,MAAAQ,QAAA;QACAQ,UAAA;UACAb,IAAA,CAAA2B,gBAAA;YAAAlB,MAAA;YAAAiB,UAAA;YAAAE,IAAA,KAAAnB,MAAA;UAAA;QACA;MACA;IACA;IACA;IACAoB,gBAAA;MACA7B,IAAA,C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