diff --git a/src/components/TemplateCard/index.css b/src/components/TemplateCard/index.css index 56025ec..9ff53e5 100644 --- a/src/components/TemplateCard/index.css +++ b/src/components/TemplateCard/index.css @@ -171,6 +171,13 @@ backface-visibility: hidden; } +/* 确保video的poster填满整个容器 */ +.single-video[poster] { + background-size: cover !important; + background-position: center !important; + background-repeat: no-repeat !important; +} + /* 视频样式 */ .full-video { width: 100%; diff --git a/src/components/TemplateCard/index.tsx b/src/components/TemplateCard/index.tsx index b5a05f0..68ef425 100644 --- a/src/components/TemplateCard/index.tsx +++ b/src/components/TemplateCard/index.tsx @@ -122,7 +122,7 @@ export default function TemplateCard({ template, onClick }: TemplateCardProps) { autoplay muted loop - objectFit='fill' + objectFit='cover' showPlayBtn={false} showCenterPlayBtn={false} showFullscreenBtn={false}