# Room

#### new Room()

Description:
  - 房间Room构造函数。
Source:
  - room/room.js, line 12

##### Example

    var room = new Room(roomId);

### Members

#### cleanupBoardByReJoinConnected

Description:
  - 重新加会成功后，应用层需要清理白板的标识，true代表要清理。 原因是服务器版本3.1.8开始，当客户端重新加会成功后，会重新下发所有之前白板相关信息包括批注，所以应用层需要先删除掉原来的白板相关界面内容，否则会重复渲染，可能会存在错位。
Source:
  - room/room.js, line 164

重新加会成功后，应用层需要清理白板的标识，true代表要清理。 原因是服务器版本3.1.8开始，当客户端重新加会成功后，会重新下发所有之前白板相关信息包括批注，所以应用层需要先删除掉原来的白板相关界面内容，否则会重复渲染，可能会存在错位。

#### cleanupBoardByReJoinConnected

Description:
  - 重新加会成功后，应用层需要清理白板的标识，true代表要清理。 原因是服务器版本3.1.8开始，当客户端重新加会成功后，会重新下发所有之前白板相关信息包括批注，所以应用层需要先删除掉原来的白板相关界面内容，否则会重复渲染，可能会存在错位。
Source:
  - room/room.js, line 164

重新加会成功后，应用层需要清理白板的标识，true代表要清理。 原因是服务器版本3.1.8开始，当客户端重新加会成功后，会重新下发所有之前白板相关信息包括批注，所以应用层需要先删除掉原来的白板相关界面内容，否则会重复渲染，可能会存在错位。

### Methods

#### addCallback(type, callback)

Description:
  - 房间级别的回调
Source:
  - room/room.js, line 2286

