Compare commits

...

2 commits

4 changed files with 11 additions and 1 deletions

1
.gitattributes vendored Normal file
View file

@ -0,0 +1 @@
public/empty.mp3 filter=lfs diff=lfs merge=lfs -text

3
public/empty.mp3 Normal file
View file

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:98875890b2f83542ccc5a791c22669b7372ea3bde7349d284feb3d937dce3d95
size 4412

View file

@ -32,7 +32,7 @@ export default defineComponent({
// Use the global audio loading queue to throttle concurrent loads // Use the global audio loading queue to throttle concurrent loads
const preloadAudio = (src: string) => { const preloadAudio = (src: string) => {
console.debug(`[AUDIOAREA] Queueing audio for preload: ${src}`); console.debug(`[AUDIOAREA] Queueing audio for preload: ${src}`);
audioSrc.value = ""; audioSrc.value = "empty.mp3";
queueAudioForLoading( queueAudioForLoading(
src, src,

View file

@ -107,6 +107,7 @@ export default defineComponent({
if (entry.isIntersecting) { if (entry.isIntersecting) {
element.classList.add("visible"); element.classList.add("visible");
if (!element.src && element.dataset.src) { if (!element.src && element.dataset.src) {
element.classList.add("displayed");
// Queue the image for loading through the global service // Queue the image for loading through the global service
// Calculate the image's position to prioritize closer images // Calculate the image's position to prioritize closer images
queueImageForLoading( queueImageForLoading(
@ -122,6 +123,8 @@ export default defineComponent({
} }
); );
} }
} else {
element.classList.remove("visible");
} }
}); });
}); });
@ -177,6 +180,9 @@ export interface VideoScrollDef {
.video-scroll img.visible { .video-scroll img.visible {
visibility: visible !important; visibility: visible !important;
}
.video-scroll img.displayed {
opacity: 1 !important; opacity: 1 !important;
} }