diff --git a/pages/meeting/index.scss b/pages/meeting/index.scss index d10acee..5a074ce 100644 --- a/pages/meeting/index.scss +++ b/pages/meeting/index.scss @@ -153,7 +153,7 @@ &-up { position: fixed; z-index: 5; - right: 7.4%; + right: 65px; top: 14%; color: white; background-color: rgba(0, 0, 0, 0.5); @@ -169,7 +169,7 @@ &-down { position: fixed; z-index: 5; - right: 7.4%; + right: 65px; bottom: 14%; color: white; background-color: rgba(0, 0, 0, 0.5); diff --git a/pages/meeting/index.ts b/pages/meeting/index.ts index 1403a89..a520bdf 100644 --- a/pages/meeting/index.ts +++ b/pages/meeting/index.ts @@ -609,6 +609,27 @@ Page({ case 'SetSpeaker': await onInvoke('SetSpeakerCallback', item.RoomManagerInputDTO) break; + // 扩展参数 + case 'ReceivedOperation': + try { + const temp = JSON.parse(item.contentString) + if (temp.type === 'audio') { + await PostOpenMicr({ + roomNum: temp.roomNum, + uid: temp.uid, + enableMicr: temp.enableMicr + }) + } else { + await PostOpenCamera({ + roomNum: temp.roomNum, + uid: temp.uid, + enableCamera: temp.enableCamera + }) + } + } catch (error) { + + } + break; } }) }, @@ -876,11 +897,20 @@ Page({ enableMicr }) } else { - await PostOpenMicr({ - roomNum: this.data.channelId, + await onInvoke('sendOper2User', { uid, - enableMicr + contentString: JSON.stringify({ + roomNum: this.data.channelId, + uid, + enableMicr, + type: 'audio' + }) }) + // await PostOpenMicr({ + // roomNum: this.data.channelId, + // uid, + // enableMicr + // }) } if (isMessage) { this.message('操作成功').success() @@ -892,11 +922,20 @@ Page({ } else { // await agora.stopCameraCapture(); } - await PostOpenCamera({ - roomNum: this.data.channelId, + await onInvoke('sendOper2User', { uid, - enableCamera + contentString: JSON.stringify({ + roomNum: this.data.channelId, + uid, + enableCamera, + type: 'video' + }) }) + // await PostOpenCamera({ + // roomNum: this.data.channelId, + // uid, + // enableCamera + // }) if (isMessage) { this.message('操作成功').success() } diff --git a/pages/meeting/index.wxml b/pages/meeting/index.wxml index bac6815..1581390 100644 --- a/pages/meeting/index.wxml +++ b/pages/meeting/index.wxml @@ -59,6 +59,8 @@ + diff --git a/utils/singlr.ts b/utils/singlr.ts index 5f74299..1f0efe8 100644 --- a/utils/singlr.ts +++ b/utils/singlr.ts @@ -68,6 +68,10 @@ export const onInvoke = async (str: string, data: any) => { // 发言人设置成功 await connection.invoke(str, data) break; + case 'sendOper2User': + // 扩展参数 + await connection.invoke(str, data.uid, data.contentString) + break; } } export const onSignalr = (callBack: Function) => { @@ -204,6 +208,13 @@ export const onSignalr = (callBack: Function) => { RoomManagerInputDTO }) }); + // 扩展参数 + connection.on("ReceivedOperation", (contentString) => { + callBack({ + key: 'ReceivedOperation', + contentString + }) + }); } } export const onStop = async () => { @@ -261,6 +272,7 @@ export const offSignalr = () => { connection.off('SetDriver'); connection.off('ShowDriverList'); connection.off('SetSpeaker'); + connection.off('ReceivedOperation'); } }