import { ZoomVideoSDKErrors } from './zoom_video_sdk_defines.js' import messages from './electron_zoomvideosdk_pb.js' export function setUserInfo (data) { try { const VideoSDKUser = new messages.VideoSDKUser() VideoSDKUser.setPUser(data.pUser) VideoSDKUser.setCustomIdentity(data.custom_identity) VideoSDKUser.setUsername(data.username) VideoSDKUser.setIshasvideodevice(data.isHasVideoDevice) VideoSDKUser.setIsvideoon(data.isVideoOn) VideoSDKUser.setAudiotype(data.audioType) VideoSDKUser.setIsaudiomuted(data.isAudioMuted) VideoSDKUser.setIsaudiotalking(data.isAudioTalking) VideoSDKUser.setSharestatus(data.ShareStatus) VideoSDKUser.setIshost(data.isHost) VideoSDKUser.setIsmanager(data.isManager) VideoSDKUser.setVideostatisticinfoWidth(data.VideoStatisticInfo_width) VideoSDKUser.setVideostatisticinfoHeight(data.VideoStatisticInfo_height) VideoSDKUser.setVideostatisticinfoFps(data.VideoStatisticInfo_fps) VideoSDKUser.setVideostatisticinfoBpf(data.VideoStatisticInfo_bpf) VideoSDKUser.setSharestatisticinfoWidth(data.ShareStatisticInfo_width) VideoSDKUser.setSharestatisticinfoHeight(data.ShareStatisticInfo_height) VideoSDKUser.setSharestatisticinfoFps(data.ShareStatisticInfo_fps) VideoSDKUser.setSharestatisticinfoBpf(data.ShareStatisticInfo_bpf) VideoSDKUser.setUserid(data.userid) return VideoSDKUser } catch (error) { return ZoomVideoSDKErrors.ZoomVideoSDKErrors_Invalid_Parameter; } } export function getUserInfo (data) { try { let userObj = {} let message = data userObj.pUser = message.getPUser() userObj.custom_identity = message.getCustomIdentity() userObj.username = data.getUsername() userObj.isHasVideoDevice = message.getIshasvideodevice() userObj.isVideoOn = message.getIsvideoon() userObj.audioType = message.getAudiotype() userObj.isAudioMuted = message.getIsaudiomuted() userObj.isAudioTalking = message.getIsaudiotalking() userObj.ShareStatus = message.getSharestatus() userObj.isHost = message.getIshost() userObj.isManager = message.getIsmanager() userObj.VideoStatisticInfo_width = message.getVideostatisticinfoWidth() userObj.VideoStatisticInfo_height = message.getVideostatisticinfoHeight() userObj.VideoStatisticInfo_fps = message.getVideostatisticinfoFps() userObj.VideoStatisticInfo_bpf = message.getVideostatisticinfoBpf() userObj.ShareStatisticInfo_width = message.getSharestatisticinfoWidth() userObj.ShareStatisticInfo_height = message.getSharestatisticinfoHeight() userObj.ShareStatisticInfo_fps = message.getSharestatisticinfoFps() userObj.ShareStatisticInfo_bpf = message.getSharestatisticinfoBpf() userObj.userid = message.getUserid() return userObj } catch (error) { return ZoomVideoSDKErrors.ZoomVideoSDKErrors_Invalid_Parameter; } }