NIMMessage.videoEmptyMessage constructor

NIMMessage.videoEmptyMessage(
  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}
)

Implementation

factory NIMMessage.videoEmptyMessage(
    {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}) {
  var extension = filePath.split('.').last;

  var videoAttachment = NIMVideoAttachment(
      path: filePath,
      size: fileSize,
      duration: duration,
      width: width,
      height: height,
      base64: base64,
      displayName: displayName,
      extension: extension,
      nosScene: nosScene);

  return NIMMessage(
      messageDirection: NIMMessageDirection.outgoing,
      messageType: NIMMessageType.video,
      timestamp: new DateTime.now().millisecondsSinceEpoch,
      status: NIMMessageStatus.sending,
      sessionId: sessionId,
      sessionType: sessionType,
      messageAttachment: videoAttachment);
}