#11 : preload images on track change
This commit is contained in:
parent
f158f99fc5
commit
2a743e6377
141 changed files with 80 additions and 4 deletions
|
|
@ -36,10 +36,16 @@ const isHelperHidden = ref(localStorage.getItem("isHelperHidden"));
|
|||
localStorage.setItem("isHelperHidden", true);
|
||||
|
||||
// Images preload
|
||||
const imageUrls = activeTrack.files.map((file) => file.url);
|
||||
preloadImages(imageUrls);
|
||||
function preloadImages(imageUrls) {
|
||||
imageUrls.forEach((imageUrl) => {
|
||||
const imageUrls = computed(() => activeTrack.files.map((file) => file.url));
|
||||
watch(
|
||||
imageUrls,
|
||||
() => {
|
||||
preloadImages();
|
||||
},
|
||||
{ immediate: true }
|
||||
);
|
||||
function preloadImages() {
|
||||
imageUrls.value.forEach((imageUrl) => {
|
||||
const image = new Image();
|
||||
image.src = imageUrl;
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue