forked from 77media/video-flow
控制最大高度
This commit is contained in:
parent
761beb799d
commit
c84599096d
@ -102,14 +102,14 @@ export function H5MediaViewer({
|
||||
/** 视频轮播容器高度:按 aspectRatio 计算(基于视口宽度) */
|
||||
const videoWrapperHeight = useMemo(() => {
|
||||
const { w, h } = parseAspect(aspectRatio);
|
||||
return `calc(100vw * ${h} / ${w})`;
|
||||
return `min(calc(100vw * ${h} / ${w}), calc(100vh - 8.5rem))`;
|
||||
}, [aspectRatio]);
|
||||
|
||||
/** 图片轮播容器高度:默认 16:9 */
|
||||
const imageWrapperHeight = useMemo(() => {
|
||||
// return 'calc(100vw * 9 / 16)';
|
||||
const { w, h } = parseAspect(aspectRatio);
|
||||
return `calc(100vw * ${h} / ${w})`;
|
||||
return `min(calc(100vw * ${h} / ${w}), calc(100vh - 8.5rem))`;
|
||||
}, [aspectRatio]);
|
||||
|
||||
// 计算当前阶段类型
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user