##### Example

    room.addCallback(RoomCallback.connection_status, onConnectionStatus);
    room.addCallback(RoomCallback.connection_indicator,onConnectionIndicator);
    room.addCallback(RoomCallback.room_status_notify, onRoomStatusNotify);

    room.addCallback(RoomCallback.user_join_notify, onUserJoinNotify);
    room.addCallback(RoomCallback.user_leave_notify, onUserLeaveNotify);
    room.addCallback(RoomCallback.leave_indication, onLeaveIndication);
    room.addCallback(RoomCallback.close_room_result, onCloseRoomResult);
    room.addCallback(RoomCallback.close_room_notify, onCloseRoomNotify);
    room.addCallback(RoomCallback.app_data_notify, onAppdataNotify);
    room.addCallback(RoomCallback.user_data_notify, onUserDataNotify);
    room.addCallback(RoomCallback.user_name_notify, onUserNameNotify);

    room.addCallback(RoomCallback.public_message, onPublicMessage);
    room.addCallback(RoomCallback.private_message, onPrivateMessage);
    room.addCallback(RoomCallback.public_data, onPublicData);
    room.addCallback(RoomCallback.private_data, onPrivateData);

    room.addCallback(RoomCallback.screen_sharing_ended, onScreenSharingEnded);

    room.addCallback(RoomCallback.outgoing_invite_status_notify, onOutgoingInviteStatusNotify);
    room.addCallback(RoomCallback.room_control_change_notify, onRoomControlChangeNotify);

    与服务器连接状态回调
    param:status - 连接状态

    function onConnectionStatus(status) {
       if (status == ConnectionStatus.connecting) {
    	       //TODO 与服务器重连中
       } else if (status == ConnectionStatus.connected) {
    	       //TODO 与服务器重连成功
       } else if (status == ConnectionStatus.connectFailed) {
    	      //TODO 与服务器重连失败,需要重新登陆
      }
     }

    与服务器连接指示器回调
    param: connectionIndicator - 连接指示器

    function onConnectionIndicator(connectionIndicator){
               if（connectionIndicator）{
    	              var roomConnection = connectionIndicator.getRoomConnection();

                   //房间级别
                   roomConnection.localAddress   本地地址
                   roomConnection.localPort      本地端口
                   roomConnection.localProtocol  本地协议
                   roomConnection.remoteAddress  远端地址
                   roomConnection.remotePort     远端端口
                   roomConnection.remoteProtocol  远端协议

                   roomConnection.downloadBitrate  下载流量
                   roomConnection.uploadBitrate    上传流量

                   roomConnection.downloadPacket  下载数据包
                   roomConnection.uploadPacket    上传数据包
                   roomConnection.downloadPacketLost  下载数据包丢包数
                   roomConnection.uploadPacketLost   上传数据包丢包数

                   roomConnection.downloadPacketLostRate  下载数据包丢包率
                   roomConnection.uploadPacketLostRate   上传数据包丢包率

                   roomConnection.currentRoundTripTime   当前的往返时间(RTT)
                   roomConnection.totalRoundTripTime     累计的往返时间(RTT)

                   //某路音频相关
                   var audioConnection = connectionIndicator.getAudioConnection(userId);
                   audioConnection.downloadBitrate   音频下载流量
                   audioConnection.uploadBitrate     音频上传流量

                   audioConnection.downloadPacket   音频下载数据包
                   audioConnection.uploadPacket     音频上传数据包

                   audioConnection.packetsLost     音频数据包丢包数
                   audioConnection.packetLostRate  音频数据包丢包率

                   audioConnection.ssrc
                   audioConnection.trackId
                   audioConnection.payloadType
                   audioConnection.mimeType
                   audioConnection.clockRate

                   //某路视频相关
                   videoConnection = connectionIndicator.getVideoConnection(userId, cameraId);
                   videoConnection.downloadBitrate   视频下载流量
                   videoConnection.uploadBitrate     视频上传流量

                   videoConnection.downloadPacket    视频下载数据包
                   videoConnection.uploadPacket     视频传数据包

                   videoConnection.packetsLost     视频数据包丢包数
                   videoConnection.packetLostRate  视频数据包丢包率

                   videoConnection.resolution     分辨率
                   videoConnection.frameRate      帧率

                   videoConnection.qpSum           媒体数据包的总量化值(qpSum
                   videoConnection.framesEncoded   已编码帧的数量
                   videoConnection.framesDecoded   已解码帧的数量
                   videoConnection.perFrameQP      每个视频帧的平均量化值(perFrameQP)

                   videoConnection.ssrc
                   videoConnection.trackId
                   videoConnection.payloadType
                   videoConnection.mimeType
                   videoConnection.clockRate

    *              //某路桌面共享相关
                   screenConnection = connectionIndicator.getScreenConnection(userId);
                   screenConnection.downloadBitrate   桌面共享下载流量
                   screenConnection.uploadBitrate     桌面共享上传流量

                   screenConnection.downloadPacket    桌面共享下载数据包
                   screenConnection.uploadPacket     桌面共享传数据包

                   screenConnection.packetsLost      桌面共享数据包丢包数
                   screenConnection.packetLostRate   桌面共享数据包丢包率

                   screenConnection.resolution        分辨率
                   screenConnection.frameRate         帧率
                   screenConnection.ssrc
                   screenConnection.trackId
                   screenConnection.payloadType
                   screenConnection.mimeType
                   screenConnection.clockRate
              }
    }

    参会者加会回调
    param :users － 参会者数组

    function onUserJoinNotify(users) {

    }

    参会者退会回调
    param:opt - 退会类型
    param:reason  - 退会原因
    param:user - 退会用户

    function onUserLeaveNotify(opt,reason,user) {

    }

    被踢出会议室
    param:reason - 被踢原因
    param:userId - 踢人的操作者

    function onLeaveIndication(reason,userId) {

    }

    房间应用扩展字段回调
    param {Object} key － key值
    param {Object} value － value值
    function onAppdataNotify(key, value) {

    }

    用户扩展内容更新回调
    param:userData - 用户扩展内容
    param:userId - 用户id

    function onUserDataNotify(userData, userId ) {

    }

    用户修改名字回调
    param {String} userName - 用户新名字
    param {String} userId - 用户id

    function onUserNameNotify(userName, userId){

    }

    公聊回调
    param : Message

    function onPublicMessage(Message) {

    }

    私聊回调
    param: Message

    function onPrivateMessage(Message) {

    }

    公有透明通道回调
    param:dataArrayBuffer － DataArrayBuffer对象
    param:userId － user id

    function onPublicData(dataArrayBuffer, userId) {

    }

    私有透明通道回调
    param:dataArrayBuffer － DataArrayBuffer对象
    param:userId － user id

    function onPrivateData(dataArrayBuffer, userId) {

    }

    桌面共享关闭的回调
    function onScreenSharingEnded(){

    }

    外部设备邀请状态回调
    param:type － OutgoingInviteType枚举值
    param:roomId － 房间ID
    param:addr － 设备地址
    param:status － 邀请状态码
    param:msg － 邀请返回状态

    function onOutgoingInviteStatusNotify(type,roomId,addr,status,msg){

    }

    房间参数设置回调
    param:roomControl － 参数对象
    function onRoomControlChangeNotify(roomControl){

    }

##### Parameters:

Name | Type | Description
--- | --- | ---
`type` | RoomCallback | 回调枚举标识
`callback` | Object | 回调方法名,可以自定义，建议保持默认值

#### addCallback(type, callback)

Description:
  - 房间级别的回调
Source:
  - room/room.js, line 2286

##### Example

    room.addCallback(RoomCallback.connection_status, onConnectionStatus);
    room.addCallback(RoomCallback.connection_indicator,onConnectionIndicator);
    room.addCallback(RoomCallback.room_status_notify, onRoomStatusNotify);

    room.addCallback(RoomCallback.user_join_notify, onUserJoinNotify);
    room.addCallback(RoomCallback.user_leave_notify, onUserLeaveNotify);
    room.addCallback(RoomCallback.leave_indication, onLeaveIndication);
    room.addCallback(RoomCallback.close_room_result, onCloseRoomResult);
    room.addCallback(RoomCallback.close_room_notify, onCloseRoomNotify);
    room.addCallback(RoomCallback.app_data_notify, onAppdataNotify);
    room.addCallback(RoomCallback.user_data_notify, onUserDataNotify);
    room.addCallback(RoomCallback.user_name_notify, onUserNameNotify);

    room.addCallback(RoomCallback.public_message, onPublicMessage);
    room.addCallback(RoomCallback.private_message, onPrivateMessage);
    room.addCallback(RoomCallback.public_data, onPublicData);
    room.addCallback(RoomCallback.private_data, onPrivateData);

    room.addCallback(RoomCallback.screen_sharing_ended, onScreenSharingEnded);

    room.addCallback(RoomCallback.outgoing_invite_status_notify, onOutgoingInviteStatusNotify);
    room.addCallback(RoomCallback.room_control_change_notify, onRoomControlChangeNotify);

    与服务器连接状态回调
    param:status - 连接状态

    function onConnectionStatus(status) {
       if (status == ConnectionStatus.connecting) {
    	       //TODO 与服务器重连中
       } else if (status == ConnectionStatus.connected) {
    	       //TODO 与服务器重连成功
       } else if (status == ConnectionStatus.connectFailed) {
    	      //TODO 与服务器重连失败,需要重新登陆
      }
     }

    与服务器连接指示器回调
    param: connectionIndicator - 连接指示器

    function onConnectionIndicator(connectionIndicator){
               if（connectionIndicator）{
    	              var roomConnection = connectionIndicator.getRoomConnection();

                   //房间级别
                   roomConnection.localAddress   本地地址
                   roomConnection.localPort      本地端口
                   roomConnection.localProtocol  本地协议
                   roomConnection.remoteAddress  远端地址
                   roomConnection.remotePort     远端端口
                   roomConnection.remoteProtocol  远端协议

                   roomConnection.downloadBitrate  下载流量
                   roomConnection.uploadBitrate    上传流量

                   roomConnection.downloadPacket  下载数据包
                   roomConnection.uploadPacket    上传数据包
                   roomConnection.downloadPacketLost  下载数据包丢包数
                   roomConnection.uploadPacketLost   上传数据包丢包数

                   roomConnection.downloadPacketLostRate  下载数据包丢包率
                   roomConnection.uploadPacketLostRate   上传数据包丢包率

                   roomConnection.currentRoundTripTime   当前的往返时间(RTT)
                   roomConnection.totalRoundTripTime     累计的往返时间(RTT)

                   //某路音频相关
                   var audioConnection = connectionIndicator.getAudioConnection(userId);
                   audioConnection.downloadBitrate   音频下载流量
                   audioConnection.uploadBitrate     音频上传流量

                   audioConnection.downloadPacket   音频下载数据包
                   audioConnection.uploadPacket     音频上传数据包

                   audioConnection.packetsLost     音频数据包丢包数
                   audioConnection.packetLostRate  音频数据包丢包率

                   audioConnection.ssrc
                   audioConnection.trackId
                   audioConnection.payloadType
                   audioConnection.mimeType
                   audioConnection.clockRate

                   //某路视频相关
                   videoConnection = connectionIndicator.getVideoConnection(userId, cameraId);
                   videoConnection.downloadBitrate   视频下载流量
                   videoConnection.uploadBitrate     视频上传流量

                   videoConnection.downloadPacket    视频下载数据包
                   videoConnection.uploadPacket     视频传数据包

                   videoConnection.packetsLost     视频数据包丢包数
                   videoConnection.packetLostRate  视频数据包丢包率

                   videoConnection.resolution     分辨率
                   videoConnection.frameRate      帧率

                   videoConnection.qpSum           媒体数据包的总量化值(qpSum
                   videoConnection.framesEncoded   已编码帧的数量
                   videoConnection.framesDecoded   已解码帧的数量
                   videoConnection.perFrameQP      每个视频帧的平均量化值(perFrameQP)

                   videoConnection.ssrc
                   videoConnection.trackId
                   videoConnection.payloadType
                   videoConnection.mimeType
                   videoConnection.clockRate

    *              //某路桌面共享相关
                   screenConnection = connectionIndicator.getScreenConnection(userId);
                   screenConnection.downloadBitrate   桌面共享下载流量
                   screenConnection.uploadBitrate     桌面共享上传流量

                   screenConnection.downloadPacket    桌面共享下载数据包
                   screenConnection.uploadPacket     桌面共享传数据包

                   screenConnection.packetsLost      桌面共享数据包丢包数
                   screenConnection.packetLostRate   桌面共享数据包丢包率

                   screenConnection.resolution        分辨率
                   screenConnection.frameRate         帧率
                   screenConnection.ssrc
                   screenConnection.trackId
                   screenConnection.payloadType
                   screenConnection.mimeType
                   screenConnection.clockRate
              }
    }

    参会者加会回调
    param :users － 参会者数组

    function onUserJoinNotify(users) {

    }

    参会者退会回调
    param:opt - 退会类型
    param:reason  - 退会原因
    param:user - 退会用户

    function onUserLeaveNotify(opt,reason,user) {

    }

    被踢出会议室
    param:reason - 被踢原因
    param:userId - 踢人的操作者

    function onLeaveIndication(reason,userId) {

    }

    房间应用扩展字段回调
    param {Object} key － key值
    param {Object} value － value值
    function onAppdataNotify(key, value) {

    }

    用户扩展内容更新回调
    param:userData - 用户扩展内容
    param:userId - 用户id

    function onUserDataNotify(userData, userId ) {

    }

    用户修改名字回调
    param {String} userName - 用户新名字
    param {String} userId - 用户id

    function onUserNameNotify(userName, userId){

    }

    公聊回调
    param : Message

    function onPublicMessage(Message) {

    }

    私聊回调
    param: Message

    function onPrivateMessage(Message) {

    }

    公有透明通道回调
    param:dataArrayBuffer － DataArrayBuffer对象
    param:userId － user id

    function onPublicData(dataArrayBuffer, userId) {

    }

    私有透明通道回调
    param:dataArrayBuffer － DataArrayBuffer对象
    param:userId － user id

    function onPrivateData(dataArrayBuffer, userId) {

    }

    桌面共享关闭的回调
    function onScreenSharingEnded(){

    }

    外部设备邀请状态回调
    param:type － OutgoingInviteType枚举值
    param:roomId － 房间ID
    param:addr － 设备地址
    param:status － 邀请状态码
    param:msg － 邀请返回状态

    function onOutgoingInviteStatusNotify(type,roomId,addr,status,msg){

    }

    房间参数设置回调
    param:roomControl － 参数对象
    function onRoomControlChangeNotify(roomControl){

    }

##### Parameters:

Name | Type | Description
--- | --- | ---
`type` | RoomCallback | 回调枚举标识
`callback` | Object | 回调方法名,可以自定义，建议保持默认值

#### closeRoom(userId)

Description:
  - 关闭房间
Source:
  - room/room.js, line 1897

##### Parameters:

Name | Type | Description
--- | --- | ---
`userId` | String | 关闭房间的操作用户ID

#### closeRoom(userId)

Description:
  - 关闭房间
Source:
  - room/room.js, line 1897

##### Parameters:

Name | Type | Description
--- | --- | ---
`userId` | String | 关闭房间的操作用户ID

#### continuousReJoin()

Description:
  - 多次后重新加会超时后，开启持续永久重新加会
Source:
  - room/room.js, line 984

#### continuousReJoin()

Description:
  - 多次后重新加会超时后，开启持续永久重新加会
Source:
  - room/room.js, line 984

#### getAppData(key) → {String}

Description:
  - 获得房间应用扩展字段信息
Source:
  - room/room.js, line 1675

##### Parameters:

Name | Type | Description
--- | --- | ---
`key` | String | key值

##### Returns:

value- value值

Type
  String

#### getAppData(key) → {String}

Description:
  - 获得房间应用扩展字段信息
Source:
  - room/room.js, line 1675

##### Parameters:

Name | Type | Description
--- | --- | ---
`key` | String | key值

##### Returns:

value- value值

Type
  String

#### getBoardNumber(status) → {int}

Description:
  - 获取房间内当前白板数
Source:
  - room/room.js, line 1323

##### Example

    room.getBoardNumber(boardStatusEnum.open);

##### Parameters:

Name | Type | Description
--- | --- | ---
`status` | boardStatusEnum | 白板状态值, 可以不填，不填时包括boardStatusEnum.open和boardStatusEnum.close的

##### Returns:

boardNumber -白板数

Type
  int

#### getBoardNumber(status) → {int}

Description:
  - 获取房间内当前白板数
Source:
  - room/room.js, line 1323

##### Example

    room.getBoardNumber(boardStatusEnum.open);

##### Parameters:

Name | Type | Description
--- | --- | ---
`status` | boardStatusEnum | 白板状态值, 可以不填，不填时包括boardStatusEnum.open和boardStatusEnum.close的

##### Returns:

boardNumber -白板数

Type
  int

#### getMaxAttendee() → {Int}

Description:
  - 获取允许的最大参加会议人数
Source:
  - room/room.js, line 1134

##### Returns:

maxAttendee - 最大参加会议人数

Type
  Int

#### getMaxAttendee() → {Int}

Description:
  - 获取允许的最大参加会议人数
Source:
  - room/room.js, line 1134

##### Returns:

maxAttendee - 最大参加会议人数

Type
  Int

#### getMaxAudio() → {Int}

Description:
  - 获取允许的最大音频路数
Source:
  - room/room.js, line 1118

##### Returns:

maxAudio - 最大音频路数

Type
  Int

#### getMaxAudio() → {Int}

Description:
  - 获取允许的最大音频路数
Source:
  - room/room.js, line 1118

##### Returns:

maxAudio - 最大音频路数

Type
  Int

#### getMaxVideo() → {Int}

Description:
  - 获取允许的最大视频路数
Source:
  - room/room.js, line 1126

##### Returns:

maxVideo - 最大视频路数

Type
  Int

#### getMaxVideo() → {Int}

Description:
  - 获取允许的最大视频路数
Source:
  - room/room.js, line 1126

##### Returns:

maxVideo - 最大视频路数

Type
  Int

#### getOwnerId() → {String}

Description:
  - 获取会议建创者Id
Source:
  - room/room.js, line 1046

##### Returns:

ownerId - 会议建创者Id

Type
  String

#### getOwnerId() → {String}

Description:
  - 获取会议建创者Id
Source:
  - room/room.js, line 1046

##### Returns:

ownerId - 会议建创者Id

Type
  String

#### getParticipants() → {Object}

Description:
  - 返回参会者数组
Source:
  - room/room.js, line 1222

##### Returns:

participants -参会者数组

Type
  Object

#### getParticipants() → {Object}

Description:
  - 返回参会者数组
Source:
  - room/room.js, line 1222

##### Returns:

participants -参会者数组

Type
  Object

#### getParticipantsNumber() → {int}

Description:
  - 返回参会者人数
Source:
  - room/room.js, line 1231

##### Returns:

participantsNumber -参会者人数

Type
  int

#### getParticipantsNumber() → {int}

Description:
  - 返回参会者人数
Source:
  - room/room.js, line 1231

##### Returns:

participantsNumber -参会者人数

Type
  int

#### getPublishedCamera()

Description:
  - 获取房间中所有已发布的摄像头视频对象集
Source:
  - room/room.js, line 1432

#### getPublishedCamera()

Description:
  - 获取房间中所有已发布的摄像头视频对象集
Source:
  - room/room.js, line 1432

#### getPublishedCameraCount()

Description:
  - 获取房间中所有已发布的摄像头视频数量
Source:
  - room/room.js, line 1423

#### getPublishedCameraCount()

Description:
  - 获取房间中所有已发布的摄像头视频数量
Source:
  - room/room.js, line 1423

#### getPublishedScreen()

Description:
  - 获取房间中所有已发布的共享屏幕窗口视频对象集
Source:
  - room/room.js, line 1451

#### getPublishedScreen()

Description:
  - 获取房间中所有已发布的共享屏幕窗口视频对象集
Source:
  - room/room.js, line 1451

#### getPublishedScreenCount()

Description:
  - 获取房间中所有已发发布的共享屏幕窗口视频数量
Source:
  - room/room.js, line 1442

#### getPublishedScreenCount()

Description:
  - 获取房间中所有已发发布的共享屏幕窗口视频数量
Source:
  - room/room.js, line 1442

#### getRoomControl() → {Object}

Description:
  - 获取房间控制参数
Source:
  - room/room.js, line 2295

##### Returns:

- roomControl 房间控制参数

Type
  Object

#### getRoomControl() → {Object}

Description:
  - 获取房间控制参数
Source:
  - room/room.js, line 2295

##### Returns:

- roomControl 房间控制参数

Type
  Object

#### getRoomId() → {String}

Description:
  - 获取房间号
Source:
  - room/room.js, line 1028

##### Returns:

roomId - 房间号

Type
  String

#### getRoomId() → {String}

Description:
  - 获取房间号
Source:
  - room/room.js, line 1028

##### Returns:

roomId - 房间号

Type
  String

#### getRoomTopic() → {String}

Description:
  - 获取会议主题
Source:
  - room/room.js, line 1037

##### Returns:

topic - 会议主题

Type
  String

#### getRoomTopic() → {String}

Description:
  - 获取会议主题
Source:
  - room/room.js, line 1037

##### Returns:

topic - 会议主题

Type
  String

#### getRoomType(roomTypEnum) → {Boolean}

Description:
  - 会议类型判断
Source:
  - room/room.js, line 1074

##### Parameters:

Name | Type | Description
--- | --- | ---
`roomTypEnum` | Enum | 传入会议类型枚举

##### Returns:

true: 是枚举对应的会议类型,false:非枚举对应的会议类型

Type
  Boolean

#### getRoomType(roomTypEnum) → {Boolean}

Description:
  - 会议类型判断
Source:
  - room/room.js, line 1074

##### Parameters:

Name | Type | Description
--- | --- | ---
`roomTypEnum` | Enum | 传入会议类型枚举

##### Returns:

true: 是枚举对应的会议类型,false:非枚举对应的会议类型

Type
  Boolean

#### getSelfUser() → {user}

Description:
  - 返回自己对象
Source:
  - room/room.js, line 1204

##### Returns:

selfUser - 自己对象

Type
  user

#### getSelfUser() → {user}

Description:
  - 返回自己对象
Source:
  - room/room.js, line 1204

##### Returns:

selfUser - 自己对象

Type
  user

#### getSelfUserId() → {String}

Description:
  - 返回自己对象的Id
Source:
  - room/room.js, line 1213

##### Returns:

userId - 自己对象的Id

Type
  String

#### getSelfUserId() → {String}

Description:
  - 返回自己对象的Id
Source:
  - room/room.js, line 1213

##### Returns:

userId - 自己对象的Id

Type
  String

#### getUsableAudio() → {Int}

Description:
  - 获取音频路数的剩余可用数。

    逻辑：允许的最大音频路数 － 已发布的音频路数

    注：主要用于界面显示用，具体打开的限制提示时，会采用服务器端的返回号来处理

Source:
  - room/room.js, line 1160

##### Returns:

usableAudio - 剩余可用音频路数

Type
  Int

#### getUsableAudio() → {Int}

Description:
  - 获取音频路数的剩余可用数。

    逻辑：允许的最大音频路数 － 已发布的音频路数

    注：主要用于界面显示用，具体打开的限制提示时，会采用服务器端的返回号来处理

Source:
  - room/room.js, line 1160

##### Returns:

usableAudio - 剩余可用音频路数

Type
  Int

#### getUsableVideo() → {Int}

Description:
  - 获取视频路数的剩余可用数。

    逻辑：允许的最大视频路数 － 已发布的视频路数

    注：主要用于界面显示用，具体打开的限制提示时，会采用服务器端的返回号来处理

Source:
  - room/room.js, line 1145

##### Returns:

usableVideo - 剩余可用视频路数

Type
  Int

#### getUsableVideo() → {Int}

Description:
  - 获取视频路数的剩余可用数。

    逻辑：允许的最大视频路数 － 已发布的视频路数

    注：主要用于界面显示用，具体打开的限制提示时，会采用服务器端的返回号来处理

Source:
  - room/room.js, line 1145

##### Returns:

usableVideo - 剩余可用视频路数

Type
  Int

#### getUser(userId) → {Object}

Description:
  - 通过用户ID获取用户对象
Source:
  - room/room.js, line 1245

##### Parameters:

Name | Type | Description
--- | --- | ---
`userId` | String | 用户的Id

##### Returns:

user - 用户对象

Type
  Object

#### getUser(userId) → {Object}

Description:
  - 通过用户ID获取用户对象
Source:
  - room/room.js, line 1245

##### Parameters:

Name | Type | Description
--- | --- | ---
`userId` | String | 用户的Id

##### Returns:

user - 用户对象

Type
  Object

#### getUserByUserIdAndNodeId(userId) → {Object}

Description:
  - 通过用户ID获取用户对象
Source:
  - room/room.js, line 1262

##### Parameters:

Name | Type | Description
--- | --- | ---
`userId` | String | 用户的Id

##### Returns:

user - 用户对象

Type
  Object

#### getUserByUserIdAndNodeId(userId) → {Object}

Description:
  - 通过用户ID获取用户对象
Source:
  - room/room.js, line 1262

##### Parameters:

Name | Type | Description
--- | --- | ---
`userId` | String | 用户的Id

##### Returns:

user - 用户对象

Type
  Object

#### hasUser(userId)

Description:
  - 通过用户ID,判断用户对象是否存在。
Source:
  - room/room.js, line 1282

##### Parameters:

Name | Type | Description
--- | --- | ---
`userId` | String | 用户的Id

#### hasUser(userId)

Description:
  - 通过用户ID,判断用户对象是否存在。
Source:
  - room/room.js, line 1282

##### Parameters:

Name | Type | Description
--- | --- | ---
`userId` | String | 用户的Id

#### isMcu() → {Boolean}

Description:
  - 判断当前会议模式是否为MCU模式
Source:
  - room/room.js, line 1055

##### Returns:

isMcuRoomＭode - 是否为MCU模式. true: mcu模式;false:P2P模式

Type
  Boolean

#### isMcu() → {Boolean}

Description:
  - 判断当前会议模式是否为MCU模式
Source:
  - room/room.js, line 1055

##### Returns:

isMcuRoomＭode - 是否为MCU模式. true: mcu模式;false:P2P模式

Type
  Boolean

#### ismuteSpeaker() → {Boolean}

Description:
  - 获取屏蔽会议声音的当前状态
Source:
  - room/room.js, line 1820

##### Returns:

- 屏蔽会议声音的当前状态

Type
  Boolean

#### ismuteSpeaker() → {Boolean}

Description:
  - 获取屏蔽会议声音的当前状态
Source:
  - room/room.js, line 1820

##### Returns:

- 屏蔽会议声音的当前状态

Type
  Boolean

#### (async) join(userId, userName, userData, password)

Description:
  - 加会
Source:
  - room/room.js, line 457

##### Example

    room.join('user01','ds','','').then(function(){}).otherwise(function(error){});

##### Parameters:

Name | Type | Description
--- | --- | ---
`userId` | String | 用户的Id
`userName` | String | 用户名
`userData` | String | 用户扩展字段
`password` | String | 会议密码

#### (async) join(userId, userName, userData, password)

Description:
  - 加会
Source:
  - room/room.js, line 457

##### Example

    room.join('user01','ds','','').then(function(){}).otherwise(function(error){});

##### Parameters:

Name | Type | Description
--- | --- | ---
`userId` | String | 用户的Id
`userName` | String | 用户名
`userData` | String | 用户扩展字段
`password` | String | 会议密码

#### (async) joinEfficient(serverURI, accessToken, userId, userName, userData, password)

Description:
  - 高效加会,与room.join()接口的区别是不再需要另外调用avdEngine.init()
Source:
  - room/room.js, line 350

##### Example

    room.joinEfficient('avd.nice2meet.cn:9610','ZDgyNGU1MGU0ZGY2MTJlZWY3NjkwMjQ5NDY0YWE3MDkxZGJjNmRiZg==','user01','ds','','').then(function(){}).otherwise(function(error){});

##### Parameters:

Name | Type | Description
--- | --- | ---
`serverURI` | String | MCU服务器地址
`accessToken` | String | 访问令牌
`userId` | String | 用户的Id
`userName` | String | 用户名
`userData` | String | 用户扩展字段
`password` | String | 会议密码

#### (async) joinEfficient(serverURI, accessToken, userId, userName, userData, password)

Description:
  - 高效加会,与room.join()接口的区别是不再需要另外调用avdEngine.init()
Source:
  - room/room.js, line 350

##### Example

    room.joinEfficient('avd.nice2meet.cn:9610','ZDgyNGU1MGU0ZGY2MTJlZWY3NjkwMjQ5NDY0YWE3MDkxZGJjNmRiZg==','user01','ds','','').then(function(){}).otherwise(function(error){});

##### Parameters:

Name | Type | Description
--- | --- | ---
`serverURI` | String | MCU服务器地址
`accessToken` | String | 访问令牌
`userId` | String | 用户的Id
`userName` | String | 用户名
`userData` | String | 用户扩展字段
`password` | String | 会议密码

#### (async) joinWithOEM(userId, userName, userData, password)

Description:
  - OEM加会
Source:
  - room/room.js, line 571

##### Parameters:

Name | Type | Description
--- | --- | ---
`userId` | Object | 用户的Id
`userName` | Object | 用户名
`userData` | Object | 用户扩展字段
`password` | String | 会议密码

#### (async) joinWithOEM(userId, userName, userData, password)

Description:
  - OEM加会
Source:
  - room/room.js, line 571

##### Parameters:

Name | Type | Description
--- | --- | ---
`userId` | Object | 用户的Id
`userName` | Object | 用户名
`userData` | Object | 用户扩展字段
`password` | String | 会议密码

#### kickoffUser(reason, userId)

Description:
  - 踢人
Source:
  - room/room.js, line 1846

##### Parameters:

Name | Type | Description
--- | --- | ---
`reason` | int | 踢人原因，填写808，其它值也都会重置成808
`userId` | String | 被踢用户id

#### kickoffUser(reason, userId)

Description:
  - 踢人
Source:
  - room/room.js, line 1846

##### Parameters:

Name | Type | Description
--- | --- | ---
`reason` | int | 踢人原因，填写808，其它值也都会重置成808
`userId` | String | 被踢用户id

#### (async) leave(reason, kickoffOpt)

Description:
  - 退会
Source:
  - room/room.js, line 1863

##### Example

    room.leave(1).then(function(){}).otherwise(function(error){});

##### Parameters:

Name | Type | Description
--- | --- | ---
`reason` | int | 退会原因，可以填写 1
`kickoffOpt` | boolean | 退会类型： true:被踢退会，false:主动退会，可以不填

#### (async) leave(reason, kickoffOpt)

Description:
  - 退会
Source:
  - room/room.js, line 1863

##### Example

    room.leave(1).then(function(){}).otherwise(function(error){});

##### Parameters:

Name | Type | Description
--- | --- | ---
`reason` | int | 退会原因，可以填写 1
`kickoffOpt` | boolean | 退会类型： true:被踢退会，false:主动退会，可以不填

#### muteSpeaker()

Description:
  - 屏蔽会议声音
Source:
  - room/room.js, line 1782

#### muteSpeaker()

Description:
  - 屏蔽会议声音
Source:
  - room/room.js, line 1782

#### (async) sendPrivateData(dataBinary, userId)

Description:
  - 发送私有透明通道
Source:
  - room/room.js, line 1620

##### Example

    var dataArrayBuffer = typeConversionUtil.String2ArrayBuffer("This is an important piece of news.");
    room.sendPrivateData(dataArrayBuffer，'15').then(dataSendSuccess).otherwise(dataSendError);
    function dataSendSuccess(dataMsg) {
    }

##### Parameters:

Name | Type | Description
--- | --- | ---
`dataBinary` | Object | － ArrayBinary类型的内容 注： ArrayBinary : 二进制数据的原始缓冲区，该缓冲区用于存储各种类型化数组的数据
`userId` | String | 内容接受用户ID

#### (async) sendPrivateData(dataBinary, userId)

Description:
  - 发送私有透明通道
Source:
  - room/room.js, line 1620

##### Example

    var dataArrayBuffer = typeConversionUtil.String2ArrayBuffer("This is an important piece of news.");
    room.sendPrivateData(dataArrayBuffer，'15').then(dataSendSuccess).otherwise(dataSendError);
    function dataSendSuccess(dataMsg) {
    }

##### Parameters:

Name | Type | Description
--- | --- | ---
`dataBinary` | Object | － ArrayBinary类型的内容 注： ArrayBinary : 二进制数据的原始缓冲区，该缓冲区用于存储各种类型化数组的数据
`userId` | String | 内容接受用户ID

#### (async) sendPrivateDataToUser(dataBinary, userId)

Description:
  - 发送私有二进制数据。与room.sendPrivateData()的区别，本方法只需要知道对方的userId,内部实现时不用知道对方的nodeId,如一些特殊useAgent的用户，是取不到nodeId的。
Source:
  - room/room.js, line 1645

##### Example

    var dataArrayBuffer = typeConversionUtil.String2ArrayBuffer("This is an important piece of news.");
    room.sendPrivateDataToUser(dataArrayBuffer，'15').then(dataSendSuccess).otherwise(dataSendError);
    function dataSendSuccess(dataMsg) {
    }

##### Parameters:

Name | Type | Description
--- | --- | ---
`dataBinary` | Object | ArrayBinary类型的内容 注： ArrayBinary : 二进制数据的原始缓冲区，该缓冲区用于存储各种类型化数组的数据
`userId` | String | 内容接受用户ID

#### (async) sendPrivateDataToUser(dataBinary, userId)

Description:
  - 发送私有二进制数据。与room.sendPrivateData()的区别，本方法只需要知道对方的userId,内部实现时不用知道对方的nodeId,如一些特殊useAgent的用户，是取不到nodeId的。
Source:
  - room/room.js, line 1645

##### Example

    var dataArrayBuffer = typeConversionUtil.String2ArrayBuffer("This is an important piece of news.");
    room.sendPrivateDataToUser(dataArrayBuffer，'15').then(dataSendSuccess).otherwise(dataSendError);
    function dataSendSuccess(dataMsg) {
    }

##### Parameters:

Name | Type | Description
--- | --- | ---
`dataBinary` | Object | ArrayBinary类型的内容 注： ArrayBinary : 二进制数据的原始缓冲区，该缓冲区用于存储各种类型化数组的数据
`userId` | String | 内容接受用户ID

#### (async) sendPrivateMessage(message, userId)

Description:
  - 发送私聊消息
Source:
  - room/room.js, line 1573

##### Example

    room.sendPrivateMessage("hello",'user03').then(function(){}).otherwise(function(error){});

##### Parameters:

Name | Type | Description
--- | --- | ---
`message` | String | 消息内容
`userId` | String | 消息接受用户ID

#### (async) sendPrivateMessage(message, userId)

Description:
  - 发送私聊消息
Source:
  - room/room.js, line 1573

##### Example

    room.sendPrivateMessage("hello",'user03').then(function(){}).otherwise(function(error){});

##### Parameters:

Name | Type | Description
--- | --- | ---
`message` | String | 消息内容
`userId` | String | 消息接受用户ID

#### sendPublicData(dataBinary)

Description:
  - 发送公有透明通道 @
Source:
  - room/room.js, line 1594

##### Example

    var dataArrayBuffer = typeConversionUtil.String2ArrayBuffer("This is an important piece of news.");
    room.sendPublicData(dataArrayBuffer).then(dataSendSuccess).otherwise(dataSendError);
    function dataSendSuccess(dataMsg) {
    }

##### Parameters:

Name | Type | Description
--- | --- | ---
`dataBinary` | Object | － ArrayBinary类型的内容 注： ArrayBinary : 二进制数据的原始缓冲区，该缓冲区用于存储各种类型化数组的数据

#### sendPublicData(dataBinary)

Description:
  - 发送公有透明通道 @
Source:
  - room/room.js, line 1594

##### Example

    var dataArrayBuffer = typeConversionUtil.String2ArrayBuffer("This is an important piece of news.");
    room.sendPublicData(dataArrayBuffer).then(dataSendSuccess).otherwise(dataSendError);
    function dataSendSuccess(dataMsg) {
    }

##### Parameters:

Name | Type | Description
--- | --- | ---
`dataBinary` | Object | － ArrayBinary类型的内容 注： ArrayBinary : 二进制数据的原始缓冲区，该缓冲区用于存储各种类型化数组的数据

#### (async) sendPublicMessage(message)

Description:
  - 发送公聊消息
Source:
  - room/room.js, line 1556

##### Example

    room.sendPublicMessage("hello").then(function(){}).otherwise(function(error){});

##### Parameters:

Name | Type | Description
--- | --- | ---
`message` | String | 消息内容

#### (async) sendPublicMessage(message)

Description:
  - 发送公聊消息
Source:
  - room/room.js, line 1556

##### Example

    room.sendPublicMessage("hello").then(function(){}).otherwise(function(error){});

##### Parameters:

Name | Type | Description
--- | --- | ---
`message` | String | 消息内容

#### (async) setCameraResolutionOrFrameRate(cameraId, resolution, frameRate, resolutionSetType-, aspectRatio-)

Description:
  - 设置摄像头分辨率或帧率
Source:
  - room/room.js, line 1693

##### Parameters:

Name | Type | Description
--- | --- | ---
`cameraId` | String | 摄摄像头ID
`resolution` | String | 分辨率枚举值,如
`frameRate` | int | 帧率
`resolutionSetType-` | Object | 分辨率设置类型,可不填写，null时默认为ResolutionSetType.exact
`aspectRatio-` | Number | 分辨率宽高比(1.7777777778, 1.3333333333),可不填写(null,0时浏览器自动处理)，16:9或4:3时会开启强制

#### (async) setCameraResolutionOrFrameRate(cameraId, resolution, frameRate, resolutionSetType-, aspectRatio-)

Description:
  - 设置摄像头分辨率或帧率
Source:
  - room/room.js, line 1693

##### Parameters:

Name | Type | Description
--- | --- | ---
`cameraId` | String | 摄摄像头ID
`resolution` | String | 分辨率枚举值,如
`frameRate` | int | 帧率
`resolutionSetType-` | Object | 分辨率设置类型,可不填写，null时默认为ResolutionSetType.exact
`aspectRatio-` | Number | 分辨率宽高比(1.7777777778, 1.3333333333),可不填写(null,0时浏览器自动处理)，16:9或4:3时会开启强制

#### (async) setCameraResolutionWHOrFrameRate(cameraId, resolutionWidth, resolutionHeight, frameRate, resolutionSetType-, aspectRatio-)

Description:
  - 设置摄像头分辨率或帧率
Source:
  - room/room.js, line 1737

##### Parameters:

Name | Type | Description
--- | --- | ---
`cameraId` | String | 摄摄像头ID
`resolutionWidth` | int | 分辨率宽
`resolutionHeight` | int | 分辨率高
`frameRate` | int | 帧率
`resolutionSetType-` | Object | 分辨率设置类型,可不填写，null时默认为ResolutionSetType.exact
`aspectRatio-` | Number | 分辨率宽高比(1.7777777778, 1.3333333333)，可不填写(null,0时浏览器自动处理)，16:9或4:3时会开启强制

#### (async) setCameraResolutionWHOrFrameRate(cameraId, resolutionWidth, resolutionHeight, frameRate, resolutionSetType-, aspectRatio-)

Description:
  - 设置摄像头分辨率或帧率
Source:
  - room/room.js, line 1737

##### Parameters:

Name | Type | Description
--- | --- | ---
`cameraId` | String | 摄摄像头ID
`resolutionWidth` | int | 分辨率宽
`resolutionHeight` | int | 分辨率高
`frameRate` | int | 帧率
`resolutionSetType-` | Object | 分辨率设置类型,可不填写，null时默认为ResolutionSetType.exact
`aspectRatio-` | Number | 分辨率宽高比(1.7777777778, 1.3333333333)，可不填写(null,0时浏览器自动处理)，16:9或4:3时会开启强制

#### setReconnectMaxTimes(count)

Description:
  - 设置信令重连最大次数,默认3次
Source:
  - room/room.js, line 312

##### Example

    room.setReconnectMaxTimes(5);

##### Parameters:

Name | Type | Description
--- | --- | ---
`count` | Int | 重连最大次数

#### setReconnectMaxTimes(count)

Description:
  - 设置信令重连最大次数,默认3次
Source:
  - room/room.js, line 312

##### Example

    room.setReconnectMaxTimes(5);

##### Parameters:

Name | Type | Description
--- | --- | ---
`count` | Int | 重连最大次数

#### setReconnectTimeout(timeout)

Description:
  - 设置信令重连最时时长,单元毫秒，默认15000毫秒
Source:
  - room/room.js, line 324

##### Example

    room.setReconnectTimeout(20000);

##### Parameters:

Name | Type | Description
--- | --- | ---
`timeout` | Int | 重连最时时长

#### setReconnectTimeout(timeout)

Description:
  - 设置信令重连最时时长,单元毫秒，默认15000毫秒
Source:
  - room/room.js, line 324

##### Example

    room.setReconnectTimeout(20000);

##### Parameters:

Name | Type | Description
--- | --- | ---
`timeout` | Int | 重连最时时长

#### setRejoinInterval(rejoinInterval)

Description:
  - 设置二次重新加会之间间隔的时长
Source:
  - room/room.js, line 2850

##### Parameters:

Name | Type | Description
--- | --- | ---
`rejoinInterval` | Number | 单位ms，默认3000（3秒）

#### setRejoinInterval(rejoinInterval)

Description:
  - 设置二次重新加会之间间隔的时长
Source:
  - room/room.js, line 2850

##### Parameters:

Name | Type | Description
--- | --- | ---
`rejoinInterval` | Number | 单位ms，默认3000（3秒）

#### setRejoinTimeout(rejoinTimeout)

Description:
  - 设置重新加会的超时时间
Source:
  - room/room.js, line 2836

##### Parameters:

Name | Type | Description
--- | --- | ---
`rejoinTimeout` | Number | 单位ms，默认60000（60秒），请传入大于60000的值

#### setRejoinTimeout(rejoinTimeout)

Description:
  - 设置重新加会的超时时间
Source:
  - room/room.js, line 2836

##### Parameters:

Name | Type | Description
--- | --- | ---
`rejoinTimeout` | Number | 单位ms，默认60000（60秒），请传入大于60000的值

#### setRoomControl(attributes)

Description:
  - 设置房间控制参数(参数为JSON格式字符串)
Source:
  - room/room.js, line 2315

##### Example

    var attributes = '{
    	     'record': 0,
    		 'mix_record' : 0,
    		 'avc_model': 0,
    		 'resolution': '640*480',
    		 'liver'': 0,
    		 'mixer_live: 0
     }";
     room.setRoomControl(attributes);

##### Parameters:

Name | Type | Description
--- | --- | ---
`attributes` | String | 房间控制参数（JSON格式字符串)

