|
@@ -11,6 +11,7 @@ import { unref } from 'vue';
|
|
|
import { useAppStore } from '/@/store/modules/app';
|
|
|
import dayjs from 'dayjs';
|
|
|
import duration from 'dayjs/plugin/duration';
|
|
|
+import { useRtcSdk } from '/@/hooks/useTRTC';
|
|
|
dayjs.extend(duration);
|
|
|
// import { useRtcSdk } from '/@/hooks/useTRTC';
|
|
|
interface ActionDataType {
|
|
@@ -58,7 +59,7 @@ export function handleActions({
|
|
|
break;
|
|
|
|
|
|
case 'users-muted':
|
|
|
- handleUserMuted(userId, muted, members);
|
|
|
+ handleUserMuted(userId, muted);
|
|
|
break;
|
|
|
|
|
|
case 'users-words':
|
|
@@ -275,16 +276,21 @@ const handleUserSetWords = (UserId?: string, words?: boolean, members?: UserInfo
|
|
|
});
|
|
|
}
|
|
|
};
|
|
|
-const handleUserMuted = (UserId?: string, muted?: boolean, members?: UserInfoType[]) => {
|
|
|
+const handleUserMuted = (UserId?: string, muted?: boolean) => {
|
|
|
const rtcStore = useRtcStore();
|
|
|
- console.log('members', members);
|
|
|
- console.log('handleUserMuted', UserId, muted);
|
|
|
UserId &&
|
|
|
rtcStore.updateMemberDatabyId(UserId, {
|
|
|
IsMuted: muted,
|
|
|
});
|
|
|
if (UserId == rtcStore.userId) {
|
|
|
rtcStore.setMute(!!muted);
|
|
|
+ const { localStream } = useRtcSdk();
|
|
|
+ console.log('audio::status', UserId, muted);
|
|
|
+ if (muted) {
|
|
|
+ localStream.muteAudio();
|
|
|
+ } else {
|
|
|
+ localStream.unmuteAudio();
|
|
|
+ }
|
|
|
}
|
|
|
};
|
|
|
|