@christianriedl/media 1.0.97 → 1.0.99
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/iMedia.d.ts +1 -1
- package/package.json +1 -1
- package/src/views/PhotoAlbumPage.vue +12 -9
package/dist/iMedia.d.ts
CHANGED
package/package.json
CHANGED
|
@@ -37,6 +37,7 @@
|
|
|
37
37
|
let mouseTimer: number = -1;
|
|
38
38
|
let nameTimer: number = -1;
|
|
39
39
|
let nextIndex: number = -1;
|
|
40
|
+
let mediaUrlLength = mediaService.mediaUrl;
|
|
40
41
|
const showName = ref(false);
|
|
41
42
|
|
|
42
43
|
watch([appState.bodyHeight, appState.pageWidth], () => {
|
|
@@ -385,7 +386,7 @@
|
|
|
385
386
|
const item = items[index.value];
|
|
386
387
|
if (mediaAppConfig.useImagePreload) {
|
|
387
388
|
if (index.value != nextIndex) {
|
|
388
|
-
item.blob = "
|
|
389
|
+
item.blob = appConfig.urlPrefix + "img/Wait.png";
|
|
389
390
|
createBlob(item);
|
|
390
391
|
}
|
|
391
392
|
}
|
|
@@ -395,13 +396,15 @@
|
|
|
395
396
|
nameTimer = window.setTimeout(() => { onLoad(item); }, 200);
|
|
396
397
|
}
|
|
397
398
|
function onLoad(item: IPictureFile) { // img loaded or cached
|
|
398
|
-
if (
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
399
|
+
if (mediaAppConfig.useImagePreload) {
|
|
400
|
+
if (item.blob && item.blob.startsWith("blob")) {
|
|
401
|
+
window.URL.revokeObjectURL(item.blob);
|
|
402
|
+
}
|
|
403
|
+
const next = index.value + 1;
|
|
404
|
+
if (next < items.length && next > nextIndex) {
|
|
405
|
+
nextIndex = next;
|
|
406
|
+
createBlob(items[nextIndex]);
|
|
407
|
+
}
|
|
405
408
|
}
|
|
406
409
|
clearName();
|
|
407
410
|
const idx = item.Url.lastIndexOf('.');
|
|
@@ -421,7 +424,7 @@
|
|
|
421
424
|
}
|
|
422
425
|
}
|
|
423
426
|
function createBlob (item: IPictureFile) {
|
|
424
|
-
const url = getUrl
|
|
427
|
+
const url = getUrl(item).substr(mediaUrlLength); // trim mediaserver url
|
|
425
428
|
mediaService.getImage(url)
|
|
426
429
|
.then((blob) => {
|
|
427
430
|
item.blob = window.URL.createObjectURL(blob);
|