type VideoProvider = "bilibili" | "youtube"; type MdVideoProps = { provider: VideoProvider; /** bilibili 为 BV 号;youtube 为视频 ID(parseVideoLine 已校验) */ id: string; }; function embedUrl(provider: VideoProvider, id: string): string { if (provider === "bilibili") { return `https://player.bilibili.com/player.html?bvid=${encodeURIComponent( id )}&autoplay=0&danmaku=0&high_quality=1`; } return `https://www.youtube-nocookie.com/embed/${encodeURIComponent(id)}`; } /** * [bilibili]…[/bilibili] / [youtube]…[/youtube] 视频嵌入: * 16:9 容器 + 懒加载 iframe(bilibili 官方播放器 / youtube 隐私域名),纯静态无 JS。 */ export default function MdVideo({ provider, id }: MdVideoProps) { return (