音视频通话

房间和成员自定义属性

更新时间: 2024/06/20 14:30:12

功能介绍

支持增删改查房间自定义属性、房间内人员自定义属性

1.设置房间属性

  • 调用接口:
//即将设置的属性
var attrs = {"key1":"value1", "key2":"value2"};
//全部通知
var options = {"notifyAll":1};
CRVideo_SetMeetingAttrs(attrs, options, "");

  • 回调通知:
//设置会议属性结果
CRVideo_SetMeetingAttrsRslt.callback = function( err, cookie)
{
	if (err != 0)
  	{
    	//失败
  	}
	else
	{
		//成功
	}
}

相关API请参考:

相关结构定义请参考:

2.获取房间属性

  • 调用接口:

//获取的所有属性
CRVideo_GetMeetingAllAttrs("");
  • 回调通知:

CRVideo_GetMeetingAllAttrsSuccess.callback = function(attr, cookie)
{

}

CRVideo_GetMeetingAllAttrsFail.callback = function(sdkErr, cookie)
{

}

相关API请参考:

3.获取房间特定属性

  • 调用接口:

var keys = ["MeetingName", "startTime", "endTime"];
CRVideo_GetMeetingAttrs(keys, "");

  • 回调通知:

CRVideo_GetMeetingAllAttrsSuccess.callback = function(attr, cookie)
{

}

CRVideo_GetMeetingAllAttrsFail.callback = function(sdkErr, cookie)
{

}

相关API请参考:

4.添加或更新属性

  • 调用接口:

var meetingNameKey = "MeetingName";
var meetingNameVaue = "";
CRVideo_AddOrUpdateMeetingAttrs(meetingNameKey, meetingNameVaue, "");

  • 回调通知:

CRVideo_AddOrUpdateMeetingAttrsRslt.callback = function(sdkErr, cookie)
{
	if (sdkErr != 0)
  	{
    	//失败
  	}
	else
	{
		//成功
	}
}

相关API请参考:

5.删除房间特定属性

  • 调用接口:

var meetingName = "MeetingName";
CRVideo_DelMeetingAttrs(meetingName, "");

  • 回调通知:

CRVideo_DelMeetingAttrsRslt.callback = function(sdkErr, cookie)
{
	if (sdkErr != 0)
  	{
    	//失败
  	}
	else
	{
		//成功
	}
}

相关API请参考:

6.清除房间全部属性

  • 调用接口:

CRVideo_ClearMeetingAttrs("");

  • 回调通知:

CRVideo_ClearMeetingAttrsRslt.callback = function(sdkErr, cookie)
{
	if (sdkErr != 0)
  	{
    	//失败
  	}
	else
	{
		//成功
	}
}

相关API请参考:

7.设置成员属性

  • 调用接口:

var userID = "111";
var attrs = {"key1":"value1", "key2":"value2"};
CRVideo_SetUserAttrs(userID, attrs, "");

  • 回调通知:

CRVideo_SetUserAttrsRslt.callback = function(sdkErr, cookie)
{
	if (sdkErr != 0)
  	{
    	//失败
  	}
	else
	{
		//成功
	}
}

相关API请参考:

8.获取当前指定成员所有属性

  • 调用接口:

var userIDs = ["111", "222"];
CRVideo_GetUserAttrs(userIDs, "");

  • 回调通知:

CRVideo_GetUserAttrsSuccess.callback = function(attrsMap, cookie)
{

}

CRVideo_GetUserAttrsFail.callback = function(sdkErr, cookie)
{

}

相关API请参考:

9.获取当前指定成员指定属性

  • 调用接口:

var userIDs = ["111", "222"];
var keys = ["name", "companyName"];
CRVideo_GetUserAttrs(userIDs, keys, "");

  • 回调通知:

CRVideo_GetUserAttrsSuccess.callback = function(attrsMap, cookie)
{

}

CRVideo_GetUserAttrsFail.callback = function(sdkErr, cookie)
{

}


相关API请参考:

10.添加或更新指定成员指定的属性

  • 调用接口:

var userID = "111";
var attrs = {"key1":"value1", "key2":"value2"};
CRVideo_AddOrUpdateUserAttrs(userID, attrs, "");

  • 回调通知:

CRVideo_AddOrUpdateUserAttrsRslt.callback = function(sdkErr, cookie)
{
	if (sdkErr != 0)
  	{
    	//失败
  	}
	else
	{
		//成功
	}
}

相关API请参考:

11.删除指定成员的指定属性

  • 调用接口:

var userID = "111";
var keys = ["department", "companyName"];
CRVideo_DelUserAttrs(userID, keys, "");

  • 回调通知:

CRVideo_DelUserAttrsRslt.callback = function(sdkErr, cookie)
{
	if (sdkErr != 0)
  	{
    	//失败
  	}
	else
	{
		//成功
	}
}

相关API请参考:

12.清除当前指定成员全部属性

  • 调用接口:

var userID = "111";
CRVideo_ClearUserAttrs(userID);

  • 回调通知:

CRVideo_ClearUserAttrsRslt.callback = function(sdkErr, cookie)
{
	if (sdkErr != 0)
  	{
    	//失败
  	}
	else
	{
		//成功
	}
}

相关API请参考:

13.清除当前房间内所有成员全部属性

  • 调用接口:

CRVideo_ClearAllUserAttrs(“”);

  • 回调通知:

CRVideo_ClearAllUserAttrsRslt.callback = function(sdkErr, cookie)
{
	if (sdkErr != 0)
  	{
    	//失败
  	}
	else
	{
		//成功
	}
}

相关API请参考: