@streamscloud/embeddable 6.3.0 → 6.3.2
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/short-videos/short-videos-player/short-videos-player-view.svelte +19 -13
- package/dist/ui/player/player-buffer.svelte.d.ts +2 -2
- package/dist/ui/player/player-buffer.svelte.js +2 -2
- package/dist/ui/shadow-dom/shadow-root-service.js +2 -2
- package/package.json +1 -1
- /package/dist/ui/shadow-dom/{_normalize.scss → normalize.scss} +0 -0
- /package/dist/ui/shadow-dom/{_reset.scss → reset.scss} +0 -0
|
@@ -15,6 +15,7 @@ import { PlayerBuffer, PlayerSlider } from '../../ui/player';
|
|
|
15
15
|
import { SpotlightLayout } from '../../ui/spotlight-layout';
|
|
16
16
|
import { SwipeIndicator } from '../../ui/swipe-indicator';
|
|
17
17
|
import { default as Controls } from './controls.svelte';
|
|
18
|
+
import { InternalShortVideoPlayerProvider } from './internal-short-video-player-provider';
|
|
18
19
|
import { ShortVideosPlayerLocalization } from './short-videos-player-localization';
|
|
19
20
|
import { ShortVideosPlayerUiManager } from './ui-manager.svelte';
|
|
20
21
|
import { untrack } from 'svelte';
|
|
@@ -27,19 +28,24 @@ let buffer = $state.raw(null);
|
|
|
27
28
|
$effect(() => {
|
|
28
29
|
void dataProvider;
|
|
29
30
|
untrack(() => {
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
31
|
+
initBuffer(dataProvider);
|
|
32
|
+
});
|
|
33
|
+
});
|
|
34
|
+
const initBuffer = (dataProvider) => __awaiter(void 0, void 0, void 0, function* () {
|
|
35
|
+
bufferIsLoading = true;
|
|
36
|
+
if (dataProvider instanceof InternalShortVideoPlayerProvider) {
|
|
37
|
+
yield dataProvider.prefetch();
|
|
38
|
+
}
|
|
39
|
+
new PlayerBuffer(dataProvider, {
|
|
40
|
+
preloaded: (instance) => __awaiter(void 0, void 0, void 0, function* () {
|
|
41
|
+
if (instance.loaded.length) {
|
|
42
|
+
const coverUrl = resolveVideoCover(instance.loaded[0]);
|
|
43
|
+
yield preloadImage(coverUrl);
|
|
44
|
+
background = coverUrl;
|
|
45
|
+
}
|
|
46
|
+
buffer = instance;
|
|
47
|
+
bufferIsLoading = false;
|
|
48
|
+
})
|
|
43
49
|
});
|
|
44
50
|
});
|
|
45
51
|
const uiManager = new ShortVideosPlayerUiManager();
|
|
@@ -14,11 +14,11 @@ export declare class PlayerBuffer<T extends {
|
|
|
14
14
|
private loadMoreFn;
|
|
15
15
|
private isLoading;
|
|
16
16
|
constructor(provider: IPlayerItemsProvider<T>, on?: {
|
|
17
|
-
preloaded?: () => void;
|
|
17
|
+
preloaded?: (self: PlayerBuffer<T>) => void;
|
|
18
18
|
});
|
|
19
19
|
loadNext: () => Promise<void>;
|
|
20
20
|
loadPrevious: () => Promise<void>;
|
|
21
|
-
reset: (onPreloaded?: () => void) => void;
|
|
21
|
+
reset: (onPreloaded?: (self: PlayerBuffer<T>) => void) => void;
|
|
22
22
|
private warmUpBuffer;
|
|
23
23
|
}
|
|
24
24
|
export interface IPlayerItemsProvider<T> {
|
|
@@ -46,7 +46,7 @@ export class PlayerBuffer {
|
|
|
46
46
|
const bufferSize = 5;
|
|
47
47
|
if (this._loaded.length >= this.currentIndex + bufferSize || this.isLoading) {
|
|
48
48
|
if (onPreloaded) {
|
|
49
|
-
onPreloaded();
|
|
49
|
+
onPreloaded(this);
|
|
50
50
|
}
|
|
51
51
|
return;
|
|
52
52
|
}
|
|
@@ -62,7 +62,7 @@ export class PlayerBuffer {
|
|
|
62
62
|
}
|
|
63
63
|
finally {
|
|
64
64
|
if (onPreloaded) {
|
|
65
|
-
onPreloaded();
|
|
65
|
+
onPreloaded(this);
|
|
66
66
|
}
|
|
67
67
|
this.isLoading = false;
|
|
68
68
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import normalize from './
|
|
2
|
-
import reset from './
|
|
1
|
+
import normalize from './normalize.scss?raw';
|
|
2
|
+
import reset from './reset.scss?raw';
|
|
3
3
|
export const createShadowRoot = (host) => {
|
|
4
4
|
prepareShadowRootHost(host);
|
|
5
5
|
const shadowRoot = host.attachShadow({ mode: 'open' });
|
package/package.json
CHANGED
|
File without changes
|
|
File without changes
|