@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 CHANGED
@@ -24,8 +24,8 @@ export interface IMediaAppConfig {
24
24
  nameDurationMS: number;
25
25
  pictureQuality: EPictureQuality;
26
26
  linkDaysValid: number;
27
- useSatIp: boolean;
28
27
  useImagePreload: boolean;
28
+ useSatIp: boolean;
29
29
  }
30
30
  export declare enum EItemType {
31
31
  None = 0,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@christianriedl/media",
3
- "version": "1.0.97",
3
+ "version": "1.0.99",
4
4
  "description": "RIC media interfaces",
5
5
 
6
6
  "main": "dist/index.js",
@@ -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 = "/pwa/img/Wait.png";
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 (item.blob && item.blob.startsWith("blob")) {
399
- window.URL.revokeObjectURL(item.blob);
400
- }
401
- const next = index.value + 1;
402
- if (next < items.length && next > nextIndex) {
403
- nextIndex = next;
404
- createBlob (items[nextIndex]);
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 (item).substr(38); // trim mediaserver url
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);