UNPKG

tjc-sdk

Version:

TIANJI IM SDK

2 lines (1 loc) 1.22 kB
import E from"../../messages/messageContent.js";import{MessageContentType as _}from"../../messages/messageContentType.js";import U from"../../client/tjc.js";class e extends E{conferenceId;commandType;targetUserId;boolValue;constructor(E,U,e,s){super(_.CONFERENCE_CONTENT_TYPE_COMMAND),this.conferenceId=E,this.commandType=U,this.targetUserId=e,this.boolValue=s}encode(){let E=super.encode();E.content=this.conferenceId;let _={t:this.commandType,u:this.targetUserId};return this.boolValue&&(_.b=this.boolValue),E.binaryContent=U.utf8_to_b64(JSON.stringify(_)),E}decode(E){if(super.decode(E),E.binaryContent){let _=U.b64_to_utf8(E.binaryContent),e=JSON.parse(_);this.commandType=e.t,this.boolValue=!!e.b,this.targetUserId=e.u}this.conferenceId=E.content}static ConferenceCommandType={MUTE_ALL_AUDIO:0,CANCEL_MUTE_ALL_AUDIO:1,REQUEST_MUTE_AUDIO:2,REJECT_UNMUTE_REQUEST_AUDIO:3,APPLY_UNMUTE_AUDIO:4,APPROVE_UNMUTE_AUDIO:5,APPROVE_ALL_UNMUTE_AUDIO:6,HANDUP:7,PUT_HAND_DOWN:8,PUT_ALL_HAND_DOWN:9,RECORDING:10,FOCUS:11,CANCEL_FOCUS:12,MUTE_ALL_VIDEO:13,CANCEL_MUTE_ALL_VIDEO:14,REQUEST_MUTE_VIDEO:15,REJECT_UNMUTE_REQUEST_VIDEO:16,APPLY_UNMUTE_VIDEO:17,APPROVE_UNMUTE_VIDEO:18,APPROVE_ALL_UNMUTE_VIDEO:19}}export{e as default};