EMMessage.createVideoSendMessage constructor

EMMessage.createVideoSendMessage(
  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}
)

创建一条待发送的视频消息。

Param targetId 消息接收方,可以是:

  • 用户:用户 ID;
  • 群组:群组 ID;
  • 聊天室:聊天室 ID。

Param filePath 视频文件路径。

Param displayName 文件名。

Param duration 视频时长,单位是秒。

Param fileSize 视频文件大小。

Param thumbnailLocalPath 缩略图的本地路径,一般取视频第一帧作为缩略图。

Param width 缩略图宽度,单位是像素。

Param height 缩略图高度,单位是像素。

Param chatType 聊天类型, 默认为单聊,如果是群聊或者聊天室,可以参考ChatType

Return 消息体实例。

Implementation

EMMessage.createVideoSendMessage({
  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: EMVideoMessageBody(
            localPath: filePath,
            displayName: displayName,
            duration: duration,
            fileSize: fileSize,
            thumbnailLocalPath: thumbnailLocalPath,
            width: width,
            height: height,
          ));