the problem is this, I’m trying to send videos and photos with one media group, but on the desktop and web versions it looks almost normal, and on the mobile version it sends two messages all the time, but if the video weighs less than 10 MB then everything is sent in one message, I used the TDLib(NuGet) and WTelegram libraries
here are examples of codes from different libraries
TDLib
private static async Task SendMediaGroup(long chatId, string photoPath, string videoPath)
{
var inputMessages = new TdApi.InputMessageContent[]
{
new TdApi.InputMessageContent.InputMessagePhoto
{
Photo = new TdApi.InputFile.InputFileLocal { Path = photoPath },
},
new TdApi.InputMessageContent.InputMessageVideo
{
Video = new TdApi.InputFile.InputFileLocal { Path = videoPath },
}
};
var result = await _client.ExecuteAsync(new TdApi.SendMessageAlbum
{
ChatId = chatId,
InputMessageContents = inputMessages,
});
}
WTelegram
var inputMediaVideo = new InputMediaUploadedDocument
{
file = uploadedVideo,
mime_type = "video/mp4",
attributes = new[]
{
new DocumentAttributeVideo
{
duration = 0,
w = 1280,
h = 720
}
}
};
var inputMediaPhoto = new InputMediaUploadedPhoto
{
file = uploadedPhoto
};
var mMediaPhoto = client.Messages_UploadFile(inputPeet,inputMediaPhoto);
var mMediaVideo = client.Messages_UploadFile(inputPeet,inputMediaVideo);
var inputMediaList = new InputSingleMedia[]
{
new InputSingleMedia
{
media = mMediaPhoto.ToInputMedia(),
message = caption,
random_id = Helpers.RandomLong()
},
new InputSingleMedia
{
media = mMediaVideo.ToInputMedia(),
random_id = Helpers.RandomLong()
}
};
var updates = await client.Messages_SendMultiMedia(inputPeer, inputMediaList);
New contributor
Vova Shirokov is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.