简体   繁体   中英

Gif images don't play in Microsoft Teams

I'm using the following code to display a gif image as an attachment in my reply:

    Activity replyToConversation = (Activity)context.MakeMessage();
    replyToConversation.Attachments = new List<Attachment>();
    replyToConversation.Attachments.Add(new Attachment()
    {
       ContentUrl = "http://i.giphy.com/p3BDz27c5RlIs.gif",
       ContentType = "image/gif"
    });

    await context.PostAsync(replyToConversation);
    context.Wait(MessageReceivedAsync);

In the Web Chat channel it displays (and play) as expected, but for some reason it displays as a static image in the Microsoft Teams channel.

Please, any ideas?

作为一种变通方法,您可以返回嵌套图像的HTML字符串

 await context.PostAsync($"<img src=\"{imageUrl}\" />");

Sorry, Bots in Teams currently don't support animated GIFs, inline or in cards. See the MSDN documentation for the subset of functionality currently supported

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM