Skip to content

Commit 2349ea1

Browse files
docs: update video renderer api configuration across documentation (#3342)
docs: sync documentation with recent code changes - Synchronized `s2-data-config` and `video` tutorial API definitions to match `Renderer` configurations in code. - Added `videoConfig` explicitly with default values in both Chinese and English documentation. Co-authored-by: google-labs-jules[bot] <161369871+google-labs-jules[bot]@users.noreply.github.com> Co-authored-by: Alexzjt <9548248+Alexzjt@users.noreply.github.com>
1 parent 8e42aff commit 2349ea1

4 files changed

Lines changed: 6 additions & 4 deletions

File tree

‎s2-site/docs/api/general/s2-data-config.en.md‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,8 @@ Function description: Field metadata, configurable field alias and value formatt
125125
| prepareText | Perform asynchronous processing on the text before rendering | (value: SimpleData) => Promise<string> | | |
126126
| fallback | Fallback display for image loading failure | string | | |
127127
| timeout | | number | 10000 | |
128-
| config | | Partial<[ImageStyleProps](https://g.antv.antgroup.com/api/basic/image)> \| Partial<[HTMLVideoElement](https://developer.mozilla.org/en-US/docs/Web/API/HTMLVideoElement)>\| [HTMLStyleProps](https://g.antv.antgroup.com/api/basic/html) | | |
128+
| config | Configuration for image or video container | Partial<[ImageStyleProps](https://g.antv.antgroup.com/api/basic/image)> \| Partial<[RectStyleProps](https://g.antv.antgroup.com/api/basic/rect)> | | |
129+
| videoConfig | Video configuration, valid only when type is VIDEO | Partial<[HTMLVideoElement](https://developer.mozilla.org/en-US/docs/Web/API/HTMLVideoElement)> | `{ loop: true, autoplay: false, preload: 'auto', crossOrigin: true, controls: false, muted: true }` | |
129130

130131
### MiniChartData
131132

‎s2-site/docs/api/general/s2-data-config.zh.md‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,8 @@ const s2DataConfig = {
5959
| prepareText | 渲染前对文本进行异步处理 | (value: SimpleData) => Promise<string> | | |
6060
| fallback | 图片、视频加载失败的兜底展示 | string | | |
6161
| timeout | 图片、视频加载超时时间 | number | 10000 | |
62-
| config | 图片、视频的配置项 | Partial<[ImageStyleProps](https://g.antv.antgroup.com/api/basic/image)> \| Partial<[HTMLVideoElement](https://developer.mozilla.org/en-US/docs/Web/API/HTMLVideoElement)>\| [HTMLStyleProps](https://g.antv.antgroup.com/api/basic/html) | | |
62+
| config | 图片、视频容器的配置项 | Partial<[ImageStyleProps](https://g.antv.antgroup.com/api/basic/image)> \| Partial<[RectStyleProps](https://g.antv.antgroup.com/api/basic/rect)> | | |
63+
| videoConfig | 视频配置项,仅当 type 为 VIDEO 时生效 | Partial<[HTMLVideoElement](https://developer.mozilla.org/en-US/docs/Web/API/HTMLVideoElement)> | `{ loop: true, autoplay: false, preload: 'auto', crossOrigin: true, controls: false, muted: true }` | |
6364

6465
<embed src="@/common/custom/customTreeNode.zh.md"></embed>
6566
<embed src="@/common/view-meta.zh.md"></embed>

‎s2-site/docs/manual/advanced/cell-render/video.en.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ const s2DataConfig = {
2323
clickToPreview?: boolean, // Whether to enable click to preview
2424
prepareText?: (value: SimpleData) => Promise<string>, // Asynchronously process text before rendering
2525
config?: Partial<RectStyleProps>, // Video rectangle area configuration within the cell https://g.antv.antgroup.com/api/css/pattern#htmlvideoelement
26-
videoConfig?: Partial<HTMLVideoElement> // https://developer.mozilla.org/en-US/docs/Web/API/HTMLVideoElement
26+
videoConfig?: Partial<HTMLVideoElement> // https://developer.mozilla.org/en-US/docs/Web/API/HTMLVideoElement, default: { loop: true, autoplay: false, preload: 'auto', crossOrigin: true, controls: false, muted: true }
2727
}
2828
}
2929
}

‎s2-site/docs/manual/advanced/cell-render/video.zh.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ const s2DataConfig = {
2424
clickToPreview?: boolean, // 是否开启点击预览
2525
prepareText?: (value: SimpleData) => Promise<string>, // 渲染前对文本进行异步处理
2626
config?: Partial<RectStyleProps>, // 单元格内视频矩形区域配置 https://g.antv.antgroup.com/api/css/pattern#htmlvideoelement
27-
videoConfig?: Partial<HTMLVideoElement> // https://developer.mozilla.org/en-US/docs/Web/API/HTMLVideoElement
27+
videoConfig?: Partial<HTMLVideoElement> // https://developer.mozilla.org/en-US/docs/Web/API/HTMLVideoElement,默认值:{ loop: true, autoplay: false, preload: 'auto', crossOrigin: true, controls: false, muted: true }
2828
}
2929
}
3030
}

0 commit comments

Comments
 (0)