fix(弹幕组件): 修复低端机弹幕突然消失的问题
This commit is contained in:
parent
3da6b522cd
commit
585f835bed
@ -93,10 +93,11 @@ const idCounter = ref(0)
|
||||
const currentIndex = ref(0)
|
||||
const isBarragePaused = ref(false)
|
||||
const liteAnimations = shouldUseLiteAnimations()
|
||||
const visibleTracks = computed(() => tracks.value.filter((track) => track.length > 0))
|
||||
const effectiveMaxItems = computed(() => (liteAnimations ? Math.min(props.maxItems, 1) : props.maxItems))
|
||||
const visibleTracks = computed(() => tracks.value)
|
||||
// 低端机保留一定并发空间,避免长弹幕还没滑完就因为上限过低被后续弹幕挤掉。
|
||||
const effectiveMaxItems = computed(() => (liteAnimations ? Math.min(props.maxItems, 2) : props.maxItems))
|
||||
const effectiveLoopInterval = computed(() =>
|
||||
liteAnimations ? Math.max(props.loopInterval, 4500) : props.loopInterval,
|
||||
liteAnimations ? Math.max(props.loopInterval, 6000) : props.loopInterval,
|
||||
)
|
||||
|
||||
let barrageInterval = null
|
||||
|
||||
@ -98,10 +98,11 @@ const idCounter = ref(0)
|
||||
const currentIndex = ref(0)
|
||||
const isBarragePaused = ref(false)
|
||||
const liteAnimations = shouldUseLiteAnimations()
|
||||
const visibleTracks = computed(() => tracks.value.filter((track) => track.length > 0))
|
||||
const effectiveMaxItems = computed(() => (liteAnimations ? Math.min(props.maxItems, 1) : props.maxItems))
|
||||
const visibleTracks = computed(() => tracks.value)
|
||||
// 低端机保留一定并发空间,避免长弹幕还没滑完就因为上限过低被后续弹幕挤掉。
|
||||
const effectiveMaxItems = computed(() => (liteAnimations ? Math.min(props.maxItems, 2) : props.maxItems))
|
||||
const effectiveLoopInterval = computed(() =>
|
||||
liteAnimations ? Math.max(props.loopInterval, 4500) : props.loopInterval,
|
||||
liteAnimations ? Math.max(props.loopInterval, 6000) : props.loopInterval,
|
||||
)
|
||||
|
||||
let barrageInterval = null
|
||||
|
||||
@ -98,10 +98,11 @@ const idCounter = ref(0)
|
||||
const currentIndex = ref(0)
|
||||
const isBarragePaused = ref(false)
|
||||
const liteAnimations = shouldUseLiteAnimations()
|
||||
const visibleTracks = computed(() => tracks.value.filter((track) => track.length > 0))
|
||||
const effectiveMaxItems = computed(() => (liteAnimations ? Math.min(props.maxItems, 1) : props.maxItems))
|
||||
const visibleTracks = computed(() => tracks.value)
|
||||
// 低端机保留一定并发空间,避免长弹幕还没滑完就因为上限过低被后续弹幕挤掉。
|
||||
const effectiveMaxItems = computed(() => (liteAnimations ? Math.min(props.maxItems, 2) : props.maxItems))
|
||||
const effectiveLoopInterval = computed(() =>
|
||||
liteAnimations ? Math.max(props.loopInterval, 4500) : props.loopInterval,
|
||||
liteAnimations ? Math.max(props.loopInterval, 6000) : props.loopInterval,
|
||||
)
|
||||
|
||||
let barrageInterval = null
|
||||
|
||||
@ -133,10 +133,11 @@ const idCounter = ref(0)
|
||||
const currentIndex = ref(0)
|
||||
const isBarragePaused = ref(false)
|
||||
const liteAnimations = shouldUseLiteAnimations()
|
||||
const visibleTracks = computed(() => tracks.value.filter((track) => track.length > 0))
|
||||
const effectiveMaxItems = computed(() => (liteAnimations ? Math.min(props.maxItems, 1) : props.maxItems))
|
||||
const visibleTracks = computed(() => tracks.value)
|
||||
// 低端机保留一定并发空间,避免长弹幕还没滑完就因为上限过低被后续弹幕挤掉。
|
||||
const effectiveMaxItems = computed(() => (liteAnimations ? Math.min(props.maxItems, 2) : props.maxItems))
|
||||
const effectiveLoopInterval = computed(() =>
|
||||
liteAnimations ? Math.max(props.loopInterval, 4500) : props.loopInterval,
|
||||
liteAnimations ? Math.max(props.loopInterval, 6000) : props.loopInterval,
|
||||
)
|
||||
|
||||
let barrageInterval = null
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user