mirror of
https://github.com/kuaifan/dootask.git
synced 2025-12-14 12:42:51 +00:00
perf: 优化会议
This commit is contained in:
parent
b7dcb543f6
commit
9acafed459
@ -957,6 +957,14 @@ class WebSocketDialogMsg extends AbstractModel
|
|||||||
$dialogMsg->key = $dialogMsg->generateMsgKey();
|
$dialogMsg->key = $dialogMsg->generateMsgKey();
|
||||||
$dialogMsg->save();
|
$dialogMsg->save();
|
||||||
//
|
//
|
||||||
|
if ($dialogMsg->type === 'meeting') {
|
||||||
|
MeetingMsg::createInstance([
|
||||||
|
'meetingid' => $dialogMsg->msg['meetingid'],
|
||||||
|
'dialog_id' => $dialogMsg->dialog_id,
|
||||||
|
'msg_id' => $dialogMsg->id,
|
||||||
|
])->save();
|
||||||
|
}
|
||||||
|
//
|
||||||
WebSocketDialogUser::whereDialogId($dialogMsg->dialog_id)->change([
|
WebSocketDialogUser::whereDialogId($dialogMsg->dialog_id)->change([
|
||||||
'hide' => 0, // 有新消息时,显示会话(会话内所有会员)
|
'hide' => 0, // 有新消息时,显示会话(会话内所有会员)
|
||||||
'last_at' => Carbon::now(),
|
'last_at' => Carbon::now(),
|
||||||
|
|||||||
@ -64,7 +64,8 @@ class CloseMeetingRoomTask extends AbstractTask
|
|||||||
->chunk(100, function ($msgs) use ($newMsg, &$dialogIds) {
|
->chunk(100, function ($msgs) use ($newMsg, &$dialogIds) {
|
||||||
/** @var WebSocketDialogMsg $msg */
|
/** @var WebSocketDialogMsg $msg */
|
||||||
foreach ($msgs as $msg) {
|
foreach ($msgs as $msg) {
|
||||||
$msg->msg = Base::array2json($newMsg);
|
$msgData = Base::json2array($msg->getRawOriginal('msg'));
|
||||||
|
$msg->msg = Base::array2json(array_merge($msgData, $newMsg));
|
||||||
$msg->save();
|
$msg->save();
|
||||||
//
|
//
|
||||||
if (!isset($dialogIds[$msg->dialog_id])) {
|
if (!isset($dialogIds[$msg->dialog_id])) {
|
||||||
|
|||||||
@ -401,7 +401,7 @@ export default {
|
|||||||
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);
|
||||||
}
|
}
|
||||||
@ -412,7 +412,7 @@ export default {
|
|||||||
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);
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user