#### setRoomControl(attributes)

Description:
  - 设置房间控制参数(参数为JSON格式字符串)
Source:
  - room/room.js, line 2315

##### Example

    var attributes = '{
    	     'record': 0,
    		 'mix_record' : 0,
    		 'avc_model': 0,
    		 'resolution': '640*480',
    		 'liver'': 0,
    		 'mixer_live: 0
     }";
     room.setRoomControl(attributes);

##### Parameters:

Name | Type | Description
--- | --- | ---
`attributes` | String | 房间控制参数（JSON格式字符串)

#### (async) setSpeakerDevice(deviceId, audioElements)

Description:
  - 设置音频播放设备扬声器
Source:
  - room/room.js, line 2865

##### Parameters:

Name | Type | Description
--- | --- | ---
`deviceId` | Object | 扬声器设备ID
`audioElements` | Object | audio控件对象集，可以不填，不填时自动获取页面上的所有audio控件对象

#### (async) setSpeakerDevice(deviceId, audioElements)

Description:
  - 设置音频播放设备扬声器
Source:
  - room/room.js, line 2865

##### Parameters:

Name | Type | Description
--- | --- | ---
`deviceId` | Object | 扬声器设备ID
`audioElements` | Object | audio控件对象集，可以不填，不填时自动获取页面上的所有audio控件对象

