1 line
26 KiB
JSON
1 line
26 KiB
JSON
{"ast":null,"code":"import \"core-js/modules/es.array.push.js\";\nimport { getUsersig, reserveConferenceList } from '@/api/home';\nimport { getWidth, getHeight, getWidthPhone, getModile } from \"@/utils/utils\";\nimport roomFooter from './components/roomFooter.vue';\nimport roomFooterPhone from \"./components/footerPhone.vue\";\nimport ASR from '../utils/asr.esm.js';\nimport TRTC from 'trtc-sdk-v5';\nlet trtc = null;\nimport 'quill/dist/quill.core.css';\nimport 'quill/dist/quill.snow.css';\nimport 'quill/dist/quill.bubble.css';\nimport { quillEditor } from 'vue-quill-editor';\nexport default {\n name: 'App',\n components: {\n roomFooter,\n roomFooterPhone,\n quillEditor\n },\n data() {\n return {\n userClass: \"userVideo5\",\n userClassPhone: \"userVideoPhone\",\n userList: [],\n userHeight: '100%',\n userPhoneHeight: '92%',\n userSign: \"\",\n roomId: \"\",\n userId: null,\n showFlag: false,\n modileFlag: false,\n localStreamAsr: null,\n contentValue: '',\n textVisible: false,\n editorOption: {\n // Some Quill options...\n },\n asrList: {}\n };\n },\n methods: {\n onEditorBlur(quill) {\n console.log('editor blur!', this.content, quill);\n },\n onEditorFocus(quill) {\n console.log('editor focus!', quill);\n },\n onEditorReady(quill) {\n console.log('editor ready!', quill);\n },\n onEditorChange({\n quill,\n html,\n text\n }) {\n console.log('editor change!', quill, html, text);\n this.content = html;\n },\n // 点击显示修改的文本框\n txtContent() {\n this.textVisible = true;\n },\n // 鼠标滑过显示操作栏\n mouseHover() {\n this.showFlag = true;\n setTimeout(() => {\n this.showFlag = false;\n }, 4000);\n },\n async exitRoom() {\n // 关闭识别\n this.userList.forEach(item => {\n this.asrList.item.stop();\n });\n this.localStreamAsr.stop();\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 },\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.asrList = {};\n this.userList.forEach((item, index) => {\n asrList[this.userList[index]] = new ASR({\n secretKey: 'INDrIXcT8YmomZBcsy0oNirnU0LTN4X7',\n secretId: 'AKID3xfHgroY4MQHvLXUXMwIQL1UjmbBX1Tv',\n appId: 1304001529,\n engine_model_type: '16k_zh',\n voice_format: 1,\n needvad: 1,\n audioTrack: trtc.getAudioTrack(item)\n });\n this.asrList.item.start();\n // 开始识别\n this.asrList.item.OnRecognitionStart = res => {\n console.log('本地流:开始识别', res);\n };\n this.asrList.item.OnError = res => {\n console.log('本地流:识别失败', res);\n };\n // 一句话结束\n this.asrList.item.OnSentenceEnd = res => {\n console.log('本地流:一句话结束', res);\n // this.contentValue = `<h2>${this.userId}</h2>` + `<span>${res.result.voice_text_str}</span>`;\n this.contentValue = this.contentValue + `<h2>${item}</h2>` + `<span>${res.result.voice_text_str}</span>`;\n };\n });\n if (this.modileFlag) {\n this.userClass = getWidth(this.userList);\n this.userHeight = getHeight(this.userList);\n } else {\n this.userClassPhone = getWidthPhone(this.userList);\n }\n setTimeout(() => {\n trtc.startRemoteVideo({\n userId,\n streamType,\n view: `${userId}`\n });
|