ChatMessage.createVideoSendMessage constructor

  1. {required String targetId,
  2. required String filePath,
  3. String? displayName,
  4. int duration = 0,
  5. int? fileSize,
  6. String? thumbnailLocalPath,
  7. double? width,
  8. double? height,
  9. ChatType chatType = ChatType.Chat}

Creates a video message instance for sending.

Param targetId The ID of the message recipient.

  • For a one-to-one chat, it is the username of the peer user.
  • For a group chat, it is the group ID.
  • For a chat room, it is the chat room ID.

Param filePath The path of the video file.

Param displayName The video name.

Param duration The video duration in seconds.

Param fileSize The video file size in bytes.

Param thumbnailLocalPath The local path of the thumbnail, which is usually the first frame of video.

Param width The width of the video thumbnail, in pixels.

Param height The height of the video thumbnail, in pixels.

Param chatType The chat type, default is single chat, if it is group chat or chat room, see ChatType.

Return The message instance.


  required String targetId,
  required String filePath,
  String? displayName,
  int duration = 0,
  int? fileSize,
  String? thumbnailLocalPath,
  double? width,
  double? height,
  ChatType chatType = ChatType.Chat,
}) : this.createSendMessage(
          chatType: chatType,
          to: targetId,
          body: ChatVideoMessageBody(
            localPath: filePath,
            displayName: displayName,
            duration: duration,
            fileSize: fileSize,
            thumbnailLocalPath: thumbnailLocalPath,
            width: width,
            height: height,