mirror of
https://github.com/kuaifan/dootask.git
synced 2025-12-12 11:19:56 +00:00
perf: 客户端会议优化
This commit is contained in:
parent
9390965a0c
commit
c61815db3a
@ -55,7 +55,7 @@
|
|||||||
"stylus-loader": "^7.1.0",
|
"stylus-loader": "^7.1.0",
|
||||||
"tinymce": "^5.10.3",
|
"tinymce": "^5.10.3",
|
||||||
"tui-calendar-hi": "^1.15.1-5",
|
"tui-calendar-hi": "^1.15.1-5",
|
||||||
"view-design-hi": "^4.7.0-50",
|
"view-design-hi": "^4.7.0-53",
|
||||||
"vite": "^2.9.15",
|
"vite": "^2.9.15",
|
||||||
"vite-plugin-file-copy": "^1.0.0",
|
"vite-plugin-file-copy": "^1.0.0",
|
||||||
"vite-plugin-require": "^1.1.10",
|
"vite-plugin-require": "^1.1.10",
|
||||||
|
|||||||
@ -56,6 +56,7 @@
|
|||||||
:transition-names="['', '']"
|
:transition-names="['', '']"
|
||||||
:beforeClose="onClose"
|
:beforeClose="onClose"
|
||||||
:class-name="`meeting-manager${meetingMini ? ' meeting-hidden' : ''}`"
|
:class-name="`meeting-manager${meetingMini ? ' meeting-hidden' : ''}`"
|
||||||
|
:ignore-remove-last="meetingMini"
|
||||||
fullscreen>
|
fullscreen>
|
||||||
<ul>
|
<ul>
|
||||||
<li v-if="localUser.uid">
|
<li v-if="localUser.uid">
|
||||||
@ -398,28 +399,30 @@ export default {
|
|||||||
AgoraRTC.onMicrophoneChanged = async (changedDevice) => {
|
AgoraRTC.onMicrophoneChanged = async (changedDevice) => {
|
||||||
// When plugging in a device, switch to a device that is newly plugged in.
|
// When plugging in a device, switch to a device that is newly plugged in.
|
||||||
if (changedDevice.state === "ACTIVE") {
|
if (changedDevice.state === "ACTIVE") {
|
||||||
this.localUser.audioTrack.setDevice(changedDevice.device.deviceId);
|
this.localUser.audioTrack?.setDevice(changedDevice.device.deviceId);
|
||||||
// Switch to an existing device when the current device is unplugged.
|
// Switch to an existing device when the current device is unplugged.
|
||||||
} else if (changedDevice.device.label === this.localUser.audioTrack.getTrackLabel()) {
|
} else if (changedDevice.device.label === this.localUser.audioTrack.getTrackLabel()) {
|
||||||
const oldMicrophones = await AgoraRTC.getMicrophones();
|
const oldMicrophones = await AgoraRTC.getMicrophones();
|
||||||
oldMicrophones[0] && this.localUser.audioTrack.setDevice(oldMicrophones[0].deviceId);
|
oldMicrophones[0] && this.localUser.audioTrack?.setDevice(oldMicrophones[0].deviceId);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// 视频采集设备状态变化回调
|
// 视频采集设备状态变化回调
|
||||||
AgoraRTC.onCameraChanged = async (changedDevice) => {
|
AgoraRTC.onCameraChanged = async (changedDevice) => {
|
||||||
// When plugging in a device, switch to a device that is newly plugged in.
|
// When plugging in a device, switch to a device that is newly plugged in.
|
||||||
if (changedDevice.state === "ACTIVE") {
|
if (changedDevice.state === "ACTIVE") {
|
||||||
this.localUser.videoTrack.setDevice(changedDevice.device.deviceId);
|
this.localUser.videoTrack?.setDevice(changedDevice.device.deviceId);
|
||||||
// Switch to an existing device when the current device is unplugged.
|
// Switch to an existing device when the current device is unplugged.
|
||||||
} else if (changedDevice.device.label === this.localUser.videoTrack.getTrackLabel()) {
|
} else if (changedDevice.device.label === this.localUser.videoTrack.getTrackLabel()) {
|
||||||
const oldCameras = await AgoraRTC.getCameras();
|
const oldCameras = await AgoraRTC.getCameras();
|
||||||
oldCameras[0] && this.localUser.videoTrack.setDevice(oldCameras[0].deviceId);
|
oldCameras[0] && this.localUser.videoTrack?.setDevice(oldCameras[0].deviceId);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// 音频或视频轨道自动播放失败回调
|
// 音频或视频轨道自动播放失败回调
|
||||||
AgoraRTC.onAutoplayFailed = () => {
|
AgoraRTC.onAutoplayFailed = () => {
|
||||||
$A.messageWarning("点击屏幕开始会议");
|
$A.messageWarning("点击屏幕开始会议");
|
||||||
}
|
}
|
||||||
|
// 设置日志级别
|
||||||
|
AgoraRTC.setLogLevel(window.systemInfo.debug === "yes" ? 0 : 3);
|
||||||
|
|
||||||
// 创建客户端
|
// 创建客户端
|
||||||
this.agoraClient = AgoraRTC.createClient({mode: "rtc", codec: "vp8"});
|
this.agoraClient = AgoraRTC.createClient({mode: "rtc", codec: "vp8"});
|
||||||
|
|||||||
@ -1,6 +1,11 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="meeting-player">
|
<div class="meeting-player">
|
||||||
<div :id="id" class="player" :style="playerStyle"></div>
|
<div :id="id" class="player" :style="playerStyle"></div>
|
||||||
|
<ETooltip :disabled="$isEEUiApp || windowTouch || !username">
|
||||||
|
<div slot="content">
|
||||||
|
{{username}}
|
||||||
|
</div>
|
||||||
|
<div class="meeting-avatar">
|
||||||
<UserAvatar v-if="userid" :userid="userid" :size="36" :borderWitdh="2"/>
|
<UserAvatar v-if="userid" :userid="userid" :size="36" :borderWitdh="2"/>
|
||||||
<div v-else-if="tourist.userimg" class="common-avatar avatar-wrapper">
|
<div v-else-if="tourist.userimg" class="common-avatar avatar-wrapper">
|
||||||
<div class="avatar-box online">
|
<div class="avatar-box online">
|
||||||
@ -8,6 +13,8 @@
|
|||||||
<EAvatar :size="36" :src="tourist.userimg"></EAvatar>
|
<EAvatar :size="36" :src="tourist.userimg"></EAvatar>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
</div>
|
||||||
|
</ETooltip>
|
||||||
<div class="player-state">
|
<div class="player-state">
|
||||||
<i v-if="!audio" class="taskfont"></i>
|
<i v-if="!audio" class="taskfont"></i>
|
||||||
<i v-if="!video" class="taskfont"></i>
|
<i v-if="!video" class="taskfont"></i>
|
||||||
@ -71,6 +78,16 @@ export default {
|
|||||||
}
|
}
|
||||||
return 0
|
return 0
|
||||||
},
|
},
|
||||||
|
username() {
|
||||||
|
if (this.userid) {
|
||||||
|
const user = this.cacheUserBasic.find(({userid}) => userid == this.userid);
|
||||||
|
if (user) {
|
||||||
|
return user.nickname
|
||||||
|
}
|
||||||
|
return ''
|
||||||
|
}
|
||||||
|
return this.tourist.nickname || ''
|
||||||
|
},
|
||||||
playerStyle() {
|
playerStyle() {
|
||||||
const user = this.cacheUserBasic.find(({userid}) => userid == this.userid);
|
const user = this.cacheUserBasic.find(({userid}) => userid == this.userid);
|
||||||
if (user) {
|
if (user) {
|
||||||
|
|||||||
@ -41,18 +41,20 @@ body {
|
|||||||
margin-left: 8px;
|
margin-left: 8px;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
.common-avatar {
|
.meeting-avatar {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
bottom: -8px;
|
bottom: -8px;
|
||||||
right: -8px;
|
right: -8px;
|
||||||
z-index: 2;
|
z-index: 2;
|
||||||
}
|
}
|
||||||
|
|
||||||
.avatar-box {
|
.avatar-box {
|
||||||
em {
|
em {
|
||||||
transform: scale(1.0625);
|
transform: scale(1.0625);
|
||||||
}
|
}
|
||||||
|
|
||||||
.el-avatar--circle {
|
.el-avatar--circle {
|
||||||
border: 2px solid #FFFFFF;
|
border: 1px solid #FFFFFF;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -104,7 +106,7 @@ body.window-portrait {
|
|||||||
padding: 6px 12px;
|
padding: 6px 12px;
|
||||||
white-space: nowrap;
|
white-space: nowrap;
|
||||||
border-radius: 4px;
|
border-radius: 4px;
|
||||||
box-shadow: 0 0 50px rgba(0, 0, 0, 0.3);
|
box-shadow: 0 0 3px rgba(45, 45, 45, 0.3);
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user