#### (async) setSpeakerVolume(volume, audioElements)

Description:
  - 设置扬声器音量大小
Source:
  - room/room.js, line 2908

##### Parameters:

Name | Type | Description
--- | --- | ---
`volume` | int | 音量值，范围0-1，如0.5表示设置音量为50%。 注：该值只是应用层的设置值与物理设备的具体音量值无关
`audioElements` | Object | audio控件对象集，可以不填，不填时自动获取页面上的所有audio控件对象

#### (async) setSpeakerVolume(volume, audioElements)

Description:
  - 设置扬声器音量大小
Source:
  - room/room.js, line 2908

##### Parameters:

Name | Type | Description
--- | --- | ---
`volume` | int | 音量值，范围0-1，如0.5表示设置音量为50%。 注：该值只是应用层的设置值与物理设备的具体音量值无关
`audioElements` | Object | audio控件对象集，可以不填，不填时自动获取页面上的所有audio控件对象

#### setUserAgent(userAgent)

Description:
  - 设置当前登陆用户的userAgent属性，默认为USER_AGENT_AVD_DEFAULT
Source:
  - room/room.js, line 300

##### Example

    room.setUserAgent(USER_AGENT_AVD_MEDIA_MIXER_ADMIN);

##### Parameters:

Name | Type | Description
--- | --- | ---
`userAgent` | String |

#### setUserAgent(userAgent)

Description:
  - 设置当前登陆用户的userAgent属性，默认为USER_AGENT_AVD_DEFAULT
Source:
  - room/room.js, line 300

##### Example

    room.setUserAgent(USER_AGENT_AVD_MEDIA_MIXER_ADMIN);

##### Parameters:

Name | Type | Description
--- | --- | ---
`userAgent` | String |

#### unmuteSpeaker()

Description:
  - 取消屏蔽会议声音
Source:
  - room/room.js, line 1801

#### unmuteSpeaker()

Description:
  - 取消屏蔽会议声音
Source:
  - room/room.js, line 1801

#### updateAppData(key, value)

Description:
  - 更新房间应用扩展字段
Source:
  - room/room.js, line 1664

##### Parameters:

Name | Type | Description
--- | --- | ---
`key` | String | － key值
`value` | String | － value值

#### updateAppData(key, value)

Description:
  - 更新房间应用扩展字段
Source:
  - room/room.js, line 1664

##### Parameters:

Name | Type | Description
--- | --- | ---
`key` | String | － key值
`value` | String | － value值

#### updateRoomStatus(roomStatus)

Description:
  - 修改会议房间状态
Source:
  - room/room.js, line 1173

##### Parameters:

Name | Type | Description
--- | --- | ---
`roomStatus` | Enum | 房间状态枚举

#### updateRoomStatus(roomStatus)

Description:
  - 修改会议房间状态
Source:
  - room/room.js, line 1173

##### Parameters:

Name | Type | Description
--- | --- | ---
`roomStatus` | Enum | 房间状态枚举

