仲裁视频会议H5

ba9291c3f8d1af3698b0b888bc481c1902abfb77109f55ce3d1d77ebf4ffbb0a.json 5.6KB

1
  1. {"ast":null,"code":"import { getUsersig } from '@/api/home';\nimport TRTC from 'trtc-sdk-v5';\nconst trtc = TRTC.create();\nexport default {\n name: 'App',\n components: {},\n data() {\n return {\n userClass: \"userVideo\",\n userList: [1, 2, 3, 4, 5, 6, 7, 8, 8],\n userHeight: '100%'\n };\n },\n methods: {},\n async mounted() {\n let roomId = this.$route.query.roomId;\n let userId = this.$route.query.userId;\n const sdkAppId = 1600011167;\n let userSign = \"\";\n // 获取usersign\n await getUsersig(userId).then(res => {\n userSign = res.msg;\n });\n try {\n await trtc.enterRoom({\n roomId: roomId,\n scene: 'rtc',\n sdkAppId,\n userId,\n userSign\n });\n await trtc.startLocalVideo({\n view: document.getElementById('video') // 在 DOM 中的 elementId 为 localVideo 的标签上预览视频。\n });\n\n console.log('进房成功');\n } catch (error) {\n console.error('进房失败 ' + error);\n }\n },\n created() {\n // 判断房间人数对应的样式\n if (this.userList.length == 1) {\n this.userClass = 'userVideo';\n } else if (this.userList.length == 2) {\n this.userClass = \"userVideo1\";\n } else if (this.userList.length == 3) {\n this.userClass = \"userVideo2\";\n } else if (this.userList.length > 3) {\n this.userClass = \"userVideo3\";\n }\n let userRow = Math.ceil(this.userList.length / 3);\n console.log(userRow, \"l\");\n if (userRow == 1) {\n this.userHeight == \"100%\";\n } else {\n this.userHeight = 1 / userRow * 100 - 2 + \"%\";\n }\n }\n};","map":{"version":3,"names":["getUsersig","TRTC","trtc","create","name","components","data","userClass","userList","userHeight","methods","mounted","roomId","$route","query","userId","sdkAppId","userSign","then","res","msg","enterRoom","scene","startLocalVideo","view","document","getElementById","console","log","error","created","length","userRow","Math","ceil"],"sources":["src/views/room.vue"],"sourcesContent":["<template>\n <div class=\"roompage\">\n <div :class=\"userClass\" :style=\"{ height: userHeight }\" v-for=\"(item, index) in userList\" :key=\"index\"></div>\n </div>\n</template>\n \n<script>\nimport { getUsersig } from '@/api/home';\nimport TRTC from 'trtc-sdk-v5';\nconst trtc = TRTC.create();\nexport default {\n name: 'App',\n components: {\n },\n data() {\n return {\n userClass: \"userVideo\",\n userList: [1, 2, 3, 4, 5, 6, 7, 8, 8],\n userHeight: '100%',\n };\n },\n methods: {\n\n },\n async mounted() {\n let roomId = this.$route.query.roomId;\n let userId = this.$route.query.userId;\n const sdkAppId = 1600011167;\n let userSign = \"\";\n // 获取usersign\n await getUsersig(userId).then(res => {\n userSign = res.msg;\n })\n try {\n await trtc.enterRoom({ roomId: roomId, scene: 'rtc', sdkAppId, userId, userSign });\n await trtc.startLocalVideo({\n view: document.getElementById('video'), // 在 DOM 中的 elementId 为 localVideo 的标签上预览视频。\n });\n console.log('进房成功');\n } catch (error) {\n console.error('进房失败 ' + error);\n }\n },\n created() {\n // 判断房间人数对应的样式\n if (this.userList.length == 1) {\n this.userClass = 'userVideo'\n } else if (this.userList.length == 2) {\n this.userClass = \"userVideo1\"\n } else if (this.userList.length == 3) {\n this.userClass = \"userVideo2\"\n } else if (this.userList.length > 3) {\n this.userClass = \"userVideo3\"\n }\n let userRow = Math.ceil(this.userList.length / 3);\n console.log(userRow, \"l\");\n if (userRow == 1) {\n this.userHeight == \"100%\"\n } else {\n this.userHeight = (1 / userRow) * 100 - 2 + \"%\"\n }\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}\n\n.userVideo {\n width: 100%;\n background-color: yellow;\n}\n\n.userVideo1 {\n width: 48%;\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</style>\n \n \n "],"mappings":"AAOA,SAAAA,UAAA;AACA,OAAAC,IAAA;AACA,MAAAC,IAAA,GAAAD,IAAA,CAAAE,MAAA;AACA;EACAC,IAAA;EACAC,UAAA,GACA;EACAC,KAAA;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