Video Resource

Use the video resource to represent a video.

This resource can be modified by the seller with the video-chooser control.

Schema type

Use video to reference this resource in the template schema.

Resource schema

{
	"description": "Video resource value",
	"type": "object",
	"required": [
		"playbackUrls"
	],
	"playbackUrls": {
		"type": "array",
		"items": {
			"type": "object",
			"required": [
				"src",
				"type"
			],
			"src": {
				"type": "string",
				"description": "playback url",
				"examples": [
					"https://example.org/video.mp4",
					"https://example.org/video.m3u8",
					"https://example.org/video.mpd"
				]
			},
			"type": {
				"type": "string",
				"description": "mime type of video",
				"examples": [
					"video/mp4",
					"application/x-mpegURL",
					"application/dash+xml"
				]
			}
		}
	},
	"posterUrl": {
		"type": "string",
		"description": "url to an image that displays before the video starts playing",
		"examples": [
			"https://example.org/video-1280x720.jpeg"
		]
	},
	"thumbnailUrl": {
		"type": "string",
		"description": "url to a thumbnail image of the video",
		"examples": [
			"https://example.org/video-320x180.jpeg"
		]
	},
	"name": {
		"type": "string",
		"description": "name of video file",
		"examples": [
			"My Video",
		]
	},
	"id": {
		"type": "string",
		"description": "set by the video-chooser control to keep track of which video the seller choose from their library, please ignore"
	}
}

Example

{
	"id": "5829dc775c6f52c56e8c578307d359a2",
	"name": "My Video",
	"thumbnailUrl": "https://customer-lx182qzfxebc2x5c.cloudflarestream.com/5829dc775c6f52c56e8c578307d359a2/thumbnails/thumbnail.jpg?width=300",
	"posterUrl": "https://customer-lx182qzfxebc2x5c.cloudflarestream.com/5829dc775c6f52c56e8c578307d359a2/thumbnails/thumbnail.jpg?width=1200",
	"playbackUrls": [
		{
			"src": "https://customer-lx182qzfxebc2x5c.cloudflarestream.com/5829dc775c6f52c56e8c578307d359a2/manifest/video.m3u8",
			"type": "application/x-mpegURL"
		},
		{
			"src": "https://customer-lx182qzfxebc2x5c.cloudflarestream.com/5829dc775c6f52c56e8c578307d359a2/manifest/video.mpd",
			"type": "application/dash+xml"
		}
	]
}

Improved URL Handling

The thumbnailUrl, posterUrl, and playbackUrls of the Video resource are automatically processed based on the environment. The URLs are updated accordingly without appending the host for CDN.

See also