updateLiveStreamTask method
Future<int>
updateLiveStreamTask(
- NERtcLiveStreamTaskInfo taskInfo,
- UpdateLiveTaskCallback? callback
更新修改房间推流任务。通话中有效。
taskInfo
直播任务信息
UpdateLiveTaskCallback 操作结果回调,方法调用成功才有回调
Implementation
Future<int> updateLiveStreamTask(NERtcLiveStreamTaskInfo taskInfo,
UpdateLiveTaskCallback? callback) async {
int serial = -1;
if (callback != null) {
serial = _onceEventHandler.addOnceCallback((args) {
callback(args['taskId'], args['errCode']);
});
}
List<Map<dynamic, dynamic>>? userTranscodingList =
taskInfo.layout?.userTranscodingList?.map((e) => e._toMap()).toList();
IntValue reply =
await _api.updateLiveStreamTask(AddOrUpdateLiveStreamTaskRequest()
..serial = serial
..taskId = taskInfo.taskId
..url = taskInfo.url
..serverRecordEnabled = taskInfo.serverRecordEnabled
..liveMode = taskInfo.liveMode
..layoutWidth = taskInfo.layout?.width
..layoutHeight = taskInfo.layout?.height
..layoutBackgroundColor = taskInfo.layout?.backgroundColor?.value
..layoutImageUrl = taskInfo.layout?.backgroundImg?.url
..layoutImageX = taskInfo.layout?.backgroundImg?.x
..layoutImageY = taskInfo.layout?.backgroundImg?.y
..layoutImageWidth = taskInfo.layout?.backgroundImg?.width
..layoutImageHeight = taskInfo.layout?.backgroundImg?.height
..layoutUserTranscodingList = userTranscodingList);
return reply.value ?? -1;
}