2.1.1 Media object
A media object represents an image, sound clip of video clip. Media objects are used as part of questions or answers, but also as drill icons, avatar, etc.
Typically, a media object will either contain the object itself in Base64-encoded binary format, or contain a URL as a reference to the object.
Example
{
"type": "image/png",
"url": "https://www.drillster.com/bin/attachment/d216edc7ff69e958e9622943d272d9cd27864a2b"
}
Fields
| Field | Type | Description |
|---|---|---|
typeoptional |
String | The content type of the file or object. Example values: image/png, audio/mp3, video/mpeg, application/pdf. |
datarequired if no url present |
Base64-encoded binary | The actual binary content of the object, represented as a Base64-encoded string. Example value: iVBORw0KGgoAAAANSUhEUgAAAEAAAABAC…Tz+ubMQAAAABJRU5ErkJggg== |
urlrequired if no data present |
String | A URL reference to an external media object. Example value: https://www.drillster.com/bin/attachment/d216edc7ff69e958e9622943d272d9cd27864a2b |
captionoptional |
2.1.1 MarkupText object | An optional (formatted) caption to accompany the media object. |
widthoptional |
Integer | The native width of the object, measured in pixels. Example value: 400 |
heightoptional |
Integer | The native height of the object, measured in pixels. Example value: 400 |
thumbnailoptional |
String | A URL reference to an optional thumbnail. A thumbnail is always an image, and has a fixed size of 64 × 64 pixels. |
thumbnailsoptional |
List of 2.1.1 Thumbnail objects | An optional list of thumbnail variants. These are all equivalent thumbnail images in various sizes. |
Last updated on