## Room

#### new Room()

Description:
  - 房间Room构造函数。
Source:
  - room/room.js, line 12

##### Example

    var room = new Room(roomId);

### Members

#### cleanupBoardByReJoinConnected

Description:
  - 重新加会成功后，应用层需要清理白板的标识，true代表要清理。 原因是服务器版本3.1.8开始，当客户端重新加会成功后，会重新下发所有之前白板相关信息包括批注，所以应用层需要先删除掉原来的白板相关界面内容，否则会重复渲染，可能会存在错位。
Source:
  - room/room.js, line 164

重新加会成功后，应用层需要清理白板的标识，true代表要清理。 原因是服务器版本3.1.8开始，当客户端重新加会成功后，会重新下发所有之前白板相关信息包括批注，所以应用层需要先删除掉原来的白板相关界面内容，否则会重复渲染，可能会存在错位。

#### cleanupBoardByReJoinConnected

Description:
  - 重新加会成功后，应用层需要清理白板的标识，true代表要清理。 原因是服务器版本3.1.8开始，当客户端重新加会成功后，会重新下发所有之前白板相关信息包括批注，所以应用层需要先删除掉原来的白板相关界面内容，否则会重复渲染，可能会存在错位。
Source:
  - room/room.js, line 164

重新加会成功后，应用层需要清理白板的标识，true代表要清理。 原因是服务器版本3.1.8开始，当客户端重新加会成功后，会重新下发所有之前白板相关信息包括批注，所以应用层需要先删除掉原来的白板相关界面内容，否则会重复渲染，可能会存在错位。

### Methods

#### addCallback(type, callback)

Description:
  - 房间级别的回调
Source:
  - room/room.js, line 2286

