@streamscloud/kit 0.66.0 → 0.67.0
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.
|
@@ -63,7 +63,7 @@ const onCarouselIndexChanged = (index) => {
|
|
|
63
63
|
active={true}
|
|
64
64
|
on={{ timeUpdate: onPlayerTimeUpdate, durationChange: onPlayerDurationChange, activate: onPlayerActivate }} />
|
|
65
65
|
{:else}
|
|
66
|
-
<Image src={items[0].url} showStubOnError={true} />
|
|
66
|
+
<Image src={items[0].url} showStubOnError={true} decoding="sync" />
|
|
67
67
|
{/if}
|
|
68
68
|
</div>
|
|
69
69
|
{:else}
|
|
@@ -78,7 +78,7 @@ const onCarouselIndexChanged = (index) => {
|
|
|
78
78
|
active={item === items[currentIndex]}
|
|
79
79
|
on={{ timeUpdate: onPlayerTimeUpdate, durationChange: onPlayerDurationChange, activate: onPlayerActivate }} />
|
|
80
80
|
{:else}
|
|
81
|
-
<Image src={item.url} showStubOnError={true} />
|
|
81
|
+
<Image src={item.url} showStubOnError={true} decoding="sync" />
|
|
82
82
|
{/if}
|
|
83
83
|
</div>
|
|
84
84
|
{/snippet}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
<script lang="ts">import { Icon } from '../icon';
|
|
2
2
|
import { calculateImageState } from './image-state';
|
|
3
3
|
import IconImageOff from '@fluentui/svg-icons/icons/image_off_20_regular.svg?raw';
|
|
4
|
-
let { src, alt = '', showStubOnError = false, on, stub } = $props();
|
|
4
|
+
let { src, alt = '', showStubOnError = false, decoding = 'auto', on, stub } = $props();
|
|
5
5
|
let hasError = $state(false);
|
|
6
6
|
const imageState = $derived(calculateImageState(src, hasError, showStubOnError));
|
|
7
7
|
// A 0.01x density makes the intrinsic size 100× the natural one, so `contain` sizing always scales the picture
|
|
@@ -20,7 +20,15 @@ const onLoadError = () => {
|
|
|
20
20
|
|
|
21
21
|
<div class="image">
|
|
22
22
|
{#if !!src}
|
|
23
|
-
<img
|
|
23
|
+
<img
|
|
24
|
+
class="image__img"
|
|
25
|
+
class:image__img--hidden={imageState !== 'showImage'}
|
|
26
|
+
srcset={srcset}
|
|
27
|
+
alt={alt || ''}
|
|
28
|
+
draggable="false"
|
|
29
|
+
decoding={decoding}
|
|
30
|
+
onload={onLoad}
|
|
31
|
+
onerror={onLoadError} />
|
|
24
32
|
{/if}
|
|
25
33
|
|
|
26
34
|
{#if imageState === 'showError'}
|
|
@@ -5,6 +5,8 @@ type Props = {
|
|
|
5
5
|
alt?: string;
|
|
6
6
|
/** Show a placeholder stub instead of an error icon when image fails to load */
|
|
7
7
|
showStubOnError?: boolean;
|
|
8
|
+
/** `'sync'` paints the picture in the same frame as its box — needed when the element can be dragged, or the first drag ghost comes out empty. @default 'auto' */
|
|
9
|
+
decoding?: 'sync' | 'async' | 'auto';
|
|
8
10
|
on?: {
|
|
9
11
|
/** Fires after load attempt; `true` if successful, `false` on error */
|
|
10
12
|
load?: (loadedSuccessfully: boolean) => void;
|
|
@@ -263,7 +263,7 @@ const handleSeek = (percent) => {
|
|
|
263
263
|
<track src="" kind="captions" />
|
|
264
264
|
</video>
|
|
265
265
|
{#if !everActivated && poster}
|
|
266
|
-
<img class="video__poster" src={poster} alt="" />
|
|
266
|
+
<img class="video__poster" src={poster} alt="" draggable="false" />
|
|
267
267
|
{/if}
|
|
268
268
|
<div
|
|
269
269
|
class="video__overlay"
|