This commit is contained in:
hrxiang
2022-11-25 17:03:50 +08:00
parent 099cb9849a
commit b8a51374a3
13 changed files with 89 additions and 9 deletions

View File

@@ -254,6 +254,9 @@ class IMManager {
info =
Utils.toObj(data, (map) => MeetingStreamEvent.fromJson(map));
break;
case 'onReceiveCustomSignal':
info = Utils.toObj(data, (map) => CustomSignaling.fromJson(map));
break;
default:
info = Utils.toObj(data, (map) => SignalingInfo.fromJson(map));
break;
@@ -292,6 +295,9 @@ class IMManager {
case 'onStreamChange':
signalingManager.listener.streamChangedEvent(info);
break;
case 'onReceiveCustomSignal':
signalingManager.listener.receiveCustomSignal(info);
break;
}
} else if (call.method == ListenerType.workMomentsListener) {
String type = call.arguments['type'];
@@ -332,6 +338,7 @@ class IMManager {
int logLevel = 6,
String objectStorage = 'cos',
String? encryptionKey,
bool enabledEncryption = false,
String? operationID,
}) {
this._connectListener = listener;
@@ -347,6 +354,7 @@ class IMManager {
"log_level": logLevel,
"object_storage": objectStorage,
"encryption_key": encryptionKey,
"is_need_encryption": enabledEncryption,
"operationID": Utils.checkOperationID(operationID),
},
));

View File

@@ -823,9 +823,9 @@ class MessageManager {
.invokeMethod(
'createImageMessageByURL',
_buildParam({
'sourcePicture': sourcePicture,
'bigPicture': bigPicture,
'snapshotPicture': snapshotPicture,
'sourcePicture': sourcePicture.toJson(),
'bigPicture': bigPicture.toJson(),
'snapshotPicture': snapshotPicture.toJson(),
"operationID": Utils.checkOperationID(operationID),
}),
)
@@ -840,7 +840,7 @@ class MessageManager {
.invokeMethod(
'createSoundMessageByURL',
_buildParam({
'soundElem': soundElem,
'soundElem': soundElem.toJson(),
"operationID": Utils.checkOperationID(operationID),
}),
)
@@ -855,7 +855,7 @@ class MessageManager {
.invokeMethod(
'createVideoMessageByURL',
_buildParam({
'videoElem': videoElem,
'videoElem': videoElem.toJson(),
"operationID": Utils.checkOperationID(operationID),
}))
.then((value) => Utils.toObj(value, (map) => Message.fromJson(map)));
@@ -869,7 +869,7 @@ class MessageManager {
.invokeMethod(
'createFileMessageByURL',
_buildParam({
'fileElem': fileElem,
'fileElem': fileElem.toJson(),
"operationID": Utils.checkOperationID(operationID),
}))
.then((value) => Utils.toObj(value, (map) => Message.fromJson(map)));

View File

@@ -281,6 +281,22 @@ class SignalingManager {
'operationID': Utils.checkOperationID(operationID),
}));
/// 自定义信令
/// [roomID] 会议ID
/// [customInfo] 自定义信令
Future<dynamic> signalingSendCustomSignal({
required String roomID,
required String customInfo,
String? operationID,
}) =>
_channel.invokeMethod(
'signalingSendCustomSignal',
_buildParam({
'roomID': roomID,
'customInfo': customInfo,
'operationID': Utils.checkOperationID(operationID),
}));
static Map _buildParam(Map param) {
param["ManagerName"] = "signalingManager";
return param;