Thanks to visit codestin.com
Credit goes to github.com

Skip to content

[Website] Mimetype cannot be ommitted for Media object? #8

Description

@cagrimunyas

When adding media to adaptive card, documentation says mimetype can be ommitted for youtube videos. However while trying to use it via Bot framework it results the following error :
"Cannot write a null value for property 'mimeType'. Property requires a value. Path 'body[0].sources[0]'."

Code sample to render the card is:

AdaptiveCardParseResult result = AdaptiveCard.FromJson(obj.ToString());
return new Attachment
{
    ContentType = AdaptiveCard.ContentType,
    Content = JObject.FromObject(result.Card),
};

Card Sample İs as follows:

{
  "$schema": "http://adaptivecards.io/schemas/adaptive-card.json",
  "type": "AdaptiveCard",
  "version": "1.4",
  "fallbackText": "This card requires Media to be viewed. Ask your platform to update to Adaptive Cards v1.1 for this and more!",
  "body": [
    {
      "type": "Media",
      "poster": "{PNG url with anonymous access}",
      "sources": [
        {
          "url": "https://www.youtube.com/watch?v={YOUTUBE video reference here}"
        }
      ]
    }
  ]
}


Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Fields

No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions