Schema Explorer
Media
Displays a media player for audio or video content.
Introduced in version 1.1
| Property | Type | Required | Description | Version |
|---|---|---|---|---|
| type | "Media" |
Yes | Must be "Media". |
1.1 |
| sources | MediaSource[] |
Yes | Array of media sources to attempt to play. | 1.1 |
| poster | uri |
No | URL of an image to display before playing. Supports data URI in version 1.2+ | 1.1 |
| altText | string |
No | Alternate text describing the audio or video. | 1.1 |
Inherited properties
| Property | Type | Required | Description | Version |
|---|---|---|---|---|
| fallback | Element, FallbackOption |
No | Describes what to do when an unknown element is encountered or the requires of this or any children can’t be met. | 1.2 |
| height | BlockElementHeight |
No | Specifies the height of the element. | 1.1 |
| separator | boolean |
No | When true, draw a separating line at the top of the element. |
1.1 |
| spacing | Spacing |
No | Controls the amount of spacing between this element and the preceding element. | 1.1 |
| id | string |
No | A unique identifier associated with the item. | 1.1 |
| isVisible | boolean |
No, default: true |
If false, this item will be removed from the visual tree. |
1.2 |
| requires | Dictionary<string> |
No | A series of key/value pairs indicating features that the item requires with corresponding minimum version. When a feature is missing or of insufficient version, fallback is triggered. | 1.2 |
Example
{
"$schema": "http://adaptivecards.io/schemas/adaptive-card.json",
"type": "AdaptiveCard",
"version": "1.1",
"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": "https://adaptivecards.io/content/poster-video.png",
"sources": [
{
"mimeType": "video/mp4",
"url": "https://adaptivecardsblob.blob.core.windows.net/assets/AdaptiveCardsOverviewVideo.mp4"
}
]
}
]
}
Properties
sources
Array of media sources to attempt to play.
- Type:
MediaSource[] - Required: Yes
- Allowed values:
MediaSource
Example
{
"$schema": "http://adaptivecards.io/schemas/adaptive-card.json",
"type": "AdaptiveCard",
"version": "1.1",
"body": [
{
"type": "TextBlock",
"text": "Media supports **audio** and **video** content!",
"wrap": true
},
{
"type": "TextBlock",
"text": "Video",
"horizontalAlignment": "center",
"spacing": "medium",
"separator": true,
"size": "large"
},
{
"type": "Media",
"poster": "https://adaptivecards.io/content/poster-video.png",
"sources": [{
"mimeType": "video/mp4",
"url": "https://adaptivecardsblob.blob.core.windows.net/assets/AdaptiveCardsOverviewVideo.mp4"
}]
},
{
"type": "TextBlock",
"text": "Audio",
"horizontalAlignment": "center",
"separator": true,
"size": "large"
},
{
"type": "Media",
"poster": "https://adaptivecards.io/content/poster-audio.jpg",
"sources": [{
"mimeType": "audio/mpeg",
"url": "https://adaptivecardsblob.blob.core.windows.net/assets/AdaptiveCardsOverviewVideo.mp3"
}]
}
]
}
poster
URL of an image to display before playing. Supports data URI in version 1.2+
- Type:
uri - Required: No
altText
Alternate text describing the audio or video.
- Type:
string - Required: No
fallback
Describes what to do when an unknown element is encountered or the requires of this or any children can't be met.
- Type:
Element,FallbackOption - Version : 1.2
- Required: No
- Allowed values:
ActionSetColumnSetContainerFactSetImageImageSetInput.ChoiceSetInput.DateInput.NumberInput.TextInput.TimeInput.ToggleMediaRichTextBlockTextBlock"drop": Causes this element to be dropped immediately when unknown elements are encountered. The unknown element doesn't bubble up any higher.
height
Specifies the height of the element.
- Type:
BlockElementHeight - Required: No
- Allowed values:
"auto": The height of the container will be determined by the height of its contents."stretch": The container will stretch its height to the available remaining height of the parent container.
separator
When true, draw a separating line at the top of the element.
- Type:
boolean - Required: No
spacing
Controls the amount of spacing between this element and the preceding element.
- Type:
Spacing - Required: No
- Allowed values:
"default""none""small""medium""large""extraLarge""padding"
id
A unique identifier associated with the item.
- Type:
string - Required: No
isVisible
If false, this item will be removed from the visual tree.
- Type:
boolean - Version : 1.2
- Required: No, default:
true
requires
A series of key/value pairs indicating features that the item requires with corresponding minimum version. When a feature is missing or of insufficient version, fallback is triggered.
- Type:
Dictionary<string> - Version : 1.2
- Required: No