##### Example

    room.addCallback(RoomCallback.connection_status, onConnectionStatus);
    room.addCallback(RoomCallback.connection_indicator,onConnectionIndicator);
    room.addCallback(RoomCallback.room_status_notify, onRoomStatusNotify);

    room.addCallback(RoomCallback.user_join_notify, onUserJoinNotify);
    room.addCallback(RoomCallback.user_leave_notify, onUserLeaveNotify);
    room.addCallback(RoomCallback.leave_indication, onLeaveIndication);
    room.addCallback(RoomCallback.close_room_result, onCloseRoomResult);
    room.addCallback(RoomCallback.close_room_notify, onCloseRoomNotify);
    room.addCallback(RoomCallback.app_data_notify, onAppdataNotify);
    room.addCallback(RoomCallback.user_data_notify, onUserDataNotify);
    room.addCallback(RoomCallback.user_name_notify, onUserNameNotify);

    room.addCallback(RoomCallback.public_message, onPublicMessage);
    room.addCallback(RoomCallback.private_message, onPrivateMessage);
    room.addCallback(RoomCallback.public_data, onPublicData);
    room.addCallback(RoomCallback.private_data, onPrivateData);

    room.addCallback(RoomCallback.screen_sharing_ended, onScreenSharingEnded);

    room.addCallback(RoomCallback.outgoing_invite_status_notify, onOutgoingInviteStatusNotify);
    room.addCallback(RoomCallback.room_control_change_notify, onRoomControlChangeNotify);

    与服务器连接状态回调
    param:status - 连接状态

    function onConnectionStatus(status) {
       if (status == ConnectionStatus.connecting) {
    	       //TODO 与服务器重连中
       } else if (status == ConnectionStatus.connected) {
    	       //TODO 与服务器重连成功
       } else if (status == ConnectionStatus.connectFailed) {
    	      //TODO 与服务器重连失败,需要重新登陆
      }
     }

    与服务器连接指示器回调
    param: connectionIndicator - 连接指示器

    function onConnectionIndicator(connectionIndicator){
               if（connectionIndicator）{
    	              var roomConnection = connectionIndicator.getRoomConnection();

                   //房间级别
                   roomConnection.localAddress   本地地址
                   roomConnection.localPort      本地端口
                   roomConnection.localProtocol  本地协议
                   roomConnection.remoteAddress  远端地址
                   roomConnection.remotePort     远端端口
                   roomConnection.remoteProtocol  远端协议

                   roomConnection.downloadBitrate  下载流量
                   roomConnection.uploadBitrate    上传流量

                   roomConnection.downloadPacket  下载数据包
                   roomConnection.uploadPacket    上传数据包
                   roomConnection.downloadPacketLost  下载数据包丢包数
                   roomConnection.uploadPacketLost   上传数据包丢包数

                   roomConnection.downloadPacketLostRate  下载数据包丢包率
                   roomConnection.uploadPacketLostRate   上传数据包丢包率

                   roomConnection.currentRoundTripTime   当前的往返时间(RTT)
                   roomConnection.totalRoundTripTime     累计的往返时间(RTT)

                   //某路音频相关
                   var audioConnection = connectionIndicator.getAudioConnection(userId);
                   audioConnection.downloadBitrate   音频下载流量
                   audioConnection.uploadBitrate     音频上传流量

                   audioConnection.downloadPacket   音频下载数据包
                   audioConnection.uploadPacket     音频上传数据包

                   audioConnection.packetsLost     音频数据包丢包数
                   audioConnection.packetLostRate  音频数据包丢包率

                   audioConnection.ssrc
                   audioConnection.trackId
                   audioConnection.payloadType
                   audioConnection.mimeType
                   audioConnection.clockRate

                   //某路视频相关
                   videoConnection = connectionIndicator.getVideoConnection(userId, cameraId);
                   videoConnection.downloadBitrate   视频下载流量
                   videoConnection.uploadBitrate     视频上传流量

                   videoConnection.downloadPacket    视频下载数据包
                   videoConnection.uploadPacket     视频传数据包

                   videoConnection.packetsLost     视频数据包丢包数
                   videoConnection.packetLostRate  视频数据包丢包率

                   videoConnection.resolution     分辨率
                   videoConnection.frameRate      帧率

                   videoConnection.qpSum           媒体数据包的总量化值(qpSum
                   videoConnection.framesEncoded   已编码帧的数量
                   videoConnection.framesDecoded   已解码帧的数量
                   videoConnection.perFrameQP      每个视频帧的平均量化值(perFrameQP)

                   videoConnection.ssrc
                   videoConnection.trackId
                   videoConnection.payloadType
                   videoConnection.mimeType
                   videoConnection.clockRate

    *              //某路桌面共享相关
                   screenConnection = connectionIndicator.getScreenConnection(userId);
                   screenConnection.downloadBitrate   桌面共享下载流量
                   screenConnection.uploadBitrate     桌面共享上传流量

                   screenConnection.downloadPacket    桌面共享下载数据包
                   screenConnection.uploadPacket     桌面共享传数据包

                   screenConnection.packetsLost      桌面共享数据包丢包数
                   screenConnection.packetLostRate   桌面共享数据包丢包率

                   screenConnection.resolution        分辨率
                   screenConnection.frameRate         帧率
                   screenConnection.ssrc
                   screenConnection.trackId
                   screenConnection.payloadType
                   screenConnection.mimeType
                   screenConnection.clockRate
              }
    }

    参会者加会回调
    param :users － 参会者数组

    function onUserJoinNotify(users) {

    }

    参会者退会回调
    param:opt - 退会类型
    param:reason  - 退会原因
    param:user - 退会用户

    function onUserLeaveNotify(opt,reason,user) {

    }

    被踢出会议室
    param:reason - 被踢原因
    param:userId - 踢人的操作者

    function onLeaveIndication(reason,userId) {

    }

    房间应用扩展字段回调
    param {Object} key － key值
    param {Object} value － value值
    function onAppdataNotify(key, value) {

    }

    用户扩展内容更新回调
    param:userData - 用户扩展内容
    param:userId - 用户id

    function onUserDataNotify(userData, userId ) {

    }

    用户修改名字回调
    param {String} userName - 用户新名字
    param {String} userId - 用户id

    function onUserNameNotify(userName, userId){

    }

    公聊回调
    param : Message

    function onPublicMessage(Message) {

    }

    私聊回调
    param: Message

    function onPrivateMessage(Message) {

    }

    公有透明通道回调
    param:dataArrayBuffer － DataArrayBuffer对象
    param:userId － user id

    function onPublicData(dataArrayBuffer, userId) {

    }

    私有透明通道回调
    param:dataArrayBuffer － DataArrayBuffer对象
    param:userId － user id

    function onPrivateData(dataArrayBuffer, userId) {

    }

    桌面共享关闭的回调
    function onScreenSharingEnded(){

    }

    外部设备邀请状态回调
    param:type － OutgoingInviteType枚举值
    param:roomId － 房间ID
    param:addr － 设备地址
    param:status － 邀请状态码
    param:msg － 邀请返回状态

    function onOutgoingInviteStatusNotify(type,roomId,addr,status,msg){

    }

    房间参数设置回调
    param:roomControl － 参数对象
    function onRoomControlChangeNotify(roomControl){

    }

##### Parameters:

Name | Type | Description
--- | --- | ---
`type` | RoomCallback | 回调枚举标识
`callback` | Object | 回调方法名,可以自定义，建议保持默认值

#### addCallback(type, callback)

Description:
  - 房间级别的回调
Source:
  - room/room.js, line 2286

##### Example

    room.addCallback(RoomCallback.connection_status, onConnectionStatus);
    room.addCallback(RoomCallback.connection_indicator,onConnectionIndicator);
    room.addCallback(RoomCallback.room_status_notify, onRoomStatusNotify);

    room.addCallback(RoomCallback.user_join_notify, onUserJoinNotify);
    room.addCallback(RoomCallback.user_leave_notify, onUserLeaveNotify);
    room.addCallback(RoomCallback.leave_indication, onLeaveIndication);
    room.addCallback(RoomCallback.close_room_result, onCloseRoomResult);
    room.addCallback(RoomCallback.close_room_notify, onCloseRoomNotify);
    room.addCallback(RoomCallback.app_data_notify, onAppdataNotify);
    room.addCallback(RoomCallback.user_data_notify, onUserDataNotify);
    room.addCallback(RoomCallback.user_name_notify, onUserNameNotify);

    room.addCallback(RoomCallback.public_message, onPublicMessage);
    room.addCallback(RoomCallback.private_message, onPrivateMessage);
    room.addCallback(RoomCallback.public_data, onPublicData);
    room.addCallback(RoomCallback.private_data, onPrivateData);

    room.addCallback(RoomCallback.screen_sharing_ended, onScreenSharingEnded);

    room.addCallback(RoomCallback.outgoing_invite_status_notify, onOutgoingInviteStatusNotify);
    room.addCallback(RoomCallback.room_control_change_notify, onRoomControlChangeNotify);

    与服务器连接状态回调
    param:status - 连接状态

    function onConnectionStatus(status) {
       if (status == ConnectionStatus.connecting) {
    	       //TODO 与服务器重连中
       } else if (status == ConnectionStatus.connected) {
    	       //TODO 与服务器重连成功
       } else if (status == ConnectionStatus.connectFailed) {
    	      //TODO 与服务器重连失败,需要重新登陆
      }
     }

    与服务器连接指示器回调
    param: connectionIndicator - 连接指示器

    function onConnectionIndicator(connectionIndicator){
               if（connectionIndicator）{
    	              var roomConnection = connectionIndicator.getRoomConnection();

                   //房间级别
                   roomConnection.localAddress   本地地址
                   roomConnection.localPort      本地端口
                   roomConnection.localProtocol  本地协议
                   roomConnection.remoteAddress  远端地址
                   roomConnection.remotePort     远端端口
                   roomConnection.remoteProtocol  远端协议

                   roomConnection.downloadBitrate  下载流量
                   roomConnection.uploadBitrate    上传流量

                   roomConnection.downloadPacket  下载数据包
                   roomConnection.uploadPacket    上传数据包
                   roomConnection.downloadPacketLost  下载数据包丢包数
                   roomConnection.uploadPacketLost   上传数据包丢包数

                   roomConnection.downloadPacketLostRate  下载数据包丢包率
                   roomConnection.uploadPacketLostRate   上传数据包丢包率

                   roomConnection.currentRoundTripTime   当前的往返时间(RTT)
                   roomConnection.totalRoundTripTime     累计的往返时间(RTT)

                   //某路音频相关
                   var audioConnection = connectionIndicator.getAudioConnection(userId);
                   audioConnection.downloadBitrate   音频下载流量
                   audioConnection.uploadBitrate     音频上传流量

                   audioConnection.downloadPacket   音频下载数据包
                   audioConnection.uploadPacket     音频上传数据包

                   audioConnection.packetsLost     音频数据包丢包数
                   audioConnection.packetLostRate  音频数据包丢包率

                   audioConnection.ssrc
                   audioConnection.trackId
                   audioConnection.payloadType
                   audioConnection.mimeType
                   audioConnection.clockRate

                   //某路视频相关
                   videoConnection = connectionIndicator.getVideoConnection(userId, cameraId);
                   videoConnection.downloadBitrate   视频下载流量
                   videoConnection.uploadBitrate     视频上传流量

                   videoConnection.downloadPacket    视频下载数据包
                   videoConnection.uploadPacket     视频传数据包

                   videoConnection.packetsLost     视频数据包丢包数
                   videoConnection.packetLostRate  视频数据包丢包率

                   videoConnection.resolution     分辨率
                   videoConnection.frameRate      帧率

                   videoConnection.qpSum           媒体数据包的总量化值(qpSum
                   videoConnection.framesEncoded   已编码帧的数量
                   videoConnection.framesDecoded   已解码帧的数量
                   videoConnection.perFrameQP      每个视频帧的平均量化值(perFrameQP)

                   videoConnection.ssrc
                   videoConnection.trackId
                   videoConnection.payloadType
                   videoConnection.mimeType
                   videoConnection.clockRate

    *              //某路桌面共享相关
                   screenConnection = connectionIndicator.getScreenConnection(userId);
                   screenConnection.downloadBitrate   桌面共享下载流量
                   screenConnection.uploadBitrate     桌面共享上传流量

                   screenConnection.downloadPacket    桌面共享下载数据包
                   screenConnection.uploadPacket     桌面共享传数据包

                   screenConnection.packetsLost      桌面共享数据包丢包数
                   screenConnection.packetLostRate   桌面共享数据包丢包率

                   screenConnection.resolution        分辨率
                   screenConnection.frameRate         帧率
                   screenConnection.ssrc
                   screenConnection.trackId
                   screenConnection.payloadType
                   screenConnection.mimeType
                   screenConnection.clockRate
              }
    }

    参会者加会回调
    param :users － 参会者数组

    function onUserJoinNotify(users) {

    }

    参会者退会回调
    param:opt - 退会类型
    param:reason  - 退会原因
    param:user - 退会用户

    function onUserLeaveNotify(opt,reason,user) {

    }

    被踢出会议室
    param:reason - 被踢原因
    param:userId - 踢人的操作者

    function onLeaveIndication(reason,userId) {

    }

    房间应用扩展字段回调
    param {Object} key － key值
    param {Object} value － value值
    function onAppdataNotify(key, value) {

    }

    用户扩展内容更新回调
    param:userData - 用户扩展内容
    param:userId - 用户id

    function onUserDataNotify(userData, userId ) {

    }

    用户修改名字回调
    param {String} userName - 用户新名字
    param {String} userId - 用户id

    function onUserNameNotify(userName, userId){

    }

    公聊回调
    param : Message

    function onPublicMessage(Message) {

    }

    私聊回调
    param: Message

    function onPrivateMessage(Message) {

    }

    公有透明通道回调
    param:dataArrayBuffer － DataArrayBuffer对象
    param:userId － user id

    function onPublicData(dataArrayBuffer, userId) {

    }

    私有透明通道回调
    param:dataArrayBuffer － DataArrayBuffer对象
    param:userId － user id

    function onPrivateData(dataArrayBuffer, userId) {

    }

    桌面共享关闭的回调
    function onScreenSharingEnded(){

    }

    外部设备邀请状态回调
    param:type － OutgoingInviteType枚举值
    param:roomId － 房间ID
    param:addr － 设备地址
    param:status － 邀请状态码
    param:msg － 邀请返回状态

    function onOutgoingInviteStatusNotify(type,roomId,addr,status,msg){

    }

    房间参数设置回调
    param:roomControl － 参数对象
    function onRoomControlChangeNotify(roomControl){

    }

##### Parameters:

Name | Type | Description
--- | --- | ---
`type` | RoomCallback | 回调枚举标识
`callback` | Object | 回调方法名,可以自定义，建议保持默认值

#### closeRoom(userId)

Description:
  - 关闭房间
Source:
  - room/room.js, line 1897

##### Parameters:

Name | Type | Description
--- | --- | ---
`userId` | String | 关闭房间的操作用户ID

#### closeRoom(userId)

Description:
  - 关闭房间
Source:
  - room/room.js, line 1897

##### Parameters:

Name | Type | Description
--- | --- | ---
`userId` | String | 关闭房间的操作用户ID

#### continuousReJoin()

Description:
  - 多次后重新加会超时后，开启持续永久重新加会
Source:
  - room/room.js, line 984

#### continuousReJoin()

Description:
  - 多次后重新加会超时后，开启持续永久重新加会
Source:
  - room/room.js, line 984

#### getAppData(key) → {String}

Description:
  - 获得房间应用扩展字段信息
Source:
  - room/room.js, line 1675

##### Parameters:

Name | Type | Description
--- | --- | ---
`key` | String | key值

##### Returns:

value- value值

Type
  String

#### getAppData(key) → {String}

Description:
  - 获得房间应用扩展字段信息
Source:
  - room/room.js, line 1675

##### Parameters:

Name | Type | Description
--- | --- | ---
`key` | String | key值

##### Returns:

value- value值

Type
  String

#### getBoardNumber(status) → {int}

Description:
  - 获取房间内当前白板数
Source:
  - room/room.js, line 1323

##### Example

    room.getBoardNumber(boardStatusEnum.open);

##### Parameters:

Name | Type | Description
--- | --- | ---
`status` | boardStatusEnum | 白板状态值, 可以不填，不填时包括boardStatusEnum.open和boardStatusEnum.close的

##### Returns:

boardNumber -白板数

Type
  int

#### getBoardNumber(status) → {int}

Description:
  - 获取房间内当前白板数
Source:
  - room/room.js, line 1323

##### Example

    room.getBoardNumber(boardStatusEnum.open);

##### Parameters:

Name | Type | Description
--- | --- | ---
`status` | boardStatusEnum | 白板状态值, 可以不填，不填时包括boardStatusEnum.open和boardStatusEnum.close的

##### Returns:

boardNumber -白板数

Type
  int

#### getMaxAttendee() → {Int}

Description:
  - 获取允许的最大参加会议人数
Source:
  - room/room.js, line 1134

##### Returns:

maxAttendee - 最大参加会议人数

Type
  Int

#### getMaxAttendee() → {Int}

Description:
  - 获取允许的最大参加会议人数
Source:
  - room/room.js, line 1134

##### Returns:

maxAttendee - 最大参加会议人数

Type
  Int

#### getMaxAudio() → {Int}

Description:
  - 获取允许的最大音频路数
Source:
  - room/room.js, line 1118

##### Returns:

maxAudio - 最大音频路数

Type
  Int

#### getMaxAudio() → {Int}

Description:
  - 获取允许的最大音频路数
Source:
  - room/room.js, line 1118

##### Returns:

maxAudio - 最大音频路数

Type
  Int

#### getMaxVideo() → {Int}

Description:
  - 获取允许的最大视频路数
Source:
  - room/room.js, line 1126

##### Returns:

maxVideo - 最大视频路数

Type
  Int

#### getMaxVideo() → {Int}

Description:
  - 获取允许的最大视频路数
Source:
  - room/room.js, line 1126

##### Returns:

maxVideo - 最大视频路数

Type
  Int

#### getOwnerId() → {String}

Description:
  - 获取会议建创者Id
Source:
  - room/room.js, line 1046

##### Returns:

ownerId - 会议建创者Id

Type
  String

#### getOwnerId() → {String}

Description:
  - 获取会议建创者Id
Source:
  - room/room.js, line 1046

##### Returns:

ownerId - 会议建创者Id

Type
  String

#### getParticipants() → {Object}

Description:
  - 返回参会者数组
Source:
  - room/room.js, line 1222

##### Returns:

participants -参会者数组

Type
  Object

#### getParticipants() → {Object}

Description:
  - 返回参会者数组
Source:
  - room/room.js, line 1222

##### Returns:

participants -参会者数组

Type
  Object

#### getParticipantsNumber() → {int}

Description:
  - 返回参会者人数
Source:
  - room/room.js, line 1231

##### Returns:

participantsNumber -参会者人数

Type
  int

#### getParticipantsNumber() → {int}

Description:
  - 返回参会者人数
Source:
  - room/room.js, line 1231

##### Returns:

participantsNumber -参会者人数

Type
  int

#### getPublishedCamera()

Description:
  - 获取房间中所有已发布的摄像头视频对象集
Source:
  - room/room.js, line 1432

#### getPublishedCamera()

Description:
  - 获取房间中所有已发布的摄像头视频对象集
Source:
  - room/room.js, line 1432

#### getPublishedCameraCount()

Description:
  - 获取房间中所有已发布的摄像头视频数量
Source:
  - room/room.js, line 1423

#### getPublishedCameraCount()

Description:
  - 获取房间中所有已发布的摄像头视频数量
Source:
  - room/room.js, line 1423

#### getPublishedScreen()

Description:
  - 获取房间中所有已发布的共享屏幕窗口视频对象集
Source:
  - room/room.js, line 1451

#### getPublishedScreen()

Description:
  - 获取房间中所有已发布的共享屏幕窗口视频对象集
Source:
  - room/room.js, line 1451

#### getPublishedScreenCount()

Description:
  - 获取房间中所有已发发布的共享屏幕窗口视频数量
Source:
  - room/room.js, line 1442

#### getPublishedScreenCount()

Description:
  - 获取房间中所有已发发布的共享屏幕窗口视频数量
Source:
  - room/room.js, line 1442

#### getRoomControl() → {Object}

Description:
  - 获取房间控制参数
Source:
  - room/room.js, line 2295

##### Returns:

- roomControl 房间控制参数

Type
  Object

#### getRoomControl() → {Object}

Description:
  - 获取房间控制参数
Source:
  - room/room.js, line 2295

##### Returns:

- roomControl 房间控制参数

Type
  Object

#### getRoomId() → {String}

Description:
  - 获取房间号
Source:
  - room/room.js, line 1028

##### Returns:

roomId - 房间号

Type
  String

#### getRoomId() → {String}

Description:
  - 获取房间号
Source:
  - room/room.js, line 1028

##### Returns:

roomId - 房间号

Type
  String

#### getRoomTopic() → {String}

Description:
  - 获取会议主题
Source:
  - room/room.js, line 1037

##### Returns:

topic - 会议主题

Type
  String

#### getRoomTopic() → {String}

Description:
  - 获取会议主题
Source:
  - room/room.js, line 1037

##### Returns:

topic - 会议主题

Type
  String

#### getRoomType(roomTypEnum) → {Boolean}

Description:
  - 会议类型判断
Source:
  - room/room.js, line 1074

##### Parameters:

Name | Type | Description
--- | --- | ---
`roomTypEnum` | Enum | 传入会议类型枚举

##### Returns:

true: 是枚举对应的会议类型,false:非枚举对应的会议类型

Type
  Boolean

#### getRoomType(roomTypEnum) → {Boolean}

Description:
  - 会议类型判断
Source:
  - room/room.js, line 1074

##### Parameters:

Name | Type | Description
--- | --- | ---
`roomTypEnum` | Enum | 传入会议类型枚举

##### Returns:

true: 是枚举对应的会议类型,false:非枚举对应的会议类型

Type
  Boolean

#### getSelfUser() → {user}

Description:
  - 返回自己对象
Source:
  - room/room.js, line 1204

##### Returns:

selfUser - 自己对象

Type
  user

#### getSelfUser() → {user}

Description:
  - 返回自己对象
Source:
  - room/room.js, line 1204

##### Returns:

selfUser - 自己对象

Type
  user

#### getSelfUserId() → {String}

Description:
  - 返回自己对象的Id
Source:
  - room/room.js, line 1213

##### Returns:

userId - 自己对象的Id

Type
  String

#### getSelfUserId() → {String}

Description:
  - 返回自己对象的Id
Source:
  - room/room.js, line 1213

##### Returns:

userId - 自己对象的Id

Type
  String

#### getUsableAudio() → {Int}

Description:
  - 获取音频路数的剩余可用数。

    逻辑：允许的最大音频路数 － 已发布的音频路数

    注：主要用于界面显示用，具体打开的限制提示时，会采用服务器端的返回号来处理

Source:
  - room/room.js, line 1160

##### Returns:

usableAudio - 剩余可用音频路数

Type
  Int

#### getUsableAudio() → {Int}

Description:
  - 获取音频路数的剩余可用数。

    逻辑：允许的最大音频路数 － 已发布的音频路数

    注：主要用于界面显示用，具体打开的限制提示时，会采用服务器端的返回号来处理

Source:
  - room/room.js, line 1160

##### Returns:

usableAudio - 剩余可用音频路数

Type
  Int

#### getUsableVideo() → {Int}

Description:
  - 获取视频路数的剩余可用数。

    逻辑：允许的最大视频路数 － 已发布的视频路数

    注：主要用于界面显示用，具体打开的限制提示时，会采用服务器端的返回号来处理

Source:
  - room/room.js, line 1145

##### Returns:

usableVideo - 剩余可用视频路数

Type
  Int

#### getUsableVideo() → {Int}

Description:
  - 获取视频路数的剩余可用数。

    逻辑：允许的最大视频路数 － 已发布的视频路数

    注：主要用于界面显示用，具体打开的限制提示时，会采用服务器端的返回号来处理

Source:
  - room/room.js, line 1145

##### Returns:

usableVideo - 剩余可用视频路数

Type
  Int

#### getUser(userId) → {Object}

Description:
  - 通过用户ID获取用户对象
Source:
  - room/room.js, line 1245

##### Parameters:

Name | Type | Description
--- | --- | ---
`userId` | String | 用户的Id

##### Returns:

user - 用户对象

Type
  Object

#### getUser(userId) → {Object}

Description:
  - 通过用户ID获取用户对象
Source:
  - room/room.js, line 1245

##### Parameters:

Name | Type | Description
--- | --- | ---
`userId` | String | 用户的Id

##### Returns:

user - 用户对象

Type
  Object

#### getUserByUserIdAndNodeId(userId) → {Object}

Description:
  - 通过用户ID获取用户对象
Source:
  - room/room.js, line 1262

##### Parameters:

Name | Type | Description
--- | --- | ---
`userId` | String | 用户的Id

##### Returns:

user - 用户对象

Type
  Object

#### getUserByUserIdAndNodeId(userId) → {Object}

Description:
  - 通过用户ID获取用户对象
Source:
  - room/room.js, line 1262

##### Parameters:

Name | Type | Description
--- | --- | ---
`userId` | String | 用户的Id

##### Returns:

user - 用户对象

Type
  Object

#### hasUser(userId)

Description:
  - 通过用户ID,判断用户对象是否存在。
Source:
  - room/room.js, line 1282

##### Parameters:

Name | Type | Description
--- | --- | ---
`userId` | String | 用户的Id

#### hasUser(userId)

Description:
  - 通过用户ID,判断用户对象是否存在。
Source:
  - room/room.js, line 1282

##### Parameters:

Name | Type | Description
--- | --- | ---
`userId` | String | 用户的Id

#### isMcu() → {Boolean}

Description:
  - 判断当前会议模式是否为MCU模式
Source:
  - room/room.js, line 1055

##### Returns:

isMcuRoomＭode - 是否为MCU模式. true: mcu模式;false:P2P模式

Type
  Boolean

#### isMcu() → {Boolean}

Description:
  - 判断当前会议模式是否为MCU模式
Source:
  - room/room.js, line 1055

##### Returns:

isMcuRoomＭode - 是否为MCU模式. true: mcu模式;false:P2P模式

Type
  Boolean

#### ismuteSpeaker() → {Boolean}

Description:
  - 获取屏蔽会议声音的当前状态
Source:
  - room/room.js, line 1820

##### Returns:

- 屏蔽会议声音的当前状态

Type
  Boolean

#### ismuteSpeaker() → {Boolean}

Description:
  - 获取屏蔽会议声音的当前状态
Source:
  - room/room.js, line 1820

##### Returns:

- 屏蔽会议声音的当前状态

Type
  Boolean

#### (async) join(userId, userName, userData, password)

Description:
  - 加会
Source:
  - room/room.js, line 457

##### Example

    room.join('user01','ds','','').then(function(){}).otherwise(function(error){});

##### Parameters:

Name | Type | Description
--- | --- | ---
`userId` | String | 用户的Id
`userName` | String | 用户名
`userData` | String | 用户扩展字段
`password` | String | 会议密码

#### (async) join(userId, userName, userData, password)

Description:
  - 加会
Source:
  - room/room.js, line 457

##### Example

    room.join('user01','ds','','').then(function(){}).otherwise(function(error){});

##### Parameters:

Name | Type | Description
--- | --- | ---
`userId` | String | 用户的Id
`userName` | String | 用户名
`userData` | String | 用户扩展字段
`password` | String | 会议密码

#### (async) joinEfficient(serverURI, accessToken, userId, userName, userData, password)

Description:
  - 高效加会,与room.join()接口的区别是不再需要另外调用avdEngine.init()
Source:
  - room/room.js, line 350

##### Example

    room.joinEfficient('avd.nice2meet.cn:9610','ZDgyNGU1MGU0ZGY2MTJlZWY3NjkwMjQ5NDY0YWE3MDkxZGJjNmRiZg==','user01','ds','','').then(function(){}).otherwise(function(error){});

##### Parameters:

Name | Type | Description
--- | --- | ---
`serverURI` | String | MCU服务器地址
`accessToken` | String | 访问令牌
`userId` | String | 用户的Id
`userName` | String | 用户名
`userData` | String | 用户扩展字段
`password` | String | 会议密码

#### (async) joinEfficient(serverURI, accessToken, userId, userName, userData, password)

Description:
  - 高效加会,与room.join()接口的区别是不再需要另外调用avdEngine.init()
Source:
  - room/room.js, line 350

##### Example

    room.joinEfficient('avd.nice2meet.cn:9610','ZDgyNGU1MGU0ZGY2MTJlZWY3NjkwMjQ5NDY0YWE3MDkxZGJjNmRiZg==','user01','ds','','').then(function(){}).otherwise(function(error){});

##### Parameters:

Name | Type | Description
--- | --- | ---
`serverURI` | String | MCU服务器地址
`accessToken` | String | 访问令牌
`userId` | String | 用户的Id
`userName` | String | 用户名
`userData` | String | 用户扩展字段
`password` | String | 会议密码

#### (async) joinWithOEM(userId, userName, userData, password)

Description:
  - OEM加会
Source:
  - room/room.js, line 571

##### Parameters:

Name | Type | Description
--- | --- | ---
`userId` | Object | 用户的Id
`userName` | Object | 用户名
`userData` | Object | 用户扩展字段
`password` | String | 会议密码

#### (async) joinWithOEM(userId, userName, userData, password)

Description:
  - OEM加会
Source:
  - room/room.js, line 571

##### Parameters:

Name | Type | Description
--- | --- | ---
`userId` | Object | 用户的Id
`userName` | Object | 用户名
`userData` | Object | 用户扩展字段
`password` | String | 会议密码

#### kickoffUser(reason, userId)

Description:
  - 踢人
Source:
  - room/room.js, line 1846

##### Parameters:

Name | Type | Description
--- | --- | ---
`reason` | int | 踢人原因，填写808，其它值也都会重置成808
`userId` | String | 被踢用户id

#### kickoffUser(reason, userId)

Description:
  - 踢人
Source:
  - room/room.js, line 1846

##### Parameters:

Name | Type | Description
--- | --- | ---
`reason` | int | 踢人原因，填写808，其它值也都会重置成808
`userId` | String | 被踢用户id

#### (async) leave(reason, kickoffOpt)

Description:
  - 退会
Source:
  - room/room.js, line 1863

##### Example

    room.leave(1).then(function(){}).otherwise(function(error){});

##### Parameters:

Name | Type | Description
--- | --- | ---
`reason` | int | 退会原因，可以填写 1
`kickoffOpt` | boolean | 退会类型： true:被踢退会，false:主动退会，可以不填

#### (async) leave(reason, kickoffOpt)

Description:
  - 退会
Source:
  - room/room.js, line 1863

##### Example

    room.leave(1).then(function(){}).otherwise(function(error){});

##### Parameters:

Name | Type | Description
--- | --- | ---
`reason` | int | 退会原因，可以填写 1
`kickoffOpt` | boolean | 退会类型： true:被踢退会，false:主动退会，可以不填

#### muteSpeaker()

Description:
  - 屏蔽会议声音
Source:
  - room/room.js, line 1782

#### muteSpeaker()

Description:
  - 屏蔽会议声音
Source:
  - room/room.js, line 1782

#### (async) sendPrivateData(dataBinary, userId)

Description:
  - 发送私有透明通道
Source:
  - room/room.js, line 1620

##### Example

    var dataArrayBuffer = typeConversionUtil.String2ArrayBuffer("This is an important piece of news.");
    room.sendPrivateData(dataArrayBuffer，'15').then(dataSendSuccess).otherwise(dataSendError);
    function dataSendSuccess(dataMsg) {
    }

##### Parameters:

Name | Type | Description
--- | --- | ---
`dataBinary` | Object | － ArrayBinary类型的内容 注： ArrayBinary : 二进制数据的原始缓冲区，该缓冲区用于存储各种类型化数组的数据
`userId` | String | 内容接受用户ID

#### (async) sendPrivateData(dataBinary, userId)

Description:
  - 发送私有透明通道
Source:
  - room/room.js, line 1620

##### Example

    var dataArrayBuffer = typeConversionUtil.String2ArrayBuffer("This is an important piece of news.");
    room.sendPrivateData(dataArrayBuffer，'15').then(dataSendSuccess).otherwise(dataSendError);
    function dataSendSuccess(dataMsg) {
    }

##### Parameters:

Name | Type | Description
--- | --- | ---
`dataBinary` | Object | － ArrayBinary类型的内容 注： ArrayBinary : 二进制数据的原始缓冲区，该缓冲区用于存储各种类型化数组的数据
`userId` | String | 内容接受用户ID

#### (async) sendPrivateDataToUser(dataBinary, userId)

Description:
  - 发送私有二进制数据。与room.sendPrivateData()的区别，本方法只需要知道对方的userId,内部实现时不用知道对方的nodeId,如一些特殊useAgent的用户，是取不到nodeId的。
Source:
  - room/room.js, line 1645

##### Example

    var dataArrayBuffer = typeConversionUtil.String2ArrayBuffer("This is an important piece of news.");
    room.sendPrivateDataToUser(dataArrayBuffer，'15').then(dataSendSuccess).otherwise(dataSendError);
    function dataSendSuccess(dataMsg) {
    }

##### Parameters:

Name | Type | Description
--- | --- | ---
`dataBinary` | Object | ArrayBinary类型的内容 注： ArrayBinary : 二进制数据的原始缓冲区，该缓冲区用于存储各种类型化数组的数据
`userId` | String | 内容接受用户ID

#### (async) sendPrivateDataToUser(dataBinary, userId)

Description:
  - 发送私有二进制数据。与room.sendPrivateData()的区别，本方法只需要知道对方的userId,内部实现时不用知道对方的nodeId,如一些特殊useAgent的用户，是取不到nodeId的。
Source:
  - room/room.js, line 1645

##### Example

    var dataArrayBuffer = typeConversionUtil.String2ArrayBuffer("This is an important piece of news.");
    room.sendPrivateDataToUser(dataArrayBuffer，'15').then(dataSendSuccess).otherwise(dataSendError);
    function dataSendSuccess(dataMsg) {
    }

##### Parameters:

Name | Type | Description
--- | --- | ---
`dataBinary` | Object | ArrayBinary类型的内容 注： ArrayBinary : 二进制数据的原始缓冲区，该缓冲区用于存储各种类型化数组的数据
`userId` | String | 内容接受用户ID

#### (async) sendPrivateMessage(message, userId)

Description:
  - 发送私聊消息
Source:
  - room/room.js, line 1573

##### Example

    room.sendPrivateMessage("hello",'user03').then(function(){}).otherwise(function(error){});

##### Parameters:

Name | Type | Description
--- | --- | ---
`message` | String | 消息内容
`userId` | String | 消息接受用户ID

#### (async) sendPrivateMessage(message, userId)

Description:
  - 发送私聊消息
Source:
  - room/room.js, line 1573

##### Example

    room.sendPrivateMessage("hello",'user03').then(function(){}).otherwise(function(error){});

##### Parameters:

Name | Type | Description
--- | --- | ---
`message` | String | 消息内容
`userId` | String | 消息接受用户ID

#### sendPublicData(dataBinary)

Description:
  - 发送公有透明通道 @
Source:
  - room/room.js, line 1594

##### Example

    var dataArrayBuffer = typeConversionUtil.String2ArrayBuffer("This is an important piece of news.");
    room.sendPublicData(dataArrayBuffer).then(dataSendSuccess).otherwise(dataSendError);
    function dataSendSuccess(dataMsg) {
    }

##### Parameters:

Name | Type | Description
--- | --- | ---
`dataBinary` | Object | － ArrayBinary类型的内容 注： ArrayBinary : 二进制数据的原始缓冲区，该缓冲区用于存储各种类型化数组的数据

#### sendPublicData(dataBinary)

Description:
  - 发送公有透明通道 @
Source:
  - room/room.js, line 1594

##### Example

    var dataArrayBuffer = typeConversionUtil.String2ArrayBuffer("This is an important piece of news.");
    room.sendPublicData(dataArrayBuffer).then(dataSendSuccess).otherwise(dataSendError);
    function dataSendSuccess(dataMsg) {
    }

##### Parameters:

Name | Type | Description
--- | --- | ---
`dataBinary` | Object | － ArrayBinary类型的内容 注： ArrayBinary : 二进制数据的原始缓冲区，该缓冲区用于存储各种类型化数组的数据

#### (async) sendPublicMessage(message)

Description:
  - 发送公聊消息
Source:
  - room/room.js, line 1556

##### Example

    room.sendPublicMessage("hello").then(function(){}).otherwise(function(error){});

##### Parameters:

Name | Type | Description
--- | --- | ---
`message` | String | 消息内容

#### (async) sendPublicMessage(message)

Description:
  - 发送公聊消息
Source:
  - room/room.js, line 1556

##### Example

    room.sendPublicMessage("hello").then(function(){}).otherwise(function(error){});

##### Parameters:

Name | Type | Description
--- | --- | ---
`message` | String | 消息内容

#### (async) setCameraResolutionOrFrameRate(cameraId, resolution, frameRate, resolutionSetType-, aspectRatio-)

Description:
  - 设置摄像头分辨率或帧率
Source:
  - room/room.js, line 1693

##### Parameters:

Name | Type | Description
--- | --- | ---
`cameraId` | String | 摄摄像头ID
`resolution` | String | 分辨率枚举值,如
`frameRate` | int | 帧率
`resolutionSetType-` | Object | 分辨率设置类型,可不填写，null时默认为ResolutionSetType.exact
`aspectRatio-` | Number | 分辨率宽高比(1.7777777778, 1.3333333333),可不填写(null,0时浏览器自动处理)，16:9或4:3时会开启强制

#### (async) setCameraResolutionOrFrameRate(cameraId, resolution, frameRate, resolutionSetType-, aspectRatio-)

Description:
  - 设置摄像头分辨率或帧率
Source:
  - room/room.js, line 1693

##### Parameters:

Name | Type | Description
--- | --- | ---
`cameraId` | String | 摄摄像头ID
`resolution` | String | 分辨率枚举值,如
`frameRate` | int | 帧率
`resolutionSetType-` | Object | 分辨率设置类型,可不填写，null时默认为ResolutionSetType.exact
`aspectRatio-` | Number | 分辨率宽高比(1.7777777778, 1.3333333333),可不填写(null,0时浏览器自动处理)，16:9或4:3时会开启强制

#### (async) setCameraResolutionWHOrFrameRate(cameraId, resolutionWidth, resolutionHeight, frameRate, resolutionSetType-, aspectRatio-)

Description:
  - 设置摄像头分辨率或帧率
Source:
  - room/room.js, line 1737

##### Parameters:

Name | Type | Description
--- | --- | ---
`cameraId` | String | 摄摄像头ID
`resolutionWidth` | int | 分辨率宽
`resolutionHeight` | int | 分辨率高
`frameRate` | int | 帧率
`resolutionSetType-` | Object | 分辨率设置类型,可不填写，null时默认为ResolutionSetType.exact
`aspectRatio-` | Number | 分辨率宽高比(1.7777777778, 1.3333333333)，可不填写(null,0时浏览器自动处理)，16:9或4:3时会开启强制

#### (async) setCameraResolutionWHOrFrameRate(cameraId, resolutionWidth, resolutionHeight, frameRate, resolutionSetType-, aspectRatio-)

Description:
  - 设置摄像头分辨率或帧率
Source:
  - room/room.js, line 1737

##### Parameters:

Name | Type | Description
--- | --- | ---
`cameraId` | String | 摄摄像头ID
`resolutionWidth` | int | 分辨率宽
`resolutionHeight` | int | 分辨率高
`frameRate` | int | 帧率
`resolutionSetType-` | Object | 分辨率设置类型,可不填写，null时默认为ResolutionSetType.exact
`aspectRatio-` | Number | 分辨率宽高比(1.7777777778, 1.3333333333)，可不填写(null,0时浏览器自动处理)，16:9或4:3时会开启强制

#### setReconnectMaxTimes(count)

Description:
  - 设置信令重连最大次数,默认3次
Source:
  - room/room.js, line 312

##### Example

    room.setReconnectMaxTimes(5);

##### Parameters:

Name | Type | Description
--- | --- | ---
`count` | Int | 重连最大次数

#### setReconnectMaxTimes(count)

Description:
  - 设置信令重连最大次数,默认3次
Source:
  - room/room.js, line 312

##### Example

    room.setReconnectMaxTimes(5);

##### Parameters:

Name | Type | Description
--- | --- | ---
`count` | Int | 重连最大次数

#### setReconnectTimeout(timeout)

Description:
  - 设置信令重连最时时长,单元毫秒，默认15000毫秒
Source:
  - room/room.js, line 324

##### Example

    room.setReconnectTimeout(20000);

##### Parameters:

Name | Type | Description
--- | --- | ---
`timeout` | Int | 重连最时时长

#### setReconnectTimeout(timeout)

Description:
  - 设置信令重连最时时长,单元毫秒，默认15000毫秒
Source:
  - room/room.js, line 324

##### Example

    room.setReconnectTimeout(20000);

##### Parameters:

Name | Type | Description
--- | --- | ---
`timeout` | Int | 重连最时时长

#### setRejoinInterval(rejoinInterval)

Description:
  - 设置二次重新加会之间间隔的时长
Source:
  - room/room.js, line 2850

##### Parameters:

Name | Type | Description
--- | --- | ---
`rejoinInterval` | Number | 单位ms，默认3000（3秒）

#### setRejoinInterval(rejoinInterval)

Description:
  - 设置二次重新加会之间间隔的时长
Source:
  - room/room.js, line 2850

##### Parameters:

Name | Type | Description
--- | --- | ---
`rejoinInterval` | Number | 单位ms，默认3000（3秒）

#### setRejoinTimeout(rejoinTimeout)

Description:
  - 设置重新加会的超时时间
Source:
  - room/room.js, line 2836

##### Parameters:

Name | Type | Description
--- | --- | ---
`rejoinTimeout` | Number | 单位ms，默认60000（60秒），请传入大于60000的值

#### setRejoinTimeout(rejoinTimeout)

Description:
  - 设置重新加会的超时时间
Source:
  - room/room.js, line 2836

##### Parameters:

Name | Type | Description
--- | --- | ---
`rejoinTimeout` | Number | 单位ms，默认60000（60秒），请传入大于60000的值

#### setRoomControl(attributes)

Description:
  - 设置房间控制参数(参数为JSON格式字符串)
Source:
  - room/room.js, line 2315

##### Example

    var attributes = '{
    	     'record': 0,
    		 'mix_record' : 0,
    		 'avc_model': 0,
    		 'resolution': '640*480',
    		 'liver'': 0,
    		 'mixer_live: 0
     }";
     room.setRoomControl(attributes);

##### Parameters:

Name | Type | Description
--- | --- | ---
`attributes` | String | 房间控制参数（JSON格式字符串)

