setLiveInfo static method

Future<TUIActionCallback> setLiveInfo(
  1. String roomId, {
  2. String? coverUrl,
  3. List<int>? categoryList,
  4. bool? isPublicVisible,
  5. int? activityStatus,
})

Implementation

static Future<TUIActionCallback> setLiveInfo(String roomId,
    {String? coverUrl,
    List<int>? categoryList,
    bool? isPublicVisible,
    int? activityStatus}) {
  String userData = Tools.generateUserData();
  Completer<TUIActionCallback> completer = Completer();
  _actionCallback2Future(userData, completer);
  TUILiveInfo liveInfo = TUILiveInfo();
  liveInfo.roomInfo.roomId = roomId;

  int flag = 0;
  if (coverUrl != null) {
    flag |= TUILiveModifyFlag.coverUrl.value();
    liveInfo.coverUrl = coverUrl;
  }
  if (categoryList != null) {
    flag |= TUILiveModifyFlag.category.value();
    liveInfo.categoryList = categoryList;
  }
  if (isPublicVisible != null) {
    flag |= TUILiveModifyFlag.publish.value();
    liveInfo.isPublicVisible = isPublicVisible;
  }
  if (activityStatus != null) {
    flag |= TUILiveModifyFlag.activityStatus.value();
    liveInfo.activityStatus = activityStatus;
  }
  _engineSDK.Dart_SetLiveInfo(
      _liveListFFIPointer!,
      Tools.string2PointerChar(json.encode(liveInfo.toJson())),
      flag,
      Tools.string2PointerChar(userData));
  return completer.future;
}