EMMessage.createVideoSendMessage constructor Null safety

EMMessage.createVideoSendMessage(
  1. {required String username,
  2. required String filePath,
  3. String? displayName,
  4. int duration = 0,
  5. int? fileSize,
  6. String? thumbnailLocalPath,
  7. double? width,
  8. double? height}
)

Creates a video message instance for sending.

Param username 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.

Return The message instance.

Implementation

EMMessage.createVideoSendMessage({
  required String username,
  required String filePath,
  String? displayName,
  int duration = 0,
  int? fileSize,
  String? thumbnailLocalPath,
  double? width,
  double? height,
}) : this.createSendMessage(
          to: username,
          body: EMVideoMessageBody(
            localPath: filePath,
            displayName: displayName,
            duration: duration,
            fileSize: fileSize,
            thumbnailLocalPath: thumbnailLocalPath,
            width: width,
            height: height,
          ));