@streamscloud/embeddable 4.0.0 → 5.0.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.
- package/dist/ads/ad-card/cmp.ad-card.svelte +34 -7
- package/dist/ads/ad-card/cmp.ad-card.svelte.d.ts +1 -1
- package/dist/ads/ad-card/mapper.js +1 -0
- package/dist/ads/ad-card/operations.generated.d.ts +1 -0
- package/dist/ads/ad-card/operations.generated.js +1 -0
- package/dist/ads/ad-card/operations.graphql +1 -0
- package/dist/ads/ad-card/types.d.ts +1 -0
- package/dist/products/product-card/cmp.product-card.svelte +3 -2
- package/dist/short-videos/short-video-viewer/cmp.short-video-controls.svelte +24 -13
- package/dist/short-videos/short-video-viewer/cmp.short-video-controls.svelte.d.ts +2 -2
- package/dist/short-videos/short-video-viewer/cmp.short-video-viewer.svelte +4 -3
- package/dist/short-videos/short-video-viewer/cmp.short-video-viewer.svelte.d.ts +3 -2
- package/dist/short-videos/short-video-viewer/index.d.ts +2 -2
- package/dist/short-videos/short-video-viewer/index.js +1 -1
- package/dist/short-videos/short-video-viewer/mapper.d.ts +1 -1
- package/dist/short-videos/short-video-viewer/mapper.js +38 -5
- package/dist/short-videos/short-video-viewer/operations.generated.d.ts +1 -0
- package/dist/short-videos/short-video-viewer/operations.generated.js +87 -98
- package/dist/short-videos/short-video-viewer/operations.graphql +40 -2
- package/dist/short-videos/short-video-viewer/types.d.ts +35 -6
- package/dist/short-videos/short-video-viewer/types.js +1 -1
- package/dist/short-videos/short-video-viewer/ui-manager.svelte.js +2 -2
- package/dist/short-videos/short-videos-player/cmp.short-videos-player.svelte +3 -1
- package/dist/short-videos/short-videos-player/cmp.short-videos-player.svelte.d.ts +4 -0
- package/dist/short-videos/short-videos-player/controls.svelte +37 -20
- package/dist/short-videos/short-videos-player/controls.svelte.d.ts +2 -1
- package/dist/short-videos/short-videos-player/index.js +6 -0
- package/dist/short-videos/short-videos-player/operations.generated.d.ts +1 -0
- package/dist/short-videos/short-videos-player/operations.generated.js +73 -84
- package/dist/short-videos/short-videos-player/short-videos-player-view.svelte +19 -6
- package/dist/short-videos/short-videos-player/short-videos-player-view.svelte.d.ts +4 -0
- package/dist/short-videos/short-videos-player/types.d.ts +9 -9
- package/dist/short-videos/short-videos-player/ui-manager.svelte.d.ts +1 -0
- package/dist/short-videos/short-videos-player/ui-manager.svelte.js +2 -1
- package/dist/streams/layout/models/mapper.js +2 -1
- package/dist/streams/layout/models/stream-layout-short-video-model.d.ts +1 -0
- package/dist/streams/stream-player/cmp.stream-player.svelte +6 -4
- package/dist/streams/stream-player/cmp.stream-player.svelte.d.ts +2 -0
- package/dist/streams/stream-player/controls.svelte +25 -5
- package/dist/streams/stream-player/controls.svelte.d.ts +2 -0
- package/dist/streams/stream-player/index.d.ts +2 -0
- package/dist/streams/stream-player/index.js +2 -1
- package/dist/streams/stream-player/mapper.d.ts +1 -1
- package/dist/streams/stream-player/mapper.js +1 -1
- package/dist/streams/stream-player/ui-manager.svelte.d.ts +1 -0
- package/dist/streams/stream-player/ui-manager.svelte.js +2 -1
- package/dist/ui/line-clamp/cmp.line-clamp.svelte +35 -13
- package/dist/ui/player/cmp.player-slider.svelte +74 -9
- package/dist/ui/progress/cmp.progress.svelte +4 -1
- package/dist/ui/seek-bar/cmp.seek-bar.svelte +112 -28
- package/dist/ui/seek-bar/cmp.seek-bar.svelte.d.ts +3 -0
- package/dist/ui/video/cmp.video.svelte +45 -37
- package/dist/ui/video/cmp.video.svelte.d.ts +2 -0
- package/dist/ui/video/index.d.ts +1 -0
- package/dist/ui/video/index.js +1 -0
- package/dist/ui/video/types.d.ts +4 -0
- package/dist/ui/video/types.js +5 -0
- package/package.json +5 -1
|
@@ -12,13 +12,14 @@ import { Icon, IconColor } from '../icon';
|
|
|
12
12
|
import { MediaVolumeManager, PlaybackManager } from '../media-playback';
|
|
13
13
|
import { Progress } from '../progress';
|
|
14
14
|
import { SeekBar } from '../seek-bar';
|
|
15
|
+
import { ScrubberPosition } from './types';
|
|
15
16
|
import IconPause from '@fluentui/svg-icons/icons/pause_20_regular.svg?raw';
|
|
16
17
|
import IconPlay from '@fluentui/svg-icons/icons/play_20_regular.svg?raw';
|
|
17
18
|
import IconSpeaker from '@fluentui/svg-icons/icons/speaker_2_20_regular.svg?raw';
|
|
18
19
|
import IconSpeakerMute from '@fluentui/svg-icons/icons/speaker_mute_20_regular.svg?raw';
|
|
19
20
|
import { onDestroy, onMount, untrack } from 'svelte';
|
|
20
|
-
import {
|
|
21
|
-
let { src, poster, id = randomNanoid(), controls = true, autoplay = false, loop = false, inert = false, hideSpeaker = false, intersectionContainer, on } = $props();
|
|
21
|
+
import { fade } from 'svelte/transition';
|
|
22
|
+
let { src, poster, id = randomNanoid(), controls = true, autoplay = false, loop = false, inert = false, hideSpeaker = false, intersectionContainer, scrubberPosition = ScrubberPosition.Bottom, on } = $props();
|
|
22
23
|
onMount(() => {
|
|
23
24
|
var _a;
|
|
24
25
|
PlaybackManager.registerMountedPlayer(id, {
|
|
@@ -29,12 +30,10 @@ onMount(() => {
|
|
|
29
30
|
pause();
|
|
30
31
|
},
|
|
31
32
|
onStop: (inRespectToNewlyActivatedVideo) => {
|
|
32
|
-
if (
|
|
33
|
-
|
|
34
|
-
}
|
|
35
|
-
else {
|
|
36
|
-
stop();
|
|
33
|
+
if (autoplay === 'on-appearance' && inRespectToNewlyActivatedVideo) {
|
|
34
|
+
return;
|
|
37
35
|
}
|
|
36
|
+
stop();
|
|
38
37
|
},
|
|
39
38
|
onToggle: () => {
|
|
40
39
|
togglePlay();
|
|
@@ -50,8 +49,8 @@ onMount(() => {
|
|
|
50
49
|
}
|
|
51
50
|
});
|
|
52
51
|
(_a = on === null || on === void 0 ? void 0 : on.loaded) === null || _a === void 0 ? void 0 : _a.call(on, { id, src });
|
|
53
|
-
if (
|
|
54
|
-
intersectionObserver.observe(
|
|
52
|
+
if (videoContainerRef) {
|
|
53
|
+
intersectionObserver.observe(videoContainerRef);
|
|
55
54
|
}
|
|
56
55
|
});
|
|
57
56
|
onDestroy(() => {
|
|
@@ -64,8 +63,8 @@ onDestroy(() => {
|
|
|
64
63
|
}
|
|
65
64
|
});
|
|
66
65
|
let video = $state.raw(undefined);
|
|
66
|
+
let videoContainerRef = $state.raw(undefined);
|
|
67
67
|
let showControlsOnHover = $state(false);
|
|
68
|
-
let needShowProgress = $state(false);
|
|
69
68
|
let isVideoPaused = $state(true);
|
|
70
69
|
let percentageCompleted = $state(0);
|
|
71
70
|
let everActivated = $state(false);
|
|
@@ -187,9 +186,7 @@ const onTimeUpdate = (e) => {
|
|
|
187
186
|
percentageCompleted = video.currentTime / video.duration || 0;
|
|
188
187
|
notifyProgress();
|
|
189
188
|
};
|
|
190
|
-
const onLoaded = (
|
|
191
|
-
const video = e.target;
|
|
192
|
-
needShowProgress = video.duration >= 8;
|
|
189
|
+
const onLoaded = () => __awaiter(void 0, void 0, void 0, function* () {
|
|
193
190
|
setVolume(MediaVolumeManager.volumeLevel);
|
|
194
191
|
setMuted(MediaVolumeManager.isMuted);
|
|
195
192
|
});
|
|
@@ -233,11 +230,13 @@ const notifyProgress = () => {
|
|
|
233
230
|
const handleSeek = (percent) => {
|
|
234
231
|
if (video) {
|
|
235
232
|
video.currentTime = video.duration * percent;
|
|
233
|
+
percentageCompleted = percent;
|
|
234
|
+
notifyProgress();
|
|
236
235
|
}
|
|
237
236
|
};
|
|
238
237
|
</script>
|
|
239
238
|
|
|
240
|
-
<div class="video"
|
|
239
|
+
<div class="video" role="none" inert={inert} bind:this={videoContainerRef}>
|
|
241
240
|
<video
|
|
242
241
|
class="video__video"
|
|
243
242
|
class:video__video--not-activated={!everActivated}
|
|
@@ -281,18 +280,24 @@ const handleSeek = (percent) => {
|
|
|
281
280
|
{/if}
|
|
282
281
|
|
|
283
282
|
{#if everActivated}
|
|
284
|
-
<div
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
283
|
+
<div
|
|
284
|
+
class="video__progress-container"
|
|
285
|
+
class:video__progress-container--top={scrubberPosition === ScrubberPosition.Top}
|
|
286
|
+
class:video__progress-container--bottom={scrubberPosition === ScrubberPosition.Bottom}
|
|
287
|
+
onmouseenter={() => setShowControlsOnHover(true)}
|
|
288
|
+
onmouseleave={() => setShowControlsOnHover(false)}
|
|
289
|
+
onclick={(e) => e.stopPropagation()}
|
|
290
|
+
onkeydown={() => ({})}
|
|
291
|
+
role="none">
|
|
292
|
+
{#if !showControlsOnHover && isVideoPaused}
|
|
293
|
+
<div class="video__progress">
|
|
294
|
+
<Progress value={percentageCompleted} />
|
|
295
|
+
</div>
|
|
296
|
+
{/if}
|
|
297
|
+
{#if showControlsOnHover}
|
|
298
|
+
<div class="video__progress" transition:fade={{ duration: isVideoPaused ? 0 : 300 }}>
|
|
299
|
+
<SeekBar value={percentageCompleted} listenParentClicks={true} on={{ seek: handleSeek }} />
|
|
300
|
+
</div>
|
|
296
301
|
{/if}
|
|
297
302
|
</div>
|
|
298
303
|
{/if}
|
|
@@ -316,7 +321,7 @@ const handleSeek = (percent) => {
|
|
|
316
321
|
--_video--border-radius: var(--video--border-radius, 0);
|
|
317
322
|
--_video--media-fit: var(--video--media-fit, contain);
|
|
318
323
|
--_video--poster--media-fit: var(--video--poster--media-fit, cover);
|
|
319
|
-
--_video--progress--background-color: var(--video--progress--background-color,
|
|
324
|
+
--_video--progress--background-color: var(--video--progress--background-color, transparent);
|
|
320
325
|
--_video--progress--back-color: var(--video--progress--back-color);
|
|
321
326
|
--_video--progress--front-color: var(--video--progress--front-color);
|
|
322
327
|
height: 100%;
|
|
@@ -382,20 +387,23 @@ const handleSeek = (percent) => {
|
|
|
382
387
|
}
|
|
383
388
|
.video__progress-container {
|
|
384
389
|
position: absolute;
|
|
385
|
-
bottom: 0;
|
|
386
390
|
left: 0;
|
|
387
391
|
right: 0;
|
|
392
|
+
z-index: 1;
|
|
393
|
+
min-height: 1.5625rem;
|
|
394
|
+
padding: 0 0.25rem;
|
|
395
|
+
}
|
|
396
|
+
.video__progress-container--top {
|
|
397
|
+
top: 0.5625rem;
|
|
398
|
+
bottom: auto;
|
|
399
|
+
}
|
|
400
|
+
.video__progress-container--bottom {
|
|
401
|
+
top: auto;
|
|
402
|
+
bottom: 0;
|
|
388
403
|
}
|
|
389
404
|
.video__progress {
|
|
390
|
-
|
|
391
|
-
--progress--height: 0.125em;
|
|
405
|
+
--progress--height: 0.3125em;
|
|
392
406
|
--progress--back-color: var(--_video--progress--back-color);
|
|
393
407
|
--progress--front-color: var(--_video--progress--front-color);
|
|
394
|
-
|
|
395
|
-
.video__seek-bar {
|
|
396
|
-
padding: 0.625em 0.5em;
|
|
397
|
-
background: var(--_video--progress--background-color);
|
|
398
|
-
cursor: default;
|
|
399
|
-
--seek-bar--back-color: var(--_video--progress--back-color);
|
|
400
|
-
--seek-bar--front-color: var(--_video--progress--front-color);
|
|
408
|
+
padding: 0.625rem 0;
|
|
401
409
|
}</style>
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { ScrubberPosition } from './types';
|
|
1
2
|
type Props = {
|
|
2
3
|
src: string;
|
|
3
4
|
poster: string | null;
|
|
@@ -8,6 +9,7 @@ type Props = {
|
|
|
8
9
|
intersectionContainer?: HTMLElement;
|
|
9
10
|
inert?: boolean;
|
|
10
11
|
hideSpeaker?: boolean;
|
|
12
|
+
scrubberPosition?: ScrubberPosition;
|
|
11
13
|
on?: {
|
|
12
14
|
loaded?: (data: {
|
|
13
15
|
id: string;
|
package/dist/ui/video/index.d.ts
CHANGED
package/dist/ui/video/index.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@streamscloud/embeddable",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "5.0.0",
|
|
4
4
|
"author": "StreamsCloud",
|
|
5
5
|
"repository": "https://github.com/StreamsCloud/streamscloud-frontend-packages.git",
|
|
6
6
|
"type": "module",
|
|
@@ -36,6 +36,10 @@
|
|
|
36
36
|
"types": "./dist/short-videos/short-videos-player/index.d.ts",
|
|
37
37
|
"svelte": "./dist/short-videos/short-videos-player/index.js"
|
|
38
38
|
},
|
|
39
|
+
"./short-video-viewer": {
|
|
40
|
+
"types": "./dist/short-videos/short-video-viewer/index.d.ts",
|
|
41
|
+
"svelte": "./dist/short-videos/short-video-viewer/index.js"
|
|
42
|
+
},
|
|
39
43
|
"./stream-layout": {
|
|
40
44
|
"types": "./dist/streams/layout/index.d.ts",
|
|
41
45
|
"import": "./dist/streams/layout/index.js",
|