@streamscloud/embeddable 6.4.3 → 6.5.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 +5 -19
- package/dist/ads/ad-card/cmp.ad-card.svelte.d.ts +0 -3
- package/dist/core/actions/horizontal-wheel-scroll.d.ts +4 -0
- package/dist/core/actions/horizontal-wheel-scroll.js +22 -0
- package/dist/core/actions/index.d.ts +2 -0
- package/dist/core/actions/index.js +2 -0
- package/dist/core/actions/swallow-touch.d.ts +2 -0
- package/dist/core/actions/swallow-touch.js +17 -0
- package/dist/media-center/media-center/cmp.media-center.svelte +10 -5
- package/dist/products/price-helper.d.ts +8 -1
- package/dist/products/price-helper.js +69 -24
- package/dist/products/product-card/cmp.product-card.svelte +2 -2
- package/dist/products/product-card/types.d.ts +1 -1
- package/dist/short-videos/short-video-viewer/cmp.attachments-horizontal.svelte +220 -0
- package/dist/short-videos/short-video-viewer/{cmp.attachments-inline.svelte.d.ts → cmp.attachments-horizontal.svelte.d.ts} +0 -2
- package/dist/short-videos/short-video-viewer/cmp.attachments.svelte +2 -8
- package/dist/short-videos/short-video-viewer/cmp.attachments.svelte.d.ts +0 -2
- package/dist/short-videos/short-video-viewer/cmp.short-video-viewer.svelte +63 -67
- package/dist/short-videos/short-video-viewer/cmp.short-video-viewer.svelte.d.ts +0 -2
- package/dist/short-videos/short-video-viewer/index.d.ts +0 -1
- package/dist/short-videos/short-video-viewer/index.js +0 -1
- package/dist/short-videos/short-video-viewer/types.d.ts +1 -1
- package/dist/short-videos/short-video-viewer/ui-manager.svelte.d.ts +2 -1
- package/dist/short-videos/short-video-viewer/ui-manager.svelte.js +5 -2
- package/dist/short-videos/short-videos-player/controls.svelte +85 -93
- package/dist/short-videos/short-videos-player/controls.svelte.d.ts +0 -2
- package/dist/short-videos/short-videos-player/internal-short-video-analytics-handler.d.ts +0 -2
- package/dist/short-videos/short-videos-player/internal-short-video-analytics-handler.js +0 -2
- package/dist/short-videos/short-videos-player/short-videos-player-view.svelte +4 -14
- package/dist/short-videos/short-videos-player/types.d.ts +0 -2
- package/dist/short-videos/short-videos-player/ui-manager.svelte.d.ts +8 -1
- package/dist/short-videos/short-videos-player/ui-manager.svelte.js +15 -6
- package/dist/streams/layout/element-views/price-element-view.svelte +7 -5
- package/dist/streams/layout/models/stream-layout-short-video-model.d.ts +4 -4
- package/dist/streams/stream-player/controls.svelte +131 -103
- package/dist/streams/stream-player/controls.svelte.d.ts +1 -2
- package/dist/streams/stream-player/fade-mixins.scss +12 -0
- package/dist/streams/stream-player/internal-stream-analytics-handler.d.ts +0 -2
- package/dist/streams/stream-player/internal-stream-analytics-handler.js +0 -2
- package/dist/streams/stream-player/stream-overview.svelte +1 -3
- package/dist/streams/stream-player/stream-player.svelte +24 -15
- package/dist/streams/stream-player/stream-player.svelte.d.ts +12 -1
- package/dist/streams/stream-player/types.d.ts +0 -2
- package/dist/streams/stream-player/ui-manager.svelte.d.ts +15 -8
- package/dist/streams/stream-player/ui-manager.svelte.js +40 -19
- package/package.json +1 -1
- package/dist/short-videos/short-video-viewer/cmp.attachments-inline.svelte +0 -144
- package/dist/short-videos/short-video-viewer/cmp.short-video-ad-card.svelte +0 -26
- package/dist/short-videos/short-video-viewer/cmp.short-video-ad-card.svelte.d.ts +0 -13
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
<script lang="ts">import { Image } from '../../ui/image';
|
|
2
2
|
import { LineClamp } from '../../ui/line-clamp';
|
|
3
3
|
import { Video } from '../../ui/video';
|
|
4
|
-
import { default as
|
|
4
|
+
import { default as AttachmentsHorizontal } from './cmp.attachments-horizontal.svelte';
|
|
5
5
|
import { default as ShortVideoControls } from './cmp.short-video-controls.svelte';
|
|
6
6
|
import { default as ShortVideoHeading } from './cmp.short-video-heading.svelte';
|
|
7
7
|
import { ShortVideoViewerLocalization } from './short-video-viewer-localization';
|
|
@@ -13,43 +13,37 @@ $effect(() => {
|
|
|
13
13
|
uiManager.updateCanShowAttachments(showAttachments);
|
|
14
14
|
uiManager.updateCanShowControls(showControls);
|
|
15
15
|
});
|
|
16
|
+
const trackControlsPanelSize = (node) => {
|
|
17
|
+
const resizeObserver = new ResizeObserver(([entry]) => {
|
|
18
|
+
const width = entry.contentRect.width;
|
|
19
|
+
uiManager.setControlsPanelWidth(width);
|
|
20
|
+
});
|
|
21
|
+
resizeObserver.observe(node);
|
|
22
|
+
return {
|
|
23
|
+
destroy() {
|
|
24
|
+
resizeObserver.unobserve(node);
|
|
25
|
+
}
|
|
26
|
+
};
|
|
27
|
+
};
|
|
16
28
|
</script>
|
|
17
29
|
|
|
18
30
|
<div class="short-video-viewer" style={uiManager.globalCssVariables}>
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
on
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
{
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
</div>
|
|
36
|
-
|
|
37
|
-
<div class="short-video-viewer__actions-panel" class:short-video-viewer__actions-panel--inside-frame={true}>
|
|
38
|
-
{#if uiManager.showAttachments}
|
|
39
|
-
<AttachmentsInline
|
|
40
|
-
model={model}
|
|
41
|
-
on={{
|
|
42
|
-
productClick: on?.productClick,
|
|
43
|
-
productImpression: on?.productImpression,
|
|
44
|
-
adClick: on?.adClick,
|
|
45
|
-
adImpression: on?.adImpression
|
|
46
|
-
}} />
|
|
47
|
-
{/if}
|
|
48
|
-
{#if uiManager.showControls}
|
|
49
|
-
<ShortVideoControls model={model} socialInteractionsHandler={socialInteractionsHandler} on={{ attachmentsClicked: uiManager.toggleEnableAttachments }} />
|
|
50
|
-
{/if}
|
|
51
|
-
</div>
|
|
52
|
-
<div class="short-video-viewer__description">
|
|
31
|
+
{#if !model.media.isImage}
|
|
32
|
+
<Video
|
|
33
|
+
src={model.media.url}
|
|
34
|
+
poster={model.media.thumbnailUrl}
|
|
35
|
+
controls={false}
|
|
36
|
+
autoplay={autoplay}
|
|
37
|
+
loop={true}
|
|
38
|
+
id={model.id}
|
|
39
|
+
hideSpeaker={true}
|
|
40
|
+
on={{
|
|
41
|
+
progress: on?.progress
|
|
42
|
+
}} />
|
|
43
|
+
{:else}
|
|
44
|
+
<Image src={model.media.url} />
|
|
45
|
+
{/if}
|
|
46
|
+
<div class="short-video-viewer__information">
|
|
53
47
|
{#if model.heading}
|
|
54
48
|
<div class="short-video-viewer__heading">
|
|
55
49
|
<ShortVideoHeading model={model.heading} localization={localization} />
|
|
@@ -60,6 +54,22 @@ $effect(() => {
|
|
|
60
54
|
<LineClamp value={model.text} maxLines={2} enableShowMore={true} />
|
|
61
55
|
{/if}
|
|
62
56
|
</div>
|
|
57
|
+
{#if uiManager.showAttachments}
|
|
58
|
+
<div class="short-video-viewer__attachments">
|
|
59
|
+
<AttachmentsHorizontal
|
|
60
|
+
model={model}
|
|
61
|
+
on={{
|
|
62
|
+
productClick: on?.productClick,
|
|
63
|
+
productImpression: on?.productImpression
|
|
64
|
+
}} />
|
|
65
|
+
</div>
|
|
66
|
+
{/if}
|
|
67
|
+
</div>
|
|
68
|
+
|
|
69
|
+
<div class="short-video-viewer__controls-panel" use:trackControlsPanelSize>
|
|
70
|
+
{#if uiManager.showControls}
|
|
71
|
+
<ShortVideoControls model={model} socialInteractionsHandler={socialInteractionsHandler} on={{ attachmentsClicked: uiManager.toggleEnableAttachments }} />
|
|
72
|
+
{/if}
|
|
63
73
|
</div>
|
|
64
74
|
</div>
|
|
65
75
|
|
|
@@ -79,64 +89,45 @@ $effect(() => {
|
|
|
79
89
|
width: 100%;
|
|
80
90
|
min-width: 100%;
|
|
81
91
|
max-width: 100%;
|
|
82
|
-
height: 100%;
|
|
83
|
-
min-height: 100%;
|
|
84
|
-
max-height: 100%;
|
|
85
|
-
position: relative;
|
|
86
|
-
}
|
|
87
|
-
.short-video-viewer__media {
|
|
88
92
|
height: 100%;
|
|
89
93
|
min-height: 100%;
|
|
90
94
|
max-height: 100%;
|
|
91
95
|
border-radius: 0.375rem;
|
|
92
96
|
overflow: hidden;
|
|
97
|
+
position: relative;
|
|
93
98
|
/* Set 'container-type: inline-size;' to reference container*/
|
|
94
99
|
}
|
|
95
100
|
@container (width < 576px) {
|
|
96
|
-
.short-video-
|
|
101
|
+
.short-video-viewer {
|
|
97
102
|
border-radius: 0;
|
|
98
103
|
position: relative;
|
|
99
104
|
}
|
|
100
105
|
}
|
|
101
|
-
.short-video-
|
|
106
|
+
.short-video-viewer__controls-panel {
|
|
102
107
|
position: absolute;
|
|
103
|
-
left:
|
|
104
|
-
|
|
105
|
-
|
|
108
|
+
left: auto;
|
|
109
|
+
right: 0.625rem;
|
|
110
|
+
top: 5rem;
|
|
111
|
+
bottom: 6.25rem;
|
|
106
112
|
gap: 2.5rem;
|
|
107
113
|
display: flex;
|
|
108
114
|
flex-direction: column;
|
|
109
115
|
justify-content: flex-end;
|
|
110
|
-
/* Set 'container-type: inline-size;' to reference container*/
|
|
111
|
-
}
|
|
112
|
-
@container (width < 576px) {
|
|
113
|
-
.short-video-viewer__actions-panel {
|
|
114
|
-
left: auto;
|
|
115
|
-
right: 0.625rem;
|
|
116
|
-
top: 5rem;
|
|
117
|
-
bottom: 5rem;
|
|
118
|
-
align-items: flex-end;
|
|
119
|
-
}
|
|
120
|
-
}
|
|
121
|
-
.short-video-viewer__actions-panel--inside-frame {
|
|
122
|
-
left: auto;
|
|
123
|
-
right: 0.625rem;
|
|
124
|
-
top: 5rem;
|
|
125
|
-
bottom: 5rem;
|
|
126
116
|
align-items: flex-end;
|
|
127
117
|
}
|
|
128
|
-
.short-video-
|
|
118
|
+
.short-video-viewer__information {
|
|
129
119
|
position: absolute;
|
|
130
120
|
bottom: 0;
|
|
131
121
|
left: 0;
|
|
132
122
|
right: 0;
|
|
133
|
-
padding: 1.875rem
|
|
134
|
-
padding-right: calc(1.25rem + var(--_short-video-viewer--button--size));
|
|
123
|
+
padding: 1.875rem 0;
|
|
135
124
|
background: linear-gradient(0deg, #000 0%, rgba(0, 0, 0, 0) 100%);
|
|
136
|
-
|
|
125
|
+
--_short-video-viewer--information--padding-horizontal: 1.25rem;
|
|
126
|
+
--_short-video-viewer--information--padding-right: calc(1.875rem + var(--_short-video-viewer--controls-panel--width));
|
|
137
127
|
}
|
|
138
128
|
.short-video-viewer__heading {
|
|
139
|
-
--short-video-heading--padding: 0
|
|
129
|
+
--short-video-heading--padding: 0 var(--_short-video-viewer--information--padding-right) 0.875rem
|
|
130
|
+
var(--_short-video-viewer--information--padding-horizontal);
|
|
140
131
|
--short-video-heading--text--color: #ffffff;
|
|
141
132
|
--short-video-heading--meta--color: #ffffff;
|
|
142
133
|
}
|
|
@@ -145,4 +136,9 @@ $effect(() => {
|
|
|
145
136
|
font-size: 1.125rem;
|
|
146
137
|
font-weight: 400;
|
|
147
138
|
text-shadow: 0 1px 0 rgba(0, 0, 0, 0.1), 0 1px 3px rgba(0, 0, 0, 0.1), 0 1px 6px rgba(0, 0, 0, 0.05);
|
|
139
|
+
padding: 0 var(--_short-video-viewer--information--padding-right) 0 var(--_short-video-viewer--information--padding-horizontal);
|
|
140
|
+
}
|
|
141
|
+
.short-video-viewer__attachments {
|
|
142
|
+
margin-top: 1.25rem;
|
|
143
|
+
--short-video-attachments-horizontal--padding-horizontal: var(--_short-video-viewer--information--padding-horizontal);
|
|
148
144
|
}</style>
|
|
@@ -12,8 +12,6 @@ type Props = {
|
|
|
12
12
|
progress?: (progress: number) => void;
|
|
13
13
|
productClick?: (productId: string) => void;
|
|
14
14
|
productImpression?: (productId: string, videoId: string) => void;
|
|
15
|
-
adClick?: (adId: string) => void;
|
|
16
|
-
adImpression?: (adId: string, videoId: string) => void;
|
|
17
15
|
};
|
|
18
16
|
};
|
|
19
17
|
declare const Cmp: import("svelte").Component<Props, {}, "">;
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
export { default as ShortVideoViewer } from './cmp.short-video-viewer.svelte';
|
|
2
2
|
export { default as ShortVideoControls } from './cmp.short-video-controls.svelte';
|
|
3
3
|
export { default as ShortVideoViewerAttachments } from './cmp.attachments.svelte';
|
|
4
|
-
export { default as ShortVideoViewerAttachmentsInline } from './cmp.attachments-inline.svelte';
|
|
5
4
|
export type { ShortVideoViewerModel, IPostSocialInteractionsHandler, ShortVideoAdCardModel, ShortVideoProductCardModel } from './types';
|
|
6
5
|
export type { IShortVideoViewerLocalization } from './short-video-viewer-localization';
|
|
7
6
|
export type { IShortVideoAttachmentsLocalization } from './short-video-attachments-localization';
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
export { default as ShortVideoViewer } from './cmp.short-video-viewer.svelte';
|
|
2
2
|
export { default as ShortVideoControls } from './cmp.short-video-controls.svelte';
|
|
3
3
|
export { default as ShortVideoViewerAttachments } from './cmp.attachments.svelte';
|
|
4
|
-
export { default as ShortVideoViewerAttachmentsInline } from './cmp.attachments-inline.svelte';
|
|
5
4
|
export { mapToShortVideoViewerModel } from './mapper';
|
|
@@ -33,7 +33,7 @@ type PromiseLike<T> = T | Promise<T>;
|
|
|
33
33
|
export type ShortVideoProductCardModel = {
|
|
34
34
|
id: string;
|
|
35
35
|
title: string;
|
|
36
|
-
shortDescription
|
|
36
|
+
shortDescription: string | null;
|
|
37
37
|
link: string | null;
|
|
38
38
|
image: string | null;
|
|
39
39
|
brandName: string | null;
|
|
@@ -2,11 +2,12 @@ export declare class ShortVideoViewerUiManager {
|
|
|
2
2
|
readonly globalCssVariables: string;
|
|
3
3
|
readonly showAttachments: boolean;
|
|
4
4
|
readonly showControls: boolean;
|
|
5
|
-
private
|
|
5
|
+
private controlsPanelWidht;
|
|
6
6
|
private canShowControls;
|
|
7
7
|
private canShowAttachments;
|
|
8
8
|
private enableAttachments;
|
|
9
9
|
updateCanShowAttachments: (value: boolean) => void;
|
|
10
10
|
updateCanShowControls: (value: boolean) => void;
|
|
11
11
|
toggleEnableAttachments: () => void;
|
|
12
|
+
setControlsPanelWidth(value: number): void;
|
|
12
13
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export class ShortVideoViewerUiManager {
|
|
2
2
|
globalCssVariables = $derived.by(() => {
|
|
3
|
-
const values = [`--_short-video-viewer--
|
|
3
|
+
const values = [`--_short-video-viewer--controls-panel--width: ${this.controlsPanelWidht}px`];
|
|
4
4
|
return values.join(';');
|
|
5
5
|
});
|
|
6
6
|
showAttachments = $derived.by(() => {
|
|
@@ -9,7 +9,7 @@ export class ShortVideoViewerUiManager {
|
|
|
9
9
|
showControls = $derived.by(() => {
|
|
10
10
|
return this.canShowControls;
|
|
11
11
|
});
|
|
12
|
-
|
|
12
|
+
controlsPanelWidht = $state(0);
|
|
13
13
|
// is provided from the calling side
|
|
14
14
|
canShowControls = $state(false);
|
|
15
15
|
// is provided from the calling side
|
|
@@ -25,4 +25,7 @@ export class ShortVideoViewerUiManager {
|
|
|
25
25
|
toggleEnableAttachments = () => {
|
|
26
26
|
this.enableAttachments = !this.enableAttachments;
|
|
27
27
|
};
|
|
28
|
+
setControlsPanelWidth(value) {
|
|
29
|
+
this.controlsPanelWidht = value;
|
|
30
|
+
}
|
|
28
31
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<script lang="ts">import { slideHorizontally } from '../../core/transitions';
|
|
2
|
-
import { ShortVideoControls, ShortVideoViewerAttachments
|
|
2
|
+
import { ShortVideoControls, ShortVideoViewerAttachments } from '../short-video-viewer';
|
|
3
3
|
import { Icon } from '../../ui/icon';
|
|
4
4
|
import { ShortVideosPlayerLocalization } from './short-videos-player-localization';
|
|
5
5
|
import IconChevronDown from '@fluentui/svg-icons/icons/chevron_down_20_regular.svg?raw';
|
|
@@ -10,59 +10,74 @@ const shortVideo = $derived(buffer.current);
|
|
|
10
10
|
const changeShowAttachments = () => {
|
|
11
11
|
uiManager.showAttachments = !uiManager.showAttachments;
|
|
12
12
|
};
|
|
13
|
+
const trackAttachmentsPanelSize = (node) => {
|
|
14
|
+
const resizeObserver = new ResizeObserver(([entry]) => {
|
|
15
|
+
const width = entry.contentRect.width;
|
|
16
|
+
uiManager.setAttachmentsPanelWidth(width);
|
|
17
|
+
});
|
|
18
|
+
resizeObserver.observe(node);
|
|
19
|
+
return {
|
|
20
|
+
destroy() {
|
|
21
|
+
resizeObserver.unobserve(node);
|
|
22
|
+
}
|
|
23
|
+
};
|
|
24
|
+
};
|
|
25
|
+
const trackNavigationButtonsSize = (node) => {
|
|
26
|
+
const resizeObserver = new ResizeObserver(([entry]) => {
|
|
27
|
+
const width = entry.contentRect.width;
|
|
28
|
+
uiManager.setNavigationButtonsBlockWidth(width);
|
|
29
|
+
});
|
|
30
|
+
resizeObserver.observe(node);
|
|
31
|
+
return {
|
|
32
|
+
destroy() {
|
|
33
|
+
resizeObserver.unobserve(node);
|
|
34
|
+
}
|
|
35
|
+
};
|
|
36
|
+
};
|
|
13
37
|
</script>
|
|
14
38
|
|
|
15
|
-
{#if uiManager.viewInitialized && !uiManager.
|
|
39
|
+
{#if uiManager.viewInitialized && (!uiManager.showShortVideoOverlayAttachments || !uiManager.showShortVideoOverlayControls)}
|
|
16
40
|
<div class="short-videos-player-controls" class:short-videos-player-controls--with-logo={!!playerLogo}>
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
<
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
41
|
+
{#if !uiManager.showShortVideoOverlayControls}
|
|
42
|
+
<div class="short-videos-player-controls__left">
|
|
43
|
+
{#if shortVideo}
|
|
44
|
+
<div class="short-videos-player-controls__short-video-controls">
|
|
45
|
+
<ShortVideoControls model={shortVideo} socialInteractionsHandler={socialInteractionsHandler} on={{ attachmentsClicked: changeShowAttachments }} />
|
|
46
|
+
</div>
|
|
47
|
+
{/if}
|
|
48
|
+
<div class="short-videos-player-controls__navigation-buttons" use:trackNavigationButtonsSize>
|
|
49
|
+
<button type="button" class="navigation-button" disabled={!buffer.canLoadPrevious} onclick={buffer.loadPrevious}>
|
|
50
|
+
<span class="navigation-button__icon">
|
|
51
|
+
<Icon src={IconChevronUp} />
|
|
52
|
+
</span>
|
|
53
|
+
</button>
|
|
54
|
+
<button type="button" class="navigation-button" disabled={!buffer.canLoadNext} onclick={buffer.loadNext}>
|
|
55
|
+
<span class="navigation-button__icon">
|
|
56
|
+
<Icon src={IconChevronDown} />
|
|
57
|
+
</span>
|
|
58
|
+
</button>
|
|
33
59
|
</div>
|
|
34
|
-
{/if}
|
|
35
|
-
<div class="short-videos-player-controls__navigation-buttons">
|
|
36
|
-
<button type="button" class="navigation-button" disabled={!buffer.canLoadPrevious} onclick={buffer.loadPrevious}>
|
|
37
|
-
<span class="navigation-button__icon">
|
|
38
|
-
<Icon src={IconChevronUp} />
|
|
39
|
-
</span>
|
|
40
|
-
</button>
|
|
41
|
-
<button type="button" class="navigation-button" disabled={!buffer.canLoadNext} onclick={buffer.loadNext}>
|
|
42
|
-
<span class="navigation-button__icon">
|
|
43
|
-
<Icon src={IconChevronDown} />
|
|
44
|
-
</span>
|
|
45
|
-
</button>
|
|
46
60
|
</div>
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
61
|
+
{/if}
|
|
62
|
+
|
|
63
|
+
<div class="short-videos-player-controls__right" use:trackAttachmentsPanelSize>
|
|
64
|
+
{#if !uiManager.showShortVideoOverlayAttachments}
|
|
65
|
+
{#if playerLogo}
|
|
66
|
+
<div class="short-videos-player-controls__player-logo">
|
|
67
|
+
<img src={playerLogo} class="short-videos-player-controls__logo-img" alt="Player Logo" />
|
|
68
|
+
</div>
|
|
69
|
+
{/if}
|
|
70
|
+
{#if shortVideo?.hasAttachments && uiManager.showAttachments}
|
|
71
|
+
<div class="short-videos-player-controls__short-video-attachments" transition:slideHorizontally|local>
|
|
72
|
+
<ShortVideoViewerAttachments
|
|
73
|
+
shortVideo={shortVideo}
|
|
74
|
+
localization={localization.shortVideoAttachmentsLocalization}
|
|
75
|
+
on={{
|
|
76
|
+
productClick: on.productClick,
|
|
77
|
+
productImpression: on.productImpression
|
|
78
|
+
}} />
|
|
79
|
+
</div>
|
|
80
|
+
{/if}
|
|
66
81
|
{/if}
|
|
67
82
|
</div>
|
|
68
83
|
</div>
|
|
@@ -124,8 +139,7 @@ const changeShowAttachments = () => {
|
|
|
124
139
|
.short-videos-player-controls__right::-webkit-scrollbar {
|
|
125
140
|
width: 3px;
|
|
126
141
|
height: 3px;
|
|
127
|
-
background:
|
|
128
|
-
visibility: hidden;
|
|
142
|
+
background: transparent;
|
|
129
143
|
}
|
|
130
144
|
.short-videos-player-controls__right::-webkit-scrollbar-thumb {
|
|
131
145
|
background: transparent;
|
|
@@ -138,12 +152,11 @@ const changeShowAttachments = () => {
|
|
|
138
152
|
width: 3px;
|
|
139
153
|
height: 3px;
|
|
140
154
|
background: var(--custom-scrollbar-background, transparent);
|
|
141
|
-
visibility: hidden;
|
|
142
155
|
}
|
|
143
156
|
.short-videos-player-controls__right:hover::-webkit-scrollbar-thumb {
|
|
144
157
|
background: var(--custom-scrollbar-color, #7d7d7d);
|
|
145
158
|
}
|
|
146
|
-
.short-videos-player-controls__short-video-
|
|
159
|
+
.short-videos-player-controls__short-video-controls {
|
|
147
160
|
gap: 2.5rem;
|
|
148
161
|
display: flex;
|
|
149
162
|
flex: 1;
|
|
@@ -151,50 +164,29 @@ const changeShowAttachments = () => {
|
|
|
151
164
|
flex-direction: column;
|
|
152
165
|
align-items: flex-start;
|
|
153
166
|
justify-content: flex-end;
|
|
154
|
-
--short-video-controls--icon--size:
|
|
167
|
+
--short-video-controls--icon--size: 1.75rem;
|
|
155
168
|
}
|
|
156
169
|
.short-videos-player-controls__player-logo {
|
|
157
|
-
width:
|
|
158
|
-
max-width:
|
|
170
|
+
width: var(--short-videos-player--controls--attachments--max-width);
|
|
171
|
+
max-width: var(--short-videos-player--controls--attachments--max-width);
|
|
159
172
|
height: var(--short-videos-player--media-center-header--height);
|
|
160
173
|
min-height: var(--short-videos-player--media-center-header--height);
|
|
161
174
|
max-height: var(--short-videos-player--media-center-header--height);
|
|
162
175
|
display: flex;
|
|
163
176
|
justify-content: center;
|
|
164
177
|
align-items: center;
|
|
165
|
-
/* Set 'container-type: inline-size;' to reference container*/
|
|
166
|
-
}
|
|
167
|
-
@container (width < calc(11rem + 3.75rem)) {
|
|
168
|
-
.short-videos-player-controls__player-logo {
|
|
169
|
-
display: none;
|
|
170
|
-
}
|
|
171
178
|
}
|
|
172
179
|
.short-videos-player-controls__logo-img {
|
|
173
180
|
width: 6.25rem;
|
|
174
181
|
min-width: 6.25rem;
|
|
175
182
|
max-width: 6.25rem;
|
|
176
183
|
}
|
|
177
|
-
.short-videos-player-controls__short-video-attachments-inline {
|
|
178
|
-
display: none;
|
|
179
|
-
/* Set 'container-type: inline-size;' to reference container*/
|
|
180
|
-
}
|
|
181
|
-
@container (width < calc(11rem + 3.75rem)) {
|
|
182
|
-
.short-videos-player-controls__short-video-attachments-inline {
|
|
183
|
-
display: contents;
|
|
184
|
-
}
|
|
185
|
-
}
|
|
186
184
|
.short-videos-player-controls__short-video-attachments {
|
|
187
185
|
flex: 1;
|
|
188
|
-
width:
|
|
189
|
-
max-width:
|
|
186
|
+
width: var(--short-videos-player--controls--attachments--max-width);
|
|
187
|
+
max-width: var(--short-videos-player--controls--attachments--max-width);
|
|
190
188
|
opacity: var(--short-videos-player--elements-opacity);
|
|
191
189
|
transition: opacity 0.3s ease-in-out;
|
|
192
|
-
/* Set 'container-type: inline-size;' to reference container*/
|
|
193
|
-
}
|
|
194
|
-
@container (width < calc(11rem + 3.75rem)) {
|
|
195
|
-
.short-videos-player-controls__short-video-attachments {
|
|
196
|
-
display: none;
|
|
197
|
-
}
|
|
198
190
|
}
|
|
199
191
|
.short-videos-player-controls__navigation-buttons {
|
|
200
192
|
display: flex;
|
|
@@ -205,18 +197,18 @@ const changeShowAttachments = () => {
|
|
|
205
197
|
}
|
|
206
198
|
|
|
207
199
|
.close-button {
|
|
208
|
-
width:
|
|
209
|
-
min-width:
|
|
210
|
-
max-width:
|
|
211
|
-
height:
|
|
212
|
-
min-height:
|
|
213
|
-
max-height:
|
|
200
|
+
width: 3rem;
|
|
201
|
+
min-width: 3rem;
|
|
202
|
+
max-width: 3rem;
|
|
203
|
+
height: 3rem;
|
|
204
|
+
min-height: 3rem;
|
|
205
|
+
max-height: 3rem;
|
|
214
206
|
background-color: rgba(0, 0, 0, 0.6);
|
|
215
207
|
border: 1px solid #1c1c1c;
|
|
216
208
|
border-radius: 50%;
|
|
217
209
|
text-align: center;
|
|
218
210
|
--icon--color: #ffffff;
|
|
219
|
-
--icon--size:
|
|
211
|
+
--icon--size: 1.75rem;
|
|
220
212
|
position: absolute;
|
|
221
213
|
top: 0.9375rem;
|
|
222
214
|
left: 0.625rem;
|
|
@@ -240,18 +232,18 @@ const changeShowAttachments = () => {
|
|
|
240
232
|
|
|
241
233
|
.navigation-button {
|
|
242
234
|
--_icon-scale: 1;
|
|
243
|
-
width:
|
|
244
|
-
min-width:
|
|
245
|
-
max-width:
|
|
246
|
-
height:
|
|
247
|
-
min-height:
|
|
248
|
-
max-height:
|
|
235
|
+
width: 3rem;
|
|
236
|
+
min-width: 3rem;
|
|
237
|
+
max-width: 3rem;
|
|
238
|
+
height: 3rem;
|
|
239
|
+
min-height: 3rem;
|
|
240
|
+
max-height: 3rem;
|
|
249
241
|
background-color: rgba(0, 0, 0, 0.6);
|
|
250
242
|
border: 1px solid #1c1c1c;
|
|
251
243
|
border-radius: 50%;
|
|
252
244
|
text-align: center;
|
|
253
245
|
--icon--color: #ffffff;
|
|
254
|
-
--icon--size:
|
|
246
|
+
--icon--size: 1.75rem;
|
|
255
247
|
}
|
|
256
248
|
.navigation-button:disabled {
|
|
257
249
|
opacity: 0.5;
|
|
@@ -13,8 +13,6 @@ type Props = {
|
|
|
13
13
|
closePlayer?: () => void;
|
|
14
14
|
productClick?: (productId: string) => void;
|
|
15
15
|
productImpression?: (productId: string, videoId: string) => void;
|
|
16
|
-
adClick?: (adId: string) => void;
|
|
17
|
-
adImpression?: (adId: string, videoId: string) => void;
|
|
18
16
|
};
|
|
19
17
|
};
|
|
20
18
|
declare const Controls: import("svelte").Component<Props, {}, "">;
|
|
@@ -5,6 +5,4 @@ export declare class InternalShortVideoAnalyticsHandler implements IShortVideoAn
|
|
|
5
5
|
trackShortVideoView: (videoId: string) => void;
|
|
6
6
|
trackShortVideoProductImpression: (productId: string, videoId: string) => void;
|
|
7
7
|
trackShortVideoProductClick: (productId: string, videoId: string) => void;
|
|
8
|
-
trackAdImpression: (adId: string) => void;
|
|
9
|
-
trackAdClick: (adId: string) => void;
|
|
10
8
|
}
|
|
@@ -10,6 +10,4 @@ export class InternalShortVideoAnalyticsHandler {
|
|
|
10
10
|
trackShortVideoView = (videoId) => AppEventsTracker.trackShortVideoView(videoId);
|
|
11
11
|
trackShortVideoProductImpression = (productId, videoId) => AppEventsTracker.trackShortVideoProductImpression(productId, videoId);
|
|
12
12
|
trackShortVideoProductClick = (productId, videoId) => AppEventsTracker.trackShortVideoProductClick(productId, videoId);
|
|
13
|
-
trackAdImpression = (adId) => AppEventsTracker.trackAdImpression(adId);
|
|
14
|
-
trackAdClick = (adId) => AppEventsTracker.trackAdClick(adId);
|
|
15
13
|
}
|
|
@@ -97,12 +97,6 @@ const onShortVideoProductClick = (productId, videoId) => {
|
|
|
97
97
|
const onShortVideoProductImpression = (productId, videoId) => {
|
|
98
98
|
analyticsHandler === null || analyticsHandler === void 0 ? void 0 : analyticsHandler.trackShortVideoProductImpression(productId, videoId);
|
|
99
99
|
};
|
|
100
|
-
const onShortVideoAdClick = (adId) => {
|
|
101
|
-
analyticsHandler === null || analyticsHandler === void 0 ? void 0 : analyticsHandler.trackAdClick(adId);
|
|
102
|
-
};
|
|
103
|
-
const onShortVideoAdImpression = (adId, videoId) => {
|
|
104
|
-
analyticsHandler === null || analyticsHandler === void 0 ? void 0 : analyticsHandler.trackAdImpression(adId);
|
|
105
|
-
};
|
|
106
100
|
</script>
|
|
107
101
|
|
|
108
102
|
<svelte:document onkeydown={(e) => handleEsc(e, onPlayerClose)} />
|
|
@@ -141,14 +135,12 @@ const onShortVideoAdImpression = (adId, videoId) => {
|
|
|
141
135
|
model={item}
|
|
142
136
|
socialInteractionsHandler={socialInteractionsHandler}
|
|
143
137
|
autoplay="on-appearance"
|
|
144
|
-
showAttachments={uiManager.
|
|
145
|
-
showControls={uiManager.
|
|
138
|
+
showAttachments={uiManager.showShortVideoOverlayAttachments}
|
|
139
|
+
showControls={uiManager.showShortVideoOverlayControls}
|
|
146
140
|
localization={localization.shortVideoViewerLocalization}
|
|
147
141
|
on={{
|
|
148
142
|
productClick: (productId) => onShortVideoProductClick(productId, item.id),
|
|
149
|
-
productImpression: (productId, videoId) => onShortVideoProductImpression(productId, videoId)
|
|
150
|
-
adClick: (adId) => onShortVideoAdClick(adId),
|
|
151
|
-
adImpression: (adId, videoId) => onShortVideoAdImpression(adId, videoId)
|
|
143
|
+
productImpression: (productId, videoId) => onShortVideoProductImpression(productId, videoId)
|
|
152
144
|
}} />
|
|
153
145
|
{/snippet}
|
|
154
146
|
</PlayerSlider>
|
|
@@ -166,9 +158,7 @@ const onShortVideoAdImpression = (adId, videoId) => {
|
|
|
166
158
|
on={{
|
|
167
159
|
closePlayer: on?.playerClosed,
|
|
168
160
|
productClick: (productId) => onShortVideoProductClick(productId, buffer?.current?.id || ''),
|
|
169
|
-
productImpression: onShortVideoProductImpression
|
|
170
|
-
adClick: (adId) => onShortVideoAdClick(adId),
|
|
171
|
-
adImpression: onShortVideoAdImpression
|
|
161
|
+
productImpression: onShortVideoProductImpression
|
|
172
162
|
}} />
|
|
173
163
|
{:else}
|
|
174
164
|
<Loading positionFixedCenter={true} timeout={1000} />
|
|
@@ -7,8 +7,6 @@ export interface IShortVideoAnalyticsHandler {
|
|
|
7
7
|
trackShortVideoView: (videoId: string) => void;
|
|
8
8
|
trackShortVideoProductImpression: (productId: string, videoId: string) => void;
|
|
9
9
|
trackShortVideoProductClick: (productId: string, videoId: string) => void;
|
|
10
|
-
trackAdImpression: (adId: string) => void;
|
|
11
|
-
trackAdClick: (adId: string) => void;
|
|
12
10
|
}
|
|
13
11
|
export type ShortVideoPlayerModel = ShortVideoViewerModel & {
|
|
14
12
|
analyticsOrganizationId: string | null;
|
|
@@ -3,10 +3,15 @@ export declare class ShortVideosPlayerUiManager {
|
|
|
3
3
|
globalCssVariables: string;
|
|
4
4
|
isMobileView: boolean;
|
|
5
5
|
viewInitialized: boolean;
|
|
6
|
-
|
|
6
|
+
showShortVideoOverlayAttachments: boolean;
|
|
7
|
+
showShortVideoOverlayControls: boolean;
|
|
7
8
|
private _viewTotalWidth;
|
|
8
9
|
private _mainViewColumnWidth;
|
|
9
10
|
private _mediaCenterHeaderHeight;
|
|
11
|
+
private _controlsAttachmentsPanelWidth;
|
|
12
|
+
private _controlsNavitagionButtonsWidth;
|
|
13
|
+
private _controlsAvailableSpace;
|
|
14
|
+
private _controlsContentWidth;
|
|
10
15
|
get viewTotalWidth(): number;
|
|
11
16
|
get mainViewColumnWidth(): number;
|
|
12
17
|
updateDimensions: (dimensions: {
|
|
@@ -14,4 +19,6 @@ export declare class ShortVideosPlayerUiManager {
|
|
|
14
19
|
mainViewColumnWidth: number;
|
|
15
20
|
}) => void;
|
|
16
21
|
updateMediaCenterHeaderHeight: (height: number) => void;
|
|
22
|
+
setAttachmentsPanelWidth: (width: number) => void;
|
|
23
|
+
setNavigationButtonsBlockWidth: (width: number) => void;
|
|
17
24
|
}
|