#### setRoomControl(attributes)

Description:
  - 设置房间控制参数(参数为JSON格式字符串)
Source:
  - room/room.js, line 2315

##### Example

    var attributes = '{
    	     'record': 0,
    		 'mix_record' : 0,
    		 'avc_model': 0,
    		 'resolution': '640*480',
    		 'liver'': 0,
    		 'mixer_live: 0
     }";
     room.setRoomControl(attributes);

##### Parameters:

Name | Type | Description
--- | --- | ---
`attributes` | String | 房间控制参数（JSON格式字符串)

#### (async) setSpeakerDevice(deviceId, audioElements)

Description:
  - 设置音频播放设备扬声器
Source:
  - room/room.js, line 2865

##### Parameters:

Name | Type | Description
--- | --- | ---
`deviceId` | Object | 扬声器设备ID
`audioElements` | Object | audio控件对象集，可以不填，不填时自动获取页面上的所有audio控件对象

#### (async) setSpeakerDevice(deviceId, audioElements)

Description:
  - 设置音频播放设备扬声器
Source:
  - room/room.js, line 2865

##### Parameters:

Name | Type | Description
--- | --- | ---
`deviceId` | Object | 扬声器设备ID
`audioElements` | Object | audio控件对象集，可以不填，不填时自动获取页面上的所有audio控件对象

