VideoFill
The object for adding a video background fill to a component.
Declaration
object VideoFillProperties
| Name | Type | Description |
|---|---|---|
stillURL Required | uri | The URL of the image file to use as a still image when the video is not playing. Image URLs can begin with Encode image filenames as |
URL Required | uri | The URL of a video file that you can play using AV Player. HTTP Live Streaming (HLS) is highly recommended (.M3U8). For more information about HLS, see HTTP Live Streaming. |
attachment | string | A string that indicates how the fill behaves when a person scrolls. Valid values:
|
fillMode | string | Indicates how Apple News displays the video fill. Valid values:
|
horizontalAlignment | string | Sets the horizontal alignment of the video fill within its component. Valid values:
You can use |
loop | boolean | When |
type Required | string | Describes the type of fill. Use |
verticalAlignment | string | Sets the vertical alignment of the video fill within its component. Valid values:
You can use |
Mentioned in
Discussion
Use the VideoFill object to fill a component’s background with a video that starts playing automatically with no audio. You can specify whether the video scrolls or stays in one place when a person scrolls, what happens when the video ends, and the position of the video within the component. You can also supply an image to display when the video isn’t playing.
You can use this object in ComponentStyle.
Example
{
"components": [
{
"role": "container",
"style": "exampleComponentStyle",
"layout": {
"ignoreDocumentMargin": true,
"minimumHeight": 150
},
"components": [
{
"role": "title",
"text": "Season Preview: Nobody Saw This Coming",
"anchor": {
"targetAnchorPosition": "center"
}
}
]
}
],
"componentStyles": {
"exampleComponentStyle": {
"fill": {
"type": "video",
"URL": "https://example.com/hls/2014/fded0-1077dae/main.m3u8",
"stillURL": "bundle://video-still.jpg",
"fillMode": "cover",
"verticalAlignment": "top"
}
}
}
}