跳转到内容
本站为社区维护的非官方中文翻译,与 Cloudflare, Inc. 无关联。本站不提供账户登录,请勿在任何非官方站点输入您的 Cloudflare 账户信息。官方文档:developers.cloudflare.com

Stream

最后更新 查看 MarkdownAgent 设置

The Stream component is used 47 times on 45 pages.

See all examples of pages that use Stream

Used 47 times.

Pages

Partials

导入

import { Stream } from "~/components";

用法

Chapters

Chapters

<Stream
	id="86f22d1f760b77cdc349f89b25b63c3e"
	title="Connect and secure from any network to anywhere"
	thumbnail="https://pub-d9bf66e086fb4b639107aa52105b49dd.r2.dev/Connect-and-secure-from-any-network-to-anywhere.jpg"
	chapters={{
		"Chapter 1": "30s",
		"Chapter 2": "1m30s",
		"Chapter 3": "3m15s",
		"Chapter 4": "3m25s",
		"Chapter 5": "3m35s",
	}}
/>

<Stream file="warp-1-basics" />

<Stream> 属性

id

必填

类型:string

Stream 视频的 ID。

title

必填

类型:string

Stream 视频的标题。

thumbnail

类型:string

时间戳(即 2.5s 或 1m35s)或图像的 URL。

chapters

类型:Record<string, string>

显示在视频下方作为卡片的可选章节。

expandChapters

类型:boolean

默认值:false

如果提供了 chapters,它会被传递给 Details 组件的 open 属性。

showMoreVideos

类型:boolean

默认值:true

是否在视频下方显示 "Watch more videos on our Developer Channel" 链接。

file

类型:string

如果提供了 file,则不能使用 id、title、 thumbnail 和 chapters 属性;这些属性会改为从 stream 内容集合 ↗中的 YAML 文件读取。

这篇文档对您有帮助吗?