#### (async) setSpeakerVolume(volume, audioElements)

Description:
  - 设置扬声器音量大小
Source:
  - room/room.js, line 2908

##### Parameters:

Name | Type | Description
--- | --- | ---
`volume` | int | 音量值，范围0-1，如0.5表示设置音量为50%。 注：该值只是应用层的设置值与物理设备的具体音量值无关
`audioElements` | Object | audio控件对象集，可以不填，不填时自动获取页面上的所有audio控件对象

#### (async) setSpeakerVolume(volume, audioElements)

Description:
  - 设置扬声器音量大小
Source:
  - room/room.js, line 2908

##### Parameters:

Name | Type | Description
--- | --- | ---
`volume` | int | 音量值，范围0-1，如0.5表示设置音量为50%。 注：该值只是应用层的设置值与物理设备的具体音量值无关
`audioElements` | Object | audio控件对象集，可以不填，不填时自动获取页面上的所有audio控件对象

#### setUserAgent(userAgent)

Description:
  - 设置当前登陆用户的userAgent属性，默认为USER_AGENT_AVD_DEFAULT
Source:
  - room/room.js, line 300

##### Example

    room.setUserAgent(USER_AGENT_AVD_MEDIA_MIXER_ADMIN);

##### Parameters:

Name | Type | Description
--- | --- | ---
`userAgent` | String |

#### setUserAgent(userAgent)

Description:
  - 设置当前登陆用户的userAgent属性，默认为USER_AGENT_AVD_DEFAULT
Source:
  - room/room.js, line 300

##### Example

    room.setUserAgent(USER_AGENT_AVD_MEDIA_MIXER_ADMIN);

##### Parameters:

Name | Type | Description
--- | --- | ---
`userAgent` | String |

#### unmuteSpeaker()

Description:
  - 取消屏蔽会议声音
Source:
  - room/room.js, line 1801

#### unmuteSpeaker()

Description:
  - 取消屏蔽会议声音
Source:
  - room/room.js, line 1801

#### updateAppData(key, value)

Description:
  - 更新房间应用扩展字段
Source:
  - room/room.js, line 1664

##### Parameters:

Name | Type | Description
--- | --- | ---
`key` | String | － key值
`value` | String | － value值

#### updateAppData(key, value)

Description:
  - 更新房间应用扩展字段
Source:
  - room/room.js, line 1664

##### Parameters:

Name | Type | Description
--- | --- | ---
`key` | String | － key值
`value` | String | － value值

#### updateRoomStatus(roomStatus)

Description:
  - 修改会议房间状态
Source:
  - room/room.js, line 1173

##### Parameters:

Name | Type | Description
--- | --- | ---
`roomStatus` | Enum | 房间状态枚举

#### updateRoomStatus(roomStatus)

Description:
  - 修改会议房间状态
Source:
  - room/room.js, line 1173

##### Parameters:

Name | Type | Description
--- | --- | ---
`roomStatus` | Enum | 房间状态枚举