sendVideoMessage method
dynamic
sendVideoMessage(
- String videoPath,
- String caption,
- String replyMessageID,
- BuildContext context,
Implementation
sendVideoMessage(String videoPath, String caption, String replyMessageID,
BuildContext context) async {
var busyStatus = !profile.isGroupProfile.checkNull()
? await Mirrorfly.isBusyStatusEnabled()
: false;
if (!busyStatus.checkNull()) {
if (isReplying.value) {
replyMessageID = replyChatMessage.messageId;
}
isReplying(false);
if (context.mounted) {
if (Platform.isIOS) {
Helper.showLoading(
message: AppConstants.compressingVideo, buildContext: context);
}
}
return Mirrorfly.sendVideoMessage(
profile.jid!, videoPath, caption, replyMessageID)
.then((value) {
clearMessage();
if (Platform.isIOS) {
Helper.hideLoading(context: context);
}
ChatMessageModel chatMessageModel = sendMessageModelFromJson(value);
chatList.insert(0, chatMessageModel);
scrollToBottom();
return chatMessageModel;
});
} else {
//show busy status popup
messageObject = MessageObject(
toJid: profile.jid.toString(),
replyMessageId: (isReplying.value) ? replyChatMessage.messageId : Constants.emptyString,
messageType: Constants.mVideo,
file: videoPath,
caption: caption);
if (context.mounted) showBusyStatusAlert(disableBusyChatAndSend, context);
}
}