forked from 77media/video-flow
修复首页视频卡顿问题
This commit is contained in:
parent
bf37aad5e8
commit
d72d0e6457
@ -111,7 +111,7 @@ function VideoGridLayoutComponent({ videos, onEdit, onDelete }: VideoGridLayoutP
|
|||||||
loop
|
loop
|
||||||
muted={isMuted[video.id] !== false} // 默认静音,除非明确设置为false
|
muted={isMuted[video.id] !== false} // 默认静音,除非明确设置为false
|
||||||
playsInline
|
playsInline
|
||||||
preload="auto"
|
preload="none"
|
||||||
poster={`${video.url}?vframe/jpg/offset/1`}
|
poster={`${video.url}?vframe/jpg/offset/1`}
|
||||||
onLoadedData={() => {
|
onLoadedData={() => {
|
||||||
// 设置默认音量
|
// 设置默认音量
|
||||||
|
|||||||
@ -197,7 +197,7 @@ function VideoScreenLayoutComponent({ videos }: VideoScreenLayoutProps) {
|
|||||||
loop
|
loop
|
||||||
muted={index === currentIndex ? isMuted : true} // 只有当前视频受状态控制
|
muted={index === currentIndex ? isMuted : true} // 只有当前视频受状态控制
|
||||||
playsInline
|
playsInline
|
||||||
preload="auto"
|
preload={`${index === currentIndex ? 'auto' : 'none'}`}
|
||||||
poster={`${video.url}?vframe/jpg/offset/1`}
|
poster={`${video.url}?vframe/jpg/offset/1`}
|
||||||
onLoadedData={() => {
|
onLoadedData={() => {
|
||||||
if (index === currentIndex && videoRefs.current[index]) {
|
if (index === currentIndex && videoRefs.current[index]) {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user