createVideoMessage static method

Future<NIMResult<NIMMessage>> createVideoMessage(
  1. {required String sessionId,
  2. required NIMSessionType sessionType,
  3. required String filePath,
  4. int? fileSize,
  5. String? base64,
  6. required int duration,
  7. required int width,
  8. required int height,
  9. required String displayName,
  10. NIMNosScene nosScene = NIMNosScenes.defaultIm}
)

创建视频消息 base64 字段为web端专用,web端filePath 可传空字符串

Implementation

static Future<NIMResult<NIMMessage>> createVideoMessage(
    {required String sessionId,
    required NIMSessionType sessionType,
    required String filePath,
    int? fileSize,
    String? base64,
    required int duration,
    required int width,
    required int height,
    required String displayName,
    NIMNosScene nosScene = NIMNosScenes.defaultIm}) async {
  var message = NIMMessage.videoEmptyMessage(
      sessionId: sessionId,
      sessionType: sessionType,
      filePath: filePath,
      fileSize: fileSize,
      duration: duration,
      base64: base64,
      width: width,
      height: height,
      displayName: displayName,
      nosScene: nosScene);
  return NimCore.instance.messageService._createMessage(message: message);
}