Force reel videos to remount on movie change
This commit is contained in:
@@ -30,6 +30,7 @@
|
|||||||
<div class="collage-fallback-tile" :class="`collage-fallback-${slot.index + 1}`"></div>
|
<div class="collage-fallback-tile" :class="`collage-fallback-${slot.index + 1}`"></div>
|
||||||
<video
|
<video
|
||||||
v-if="slot.sourcePaths.length > 0"
|
v-if="slot.sourcePaths.length > 0"
|
||||||
|
:key="`${item.id}-${slot.index}-${slot.sourcePaths.join('|')}`"
|
||||||
:ref="(el) => setVideoRef(el as HTMLVideoElement, slot.index)"
|
:ref="(el) => setVideoRef(el as HTMLVideoElement, slot.index)"
|
||||||
:class="{ 'is-ready': isVideoReady(slot.index) }"
|
:class="{ 'is-ready': isVideoReady(slot.index) }"
|
||||||
:autoplay="safariAutoplay"
|
:autoplay="safariAutoplay"
|
||||||
@@ -555,6 +556,11 @@ watch(
|
|||||||
)
|
)
|
||||||
videoStates.value = slots.map((slot) => (slot.sourcePaths.length > 0 ? "loading" : "missing"))
|
videoStates.value = slots.map((slot) => (slot.sourcePaths.length > 0 ? "loading" : "missing"))
|
||||||
await nextTick()
|
await nextTick()
|
||||||
|
for (let i = 0; i < videoRefs.value.length; i++) {
|
||||||
|
if (slots[i]?.sourcePaths.length > 0) {
|
||||||
|
videoRefs.value[i]?.load()
|
||||||
|
}
|
||||||
|
}
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
startStaggeredPlayback()
|
startStaggeredPlayback()
|
||||||
}, 100)
|
}, 100)
|
||||||
|
|||||||
Reference in New Issue
Block a user