SWX\10484 4 days ago
parent 61d152a6e8
commit 1d34823bea
  1. 2
      public/static/jquery-3.4.1.min.js
  2. 29
      public/static/sdk-audio.js
  3. 35
      src/views/videoCommunication/caseStudy.vue
  4. 2
      src/views/videoCommunication/realTimeConsultation.vue
  5. 151
      src/views/videoCommunication/training.vue

File diff suppressed because one or more lines are too long

@ -0,0 +1,29 @@
class AudioLevelProcessor extends AudioWorkletProcessor {
constructor() {
super();
this._lastUpdate = currentTime;
}
process(inputs, outputs, parameters) {
if (!inputs) {
return;
}
if (currentTime - this._lastUpdate >= 0.1) {
if (!inputs[0] || !inputs[0][0]) {
//console.log('@@');
return;
}
//auconsole.log('@@',inputs[0][0]);
const buffer = inputs[0][0];
let max = Math.floor(Math.max.apply(Math, buffer) * 100);
if (max < 0) {
max = -max;
}
this.port.postMessage({audioLevel: max});
this._lastUpdate = currentTime;
}
return true;
}
}
registerProcessor('audioLevel', AudioLevelProcessor);

@ -274,7 +274,11 @@
<script> <script>
import CaseFormDialog from "@/views/cases/components/CaseFormDialog"; import CaseFormDialog from "@/views/cases/components/CaseFormDialog";
import CreateGroupDialog from "@/views/message/components/CreateGroupDialog"; import CreateGroupDialog from "@/views/message/components/CreateGroupDialog";
import {
postConsultationCreate,
postConsultationInfo,
postConsultationStop
} from "@/api/videoCommunication";
export default { export default {
name: "MeetingRoom", name: "MeetingRoom",
components: { components: {
@ -292,6 +296,7 @@ export default {
networkDelay: 0, networkDelay: 0,
currentTime: "", currentTime: "",
networkQuality: { text: "良好", color: "#00e676" }, networkQuality: { text: "良好", color: "#00e676" },
consultation_id: null,
// ==================== ==================== // ==================== ====================
timer: 0, timer: 0,
@ -402,8 +407,30 @@ export default {
mounted() { mounted() {
this.initPage(); this.initPage();
this.initSDK(); this.initSDK();
if (this.$route.query.roomId_id) this.creatRoom()
}, },
methods: { methods: {
async creatRoom() {
try {
const res = await postConsultationCreate({
avatar: '',
init_users: [],
invite_code: '1234',
name: '',
room_id: this.$route.query.roomId_id
})
console.log(res)
this.consultation_id = res.data.consultation_id
await postConsultationInfo({
consultation_id: res.data.consultation_id,
from_history: 0,
room_id: ''
})
} catch (error) {
}
},
// ==================== 1 ==================== // ==================== 1 ====================
// //
initPage() { initPage() {
@ -679,7 +706,7 @@ export default {
this.isSharing = false; this.isSharing = false;
this.$refs.shareVideo.srcObject = null; this.$refs.shareVideo.srcObject = null;
this.$message.info("已停止共享"); this.$message.info("已停止共享");
window.hirtcwebsdk?.unPublishScreen(); window.hirtcwebsdk?.unpublish();
}, },
// ==================== 6 ==================== // ==================== 6 ====================
@ -1033,6 +1060,8 @@ export default {
key: "tagsView", key: "tagsView",
value: true, value: true,
}); });
postConsultationStop({ consultation_id: this.consultation_id });
this.$router.push("/"); this.$router.push("/");
}); });
}, },
@ -1049,6 +1078,8 @@ export default {
key: "tagsView", key: "tagsView",
value: true, value: true,
}); });
postConsultationStop({ consultation_id: this.consultation_id });
window.name === "consultationWindow" window.name === "consultationWindow"
? window.close() ? window.close()
: this.$router.push("/"); : this.$router.push("/");

@ -456,7 +456,7 @@ export default {
window.hirtcwebsdk.init({ window.hirtcwebsdk.init({
serviceID: '56da5fd8921f4f7093a42e2a', serviceID: '56da5fd8921f4f7093a42e2a',
serviceKey: '2c17c6393771ee3048ae34d6b965sdew', serviceKey: '2c17c6393771ee3048ae34d6b965sdew',
BasicRoomServiceToken: "https://brs-hirtc.hismarttv.com/v1/auth/token", BasicRoomServiceToken: "https://192.168.69.174:3001/v1/auth/token",
cameraLayers: [ cameraLayers: [
{ {
width: 320, width: 320,

@ -31,27 +31,13 @@
<!-- 左侧画面 --> <!-- 左侧画面 -->
<div class="video-stage left-stage" ref="videoContainerLeft"> <div class="video-stage left-stage" ref="videoContainerLeft">
<!-- 采集卡/主视频画面 --> <!-- 采集卡/主视频画面 -->
<video <video ref="shareVideo" class="share-preview" autoplay playsinline muted v-if="isSharing"></video>
ref="shareVideo"
class="share-preview"
autoplay
playsinline
muted
v-if="isSharing"
></video>
</div> </div>
<!-- 右侧画面 --> <!-- 右侧画面 -->
<div class="video-stage right-stage" ref="videoContainerRight"> <div class="video-stage right-stage" ref="videoContainerRight">
<!-- 本地摄像头画面 --> <!-- 本地摄像头画面 -->
<video <video ref="localVideo" class="local-camera" autoplay muted playsinline v-if="camOn" />
ref="localVideo"
class="local-camera"
autoplay
muted
playsinline
v-if="camOn"
/>
</div> </div>
</main> </main>
@ -113,29 +99,17 @@
</footer> </footer>
<!-- 邀请弹窗 --> <!-- 邀请弹窗 -->
<CreateGroupDialog <CreateGroupDialog :visible.sync="inviteDialogVisible" title="通讯录邀请" @confirm="handleInviteConfirm"
:visible.sync="inviteDialogVisible" @close="inviteDialogVisible = false" />
title="通讯录邀请"
@confirm="handleInviteConfirm"
@close="inviteDialogVisible = false"
/>
<!-- 设置弹窗 --> <!-- 设置弹窗 -->
<el-dialog <el-dialog title="设置" :visible.sync="settingDialogVisible" width="31%" @open="onSettingDialogOpen"
title="设置" :show-close="false">
:visible.sync="settingDialogVisible"
width="31%"
@open="onSettingDialogOpen"
:show-close="false"
>
<el-tabs v-model="settingTab" tab-position="left"> <el-tabs v-model="settingTab" tab-position="left">
<el-tab-pane label="通用" name="general"> <el-tab-pane label="通用" name="general">
<el-form :model="tempSetting" label-width="140px"> <el-form :model="tempSetting" label-width="140px">
<el-form-item label="会诊名称"> <el-form-item label="会诊名称">
<el-input <el-input v-model="tempSetting.meetingTitle" style="width: 240px"></el-input>
v-model="tempSetting.meetingTitle"
style="width: 240px"
></el-input>
</el-form-item> </el-form-item>
</el-form> </el-form>
</el-tab-pane> </el-tab-pane>
@ -143,27 +117,15 @@
<el-form :model="tempSetting" label-width="140px"> <el-form :model="tempSetting" label-width="140px">
<el-form-item label="摄像头/工作站"> <el-form-item label="摄像头/工作站">
<el-select v-model="tempSetting.cameraId" style="width: 100%"> <el-select v-model="tempSetting.cameraId" style="width: 100%">
<el-option <el-option v-for="item in videoDeviceList" :key="item.deviceId" :label="item.label"
v-for="item in videoDeviceList" :value="item.deviceId"></el-option>
:key="item.deviceId"
:label="item.label"
:value="item.deviceId"
></el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item label="绿联采集卡"> <el-form-item label="绿联采集卡">
<el-select <el-select v-model="tempSetting.captureCard" style="width: 100%" @change="switchCaptureCard">
v-model="tempSetting.captureCard"
style="width: 100%"
@change="switchCaptureCard"
>
<el-option label="不使用采集卡" value=""></el-option> <el-option label="不使用采集卡" value=""></el-option>
<el-option <el-option v-for="item in videoDeviceList" :key="item.deviceId" :label="item.label"
v-for="item in videoDeviceList" :value="item.deviceId"></el-option>
:key="item.deviceId"
:label="item.label"
:value="item.deviceId"
></el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item label="网络调控策略"> <el-form-item label="网络调控策略">
@ -209,22 +171,14 @@
<el-form :model="tempSetting" label-width="140px"> <el-form :model="tempSetting" label-width="140px">
<el-form-item label="麦克风"> <el-form-item label="麦克风">
<el-select v-model="tempSetting.micId" style="width: 100%"> <el-select v-model="tempSetting.micId" style="width: 100%">
<el-option <el-option v-for="item in audioInList" :key="item.deviceId" :label="item.label"
v-for="item in audioInList" :value="item.deviceId" />
:key="item.deviceId"
:label="item.label"
:value="item.deviceId"
/>
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item label="扬声器"> <el-form-item label="扬声器">
<el-select v-model="tempSetting.speakerId" style="width: 100%"> <el-select v-model="tempSetting.speakerId" style="width: 100%">
<el-option <el-option v-for="item in audioOutList" :key="item.deviceId" :label="item.label"
v-for="item in audioOutList" :value="item.deviceId" />
:key="item.deviceId"
:label="item.label"
:value="item.deviceId"
/>
</el-select> </el-select>
</el-form-item> </el-form-item>
</el-form> </el-form>
@ -235,9 +189,7 @@
<el-color-picker v-model="tempSetting.brushColor" /> <el-color-picker v-model="tempSetting.brushColor" />
</el-form-item> </el-form-item>
<el-form-item label=""> <el-form-item label="">
<el-checkbox v-model="tempSetting.syncColor" <el-checkbox v-model="tempSetting.syncColor">同步标记颜色</el-checkbox>
>同步标记颜色</el-checkbox
>
</el-form-item> </el-form-item>
<el-form-item label="画笔类型"> <el-form-item label="画笔类型">
<el-radio-group v-model="tempSetting.brushType"> <el-radio-group v-model="tempSetting.brushType">
@ -265,7 +217,11 @@
<script> <script>
import CreateGroupDialog from "@/views/message/components/CreateGroupDialog"; import CreateGroupDialog from "@/views/message/components/CreateGroupDialog";
import {
postConsultationCreate,
postConsultationInfo,
postConsultationStop
} from "@/api/videoCommunication";
export default { export default {
name: "MeetingRoom", name: "MeetingRoom",
components: { components: {
@ -281,6 +237,7 @@ export default {
frameRate: 25, frameRate: 25,
networkDelay: 0, networkDelay: 0,
networkQuality: { text: "良好", color: "#00e676" }, networkQuality: { text: "良好", color: "#00e676" },
consultation_id: null,
// ==================== ==================== // ==================== ====================
timer: 0, timer: 0,
@ -350,8 +307,29 @@ export default {
mounted() { mounted() {
this.initPage(); this.initPage();
this.initSDK(); this.initSDK();
if (this.$route.query.roomId_id) this.creatRoom()
}, },
methods: { methods: {
async creatRoom() {
try {
const res = await postConsultationCreate({
avatar: '',
init_users: [],
invite_code: '1234',
name: '',
room_id: this.$route.query.roomId_id
})
console.log(res)
this.consultation_id = res.data.consultation_id
await postConsultationInfo({
consultation_id: res.data.consultation_id,
from_history: 0,
room_id: ''
})
} catch (error) {
}
},
// ==================== 1 ==================== // ==================== 1 ====================
initPage() { initPage() {
this.loadLocalSetting(); this.loadLocalSetting();
@ -606,7 +584,7 @@ export default {
this.isSharing = false; this.isSharing = false;
this.$refs.shareVideo.srcObject = null; this.$refs.shareVideo.srcObject = null;
this.$message.info("已停止共享"); this.$message.info("已停止共享");
window.hirtcwebsdk?.unPublishScreen(); window.hirtcwebsdk?.unpublish();
}, },
// ==================== 5 ==================== // ==================== 5 ====================
@ -632,9 +610,8 @@ export default {
const url = URL.createObjectURL(blob); const url = URL.createObjectURL(blob);
const a = document.createElement("a"); const a = document.createElement("a");
a.href = url; a.href = url;
a.download = `${ a.download = `${this.meetingTitle
this.meetingTitle }录制_${new Date().toLocaleString()}.webm`;
}录制_${new Date().toLocaleString()}.webm`;
document.body.appendChild(a); document.body.appendChild(a);
a.click(); a.click();
document.body.removeChild(a); document.body.removeChild(a);
@ -695,20 +672,20 @@ export default {
// ==================== 7 ==================== // ==================== 7 ====================
startNetworkMonitoring() { startNetworkMonitoring() {
setInterval(() => { // setInterval(() => {
if (!window.hirtcwebsdk) return; // if (!window.hirtcwebsdk) return;
const s = window.hirtcwebsdk.getNetworkStats(); // const s = window.hirtcwebsdk.getNetworkStats();
if (s?.rtt) { // if (s?.rtt) {
this.networkDelay = Math.round(s.rtt); // this.networkDelay = Math.round(s.rtt);
if (this.networkDelay < 100) // if (this.networkDelay < 100)
this.networkQuality = { text: "优秀", color: "#00e676" }; // this.networkQuality = { text: "", color: "#00e676" };
else if (this.networkDelay < 300) // else if (this.networkDelay < 300)
this.networkQuality = { text: "良好", color: "#00e676" }; // this.networkQuality = { text: "", color: "#00e676" };
else if (this.networkDelay < 600) // else if (this.networkDelay < 600)
this.networkQuality = { text: "一般", color: "#ffc107" }; // this.networkQuality = { text: "", color: "#ffc107" };
else this.networkQuality = { text: "差", color: "#f56c6c" }; // else this.networkQuality = { text: "", color: "#f56c6c" };
} // }
}, 2000); // }, 2000);
}, },
// ==================== 8 ==================== // ==================== 8 ====================
@ -797,6 +774,8 @@ export default {
key: "tagsView", key: "tagsView",
value: true, value: true,
}); });
postConsultationStop({ consultation_id: this.consultation_id });
this.$router.push("/"); this.$router.push("/");
}); });
}, },
@ -813,6 +792,8 @@ export default {
key: "tagsView", key: "tagsView",
value: true, value: true,
}); });
postConsultationStop({ consultation_id: this.consultation_id });
window.name === "consultationWindow" window.name === "consultationWindow"
? window.close() ? window.close()
: this.$router.push("/"); : this.$router.push("/");
@ -1018,9 +999,11 @@ export default {
0% { 0% {
opacity: 1; opacity: 1;
} }
50% { 50% {
opacity: 0.5; opacity: 0.5;
} }
100% { 100% {
opacity: 1; opacity: 1;
} }

Loading…
Cancel
Save