@streamscloud/embeddable 6.4.2 → 6.5.0-1758183492920
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 +3 -5
- 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 +224 -0
- package/dist/short-videos/short-video-viewer/cmp.short-video-viewer.svelte +63 -65
- 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 -84
- package/dist/short-videos/short-videos-player/short-videos-player-view.svelte +2 -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 -94
- package/dist/streams/stream-player/controls.svelte.d.ts +1 -0
- package/dist/streams/stream-player/fade-mixins.scss +12 -0
- package/dist/streams/stream-player/stream-overview.svelte +1 -3
- package/dist/streams/stream-player/stream-player.svelte +22 -3
- package/dist/streams/stream-player/stream-player.svelte.d.ts +12 -1
- 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 -133
- /package/dist/short-videos/short-video-viewer/{cmp.attachments-inline.svelte.d.ts → cmp.attachments-horizontal.svelte.d.ts} +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
<script lang="ts">var _a, _b;
|
|
2
2
|
import { slideHorizontally } from '../../core/transitions';
|
|
3
|
-
import {
|
|
3
|
+
import { ShortVideoViewerAttachments } from '../../short-videos/short-video-viewer';
|
|
4
4
|
import { ShortVideoControls } from '../../short-videos/short-video-viewer/index.js';
|
|
5
5
|
import { StreamElementType } from '../layout/enums';
|
|
6
6
|
import { mapToShortVideoViewerModel } from '../layout/models';
|
|
@@ -9,7 +9,7 @@ import { StreamPlayerLocalization } from './stream-player-localization';
|
|
|
9
9
|
import IconChevronDown from '@fluentui/svg-icons/icons/chevron_down_28_regular.svg?raw';
|
|
10
10
|
import IconChevronUp from '@fluentui/svg-icons/icons/chevron_up_28_regular.svg?raw';
|
|
11
11
|
import IconDismiss from '@fluentui/svg-icons/icons/dismiss_28_regular.svg?raw';
|
|
12
|
-
let { buffer, uiManager, postSocialInteractionsHandler, localization, on } = $props();
|
|
12
|
+
let { buffer, uiManager, postSocialInteractionsHandler, localization, on, playerLogo } = $props();
|
|
13
13
|
const shortVideo = $derived(((_a = buffer.current) === null || _a === void 0 ? void 0 : _a.type) === 'short-video' && ((_b = buffer.current) === null || _b === void 0 ? void 0 : _b.shortVideo) ? mapToShortVideoViewerModel(buffer.current.shortVideo) : null);
|
|
14
14
|
const singleWebViewPage = $derived.by(() => {
|
|
15
15
|
var _a;
|
|
@@ -44,48 +44,79 @@ const singleWebViewPage = $derived.by(() => {
|
|
|
44
44
|
const changeShowShortVideoAttachments = () => {
|
|
45
45
|
uiManager.showShortVideoAttachments = !uiManager.showShortVideoAttachments;
|
|
46
46
|
};
|
|
47
|
+
const trackAttachmentsPanelSize = (node) => {
|
|
48
|
+
const resizeObserver = new ResizeObserver(([entry]) => {
|
|
49
|
+
const width = entry.contentRect.width;
|
|
50
|
+
uiManager.setAttachmentsPanelWidth(width);
|
|
51
|
+
});
|
|
52
|
+
resizeObserver.observe(node);
|
|
53
|
+
return {
|
|
54
|
+
destroy() {
|
|
55
|
+
resizeObserver.unobserve(node);
|
|
56
|
+
}
|
|
57
|
+
};
|
|
58
|
+
};
|
|
59
|
+
const trackNavigationButtonsSize = (node) => {
|
|
60
|
+
const resizeObserver = new ResizeObserver(([entry]) => {
|
|
61
|
+
const width = entry.contentRect.width;
|
|
62
|
+
uiManager.setNavigationButtonsBlockWidth(width);
|
|
63
|
+
});
|
|
64
|
+
resizeObserver.observe(node);
|
|
65
|
+
return {
|
|
66
|
+
destroy() {
|
|
67
|
+
resizeObserver.unobserve(node);
|
|
68
|
+
}
|
|
69
|
+
};
|
|
70
|
+
};
|
|
47
71
|
</script>
|
|
48
72
|
|
|
49
|
-
{#if uiManager.viewInitialized && !uiManager.
|
|
50
|
-
<div class="stream-player-controls">
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
<
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
73
|
+
{#if uiManager.viewInitialized && (!uiManager.showShortVideoOverlayAttachments || !uiManager.showShortVideoOverlayControls)}
|
|
74
|
+
<div class="stream-player-controls" class:stream-player-controls--with-logo={!!playerLogo}>
|
|
75
|
+
{#if !uiManager.showShortVideoOverlayControls}
|
|
76
|
+
<div class="stream-player-controls__left">
|
|
77
|
+
{#if shortVideo}
|
|
78
|
+
<div class="stream-player-controls__short-video-controls">
|
|
79
|
+
<ShortVideoControls
|
|
80
|
+
model={shortVideo}
|
|
81
|
+
socialInteractionsHandler={postSocialInteractionsHandler}
|
|
82
|
+
on={{ attachmentsClicked: changeShowShortVideoAttachments }} />
|
|
83
|
+
</div>
|
|
84
|
+
{/if}
|
|
85
|
+
<div
|
|
86
|
+
class="stream-player-controls__navigation-buttons"
|
|
87
|
+
class:stream-player-controls__navigation-buttons--single-web-view-page={singleWebViewPage}
|
|
88
|
+
use:trackNavigationButtonsSize>
|
|
89
|
+
<button type="button" class="navigation-button" disabled={!buffer.canLoadPrevious} onclick={buffer.loadPrevious}>
|
|
90
|
+
<span class="navigation-button__icon">
|
|
91
|
+
<Icon src={IconChevronUp} />
|
|
92
|
+
</span>
|
|
93
|
+
</button>
|
|
94
|
+
<button type="button" class="navigation-button" disabled={!buffer.canLoadNext} onclick={buffer.loadNext}>
|
|
95
|
+
<span class="navigation-button__icon">
|
|
96
|
+
<Icon src={IconChevronDown} />
|
|
97
|
+
</span>
|
|
98
|
+
</button>
|
|
63
99
|
</div>
|
|
64
|
-
{/if}
|
|
65
|
-
<div class="stream-player-controls__navigation-buttons" class:stream-player-controls__navigation-buttons--single-web-view-page={singleWebViewPage}>
|
|
66
|
-
<button type="button" class="navigation-button" disabled={!buffer.canLoadPrevious} onclick={buffer.loadPrevious}>
|
|
67
|
-
<span class="navigation-button__icon">
|
|
68
|
-
<Icon src={IconChevronUp} />
|
|
69
|
-
</span>
|
|
70
|
-
</button>
|
|
71
|
-
<button type="button" class="navigation-button" disabled={!buffer.canLoadNext} onclick={buffer.loadNext}>
|
|
72
|
-
<span class="navigation-button__icon">
|
|
73
|
-
<Icon src={IconChevronDown} />
|
|
74
|
-
</span>
|
|
75
|
-
</button>
|
|
76
100
|
</div>
|
|
77
|
-
|
|
78
|
-
<div class="stream-player-controls__right">
|
|
79
|
-
{#if
|
|
80
|
-
|
|
81
|
-
<
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
101
|
+
{/if}
|
|
102
|
+
<div class="stream-player-controls__right" use:trackAttachmentsPanelSize>
|
|
103
|
+
{#if !uiManager.showShortVideoOverlayAttachments}
|
|
104
|
+
{#if playerLogo}
|
|
105
|
+
<div class="stream-player-controls__player-logo">
|
|
106
|
+
<img src={playerLogo} class="stream-player-controls__logo-img" alt="Player Logo" />
|
|
107
|
+
</div>
|
|
108
|
+
{/if}
|
|
109
|
+
{#if shortVideo?.hasAttachments && uiManager.showShortVideoAttachments}
|
|
110
|
+
<div class="stream-player-controls__short-video-attachments" transition:slideHorizontally|local>
|
|
111
|
+
<ShortVideoViewerAttachments
|
|
112
|
+
shortVideo={shortVideo}
|
|
113
|
+
localization={localization.shortVideoAttachmentsLocalization}
|
|
114
|
+
on={{
|
|
115
|
+
productClick: on.productClick,
|
|
116
|
+
productImpression: on.productImpression
|
|
117
|
+
}} />
|
|
118
|
+
</div>
|
|
119
|
+
{/if}
|
|
89
120
|
{/if}
|
|
90
121
|
</div>
|
|
91
122
|
</div>
|
|
@@ -111,18 +142,24 @@ const changeShowShortVideoAttachments = () => {
|
|
|
111
142
|
top: 0;
|
|
112
143
|
right: 0;
|
|
113
144
|
height: 100%;
|
|
114
|
-
width: var(--stream-player--
|
|
145
|
+
width: var(--stream-player--controls--available-space);
|
|
115
146
|
display: flex;
|
|
116
147
|
justify-content: space-between;
|
|
117
|
-
padding: var(--stream-player--controls--
|
|
148
|
+
padding: var(--stream-player--controls--padding);
|
|
118
149
|
container-type: inline-size;
|
|
119
150
|
}
|
|
151
|
+
.stream-player-controls--with-logo {
|
|
152
|
+
padding-top: 0;
|
|
153
|
+
}
|
|
120
154
|
.stream-player-controls__left {
|
|
121
155
|
display: flex;
|
|
122
156
|
flex-direction: column;
|
|
123
157
|
gap: 2.3125rem;
|
|
124
158
|
justify-content: flex-end;
|
|
125
159
|
align-items: center;
|
|
160
|
+
padding-top: var(--stream-player--media-center-header--height);
|
|
161
|
+
opacity: var(--stream-player--elements-opacity);
|
|
162
|
+
transition: opacity 0.3s ease-in-out;
|
|
126
163
|
}
|
|
127
164
|
.stream-player-controls__right {
|
|
128
165
|
flex: 1;
|
|
@@ -130,63 +167,63 @@ const changeShowShortVideoAttachments = () => {
|
|
|
130
167
|
justify-content: space-between;
|
|
131
168
|
align-items: flex-end;
|
|
132
169
|
flex-direction: column;
|
|
133
|
-
scrollbar-gutter: stable;
|
|
134
|
-
}
|
|
135
|
-
.stream-player-controls__short-video-hub {
|
|
136
|
-
gap: 2.5rem;
|
|
137
|
-
display: flex;
|
|
138
|
-
flex: 1;
|
|
139
|
-
min-height: 0;
|
|
140
|
-
flex-direction: column;
|
|
141
|
-
align-items: flex-start;
|
|
142
|
-
justify-content: flex-end;
|
|
143
|
-
--short-video-controls--icon--size: var(--stream-player--icon--size);
|
|
144
|
-
}
|
|
145
|
-
.stream-player-controls__short-video-attachments-inline {
|
|
146
|
-
display: none;
|
|
147
|
-
/* Set 'container-type: inline-size;' to reference container*/
|
|
148
|
-
}
|
|
149
|
-
@container (width < calc(11rem + 3.75rem)) {
|
|
150
|
-
.stream-player-controls__short-video-attachments-inline {
|
|
151
|
-
display: contents;
|
|
152
|
-
}
|
|
153
|
-
}
|
|
154
|
-
.stream-player-controls__short-video-attachments {
|
|
155
|
-
flex: 1;
|
|
156
170
|
overflow-x: hidden;
|
|
157
171
|
overflow-y: auto;
|
|
158
172
|
scrollbar-color: transparent transparent;
|
|
159
173
|
scrollbar-width: thin;
|
|
160
|
-
|
|
161
|
-
max-width: 11rem;
|
|
162
|
-
/* Set 'container-type: inline-size;' to reference container*/
|
|
174
|
+
scrollbar-gutter: stable;
|
|
163
175
|
}
|
|
164
|
-
.stream-player-
|
|
176
|
+
.stream-player-controls__right::-webkit-scrollbar {
|
|
165
177
|
width: 3px;
|
|
166
178
|
height: 3px;
|
|
167
|
-
background:
|
|
168
|
-
visibility: hidden;
|
|
179
|
+
background: transparent;
|
|
169
180
|
}
|
|
170
|
-
.stream-player-
|
|
181
|
+
.stream-player-controls__right::-webkit-scrollbar-thumb {
|
|
171
182
|
background: transparent;
|
|
172
183
|
}
|
|
173
|
-
.stream-player-
|
|
184
|
+
.stream-player-controls__right:hover {
|
|
174
185
|
scrollbar-color: var(--custom-scrollbar-color, #7d7d7d) var(--custom-scrollbar-background, transparent);
|
|
175
186
|
scrollbar-width: thin;
|
|
176
187
|
}
|
|
177
|
-
.stream-player-
|
|
188
|
+
.stream-player-controls__right:hover::-webkit-scrollbar {
|
|
178
189
|
width: 3px;
|
|
179
190
|
height: 3px;
|
|
180
191
|
background: var(--custom-scrollbar-background, transparent);
|
|
181
|
-
visibility: hidden;
|
|
182
192
|
}
|
|
183
|
-
.stream-player-
|
|
193
|
+
.stream-player-controls__right:hover::-webkit-scrollbar-thumb {
|
|
184
194
|
background: var(--custom-scrollbar-color, #7d7d7d);
|
|
185
195
|
}
|
|
186
|
-
|
|
187
|
-
.
|
|
188
|
-
|
|
189
|
-
|
|
196
|
+
.stream-player-controls__short-video-controls {
|
|
197
|
+
gap: 2.5rem;
|
|
198
|
+
display: flex;
|
|
199
|
+
flex: 1;
|
|
200
|
+
min-height: 0;
|
|
201
|
+
flex-direction: column;
|
|
202
|
+
align-items: flex-start;
|
|
203
|
+
justify-content: flex-end;
|
|
204
|
+
--short-video-controls--icon--size: 1.75rem;
|
|
205
|
+
}
|
|
206
|
+
.stream-player-controls__player-logo {
|
|
207
|
+
width: var(--stream-player--controls--attachments--max-width);
|
|
208
|
+
max-width: var(--stream-player--controls--attachments--max-width);
|
|
209
|
+
height: var(--stream-player--media-center-header--height);
|
|
210
|
+
min-height: var(--stream-player--media-center-header--height);
|
|
211
|
+
max-height: var(--stream-player--media-center-header--height);
|
|
212
|
+
display: flex;
|
|
213
|
+
justify-content: center;
|
|
214
|
+
align-items: center;
|
|
215
|
+
}
|
|
216
|
+
.stream-player-controls__logo-img {
|
|
217
|
+
width: 6.25rem;
|
|
218
|
+
min-width: 6.25rem;
|
|
219
|
+
max-width: 6.25rem;
|
|
220
|
+
}
|
|
221
|
+
.stream-player-controls__short-video-attachments {
|
|
222
|
+
flex: 1;
|
|
223
|
+
width: var(--stream-player--controls--attachments--max-width);
|
|
224
|
+
max-width: var(--stream-player--controls--attachments--max-width);
|
|
225
|
+
opacity: var(--stream-player--elements-opacity);
|
|
226
|
+
transition: opacity 0.3s ease-in-out;
|
|
190
227
|
}
|
|
191
228
|
.stream-player-controls__navigation-buttons {
|
|
192
229
|
display: flex;
|
|
@@ -196,18 +233,18 @@ const changeShowShortVideoAttachments = () => {
|
|
|
196
233
|
}
|
|
197
234
|
|
|
198
235
|
.close-button {
|
|
199
|
-
width:
|
|
200
|
-
min-width:
|
|
201
|
-
max-width:
|
|
202
|
-
height:
|
|
203
|
-
min-height:
|
|
204
|
-
max-height:
|
|
236
|
+
width: 3rem;
|
|
237
|
+
min-width: 3rem;
|
|
238
|
+
max-width: 3rem;
|
|
239
|
+
height: 3rem;
|
|
240
|
+
min-height: 3rem;
|
|
241
|
+
max-height: 3rem;
|
|
205
242
|
background-color: rgba(0, 0, 0, 0.6);
|
|
206
243
|
border: 0.0625rem solid #1c1c1c;
|
|
207
244
|
border-radius: 50%;
|
|
208
245
|
text-align: center;
|
|
209
246
|
--icon--color: #ffffff;
|
|
210
|
-
--icon--size:
|
|
247
|
+
--icon--size: 1.75rem;
|
|
211
248
|
position: absolute;
|
|
212
249
|
top: 0.9375rem;
|
|
213
250
|
left: calc(var(--stream-player--overview--width) + 0.625rem);
|
|
@@ -231,18 +268,18 @@ const changeShowShortVideoAttachments = () => {
|
|
|
231
268
|
|
|
232
269
|
.navigation-button {
|
|
233
270
|
--_icon-scale: 1;
|
|
234
|
-
width:
|
|
235
|
-
min-width:
|
|
236
|
-
max-width:
|
|
237
|
-
height:
|
|
238
|
-
min-height:
|
|
239
|
-
max-height:
|
|
271
|
+
width: 3rem;
|
|
272
|
+
min-width: 3rem;
|
|
273
|
+
max-width: 3rem;
|
|
274
|
+
height: 3rem;
|
|
275
|
+
min-height: 3rem;
|
|
276
|
+
max-height: 3rem;
|
|
240
277
|
background-color: rgba(0, 0, 0, 0.6);
|
|
241
278
|
border: 0.0625rem solid #1c1c1c;
|
|
242
279
|
border-radius: 50%;
|
|
243
280
|
text-align: center;
|
|
244
281
|
--icon--color: #ffffff;
|
|
245
|
-
--icon--size:
|
|
282
|
+
--icon--size: 1.75rem;
|
|
246
283
|
}
|
|
247
284
|
.navigation-button:disabled {
|
|
248
285
|
opacity: 0.5;
|
|
@@ -7,6 +7,7 @@ type Props = {
|
|
|
7
7
|
uiManager: StreamPlayerUiManager;
|
|
8
8
|
postSocialInteractionsHandler?: IPostSocialInteractionsHandler;
|
|
9
9
|
localization: StreamPlayerLocalization;
|
|
10
|
+
playerLogo: string | null;
|
|
10
11
|
on: {
|
|
11
12
|
closePlayer: () => void;
|
|
12
13
|
productClick?: (productId: string) => void;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
@mixin default-opacity {
|
|
2
|
+
--stream-player--elements-opacity: 1;
|
|
3
|
+
}
|
|
4
|
+
|
|
5
|
+
@mixin fade-opacity {
|
|
6
|
+
--stream-player--elements-opacity: 0;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
@mixin handle-fade {
|
|
10
|
+
opacity: var(--stream-player--elements-opacity);
|
|
11
|
+
transition: opacity 0.3s ease-in-out;
|
|
12
|
+
}
|
|
@@ -178,8 +178,7 @@ const overviewAttached = (node) => {
|
|
|
178
178
|
.stream-overview-pages::-webkit-scrollbar {
|
|
179
179
|
width: 3px;
|
|
180
180
|
height: 3px;
|
|
181
|
-
background:
|
|
182
|
-
visibility: hidden;
|
|
181
|
+
background: transparent;
|
|
183
182
|
}
|
|
184
183
|
.stream-overview-pages::-webkit-scrollbar-thumb {
|
|
185
184
|
background: transparent;
|
|
@@ -192,7 +191,6 @@ const overviewAttached = (node) => {
|
|
|
192
191
|
width: 3px;
|
|
193
192
|
height: 3px;
|
|
194
193
|
background: var(--custom-scrollbar-background, transparent);
|
|
195
|
-
visibility: hidden;
|
|
196
194
|
}
|
|
197
195
|
.stream-overview-pages:hover::-webkit-scrollbar-thumb {
|
|
198
196
|
background: var(--custom-scrollbar-color, #7d7d7d);
|
|
@@ -23,7 +23,7 @@ import { StreamPlayerBuffer } from './stream-player-buffer.svelte';
|
|
|
23
23
|
import { StreamPlayerLocalization } from './stream-player-localization';
|
|
24
24
|
import { StreamPlayerUiManager } from './ui-manager.svelte';
|
|
25
25
|
import { onMount, untrack } from 'svelte';
|
|
26
|
-
let { streamId, dataProvider, analyticsHandler, localization: localizationInit = 'en', showStreamsCloudWatermark, postSocialInteractionsHandler, on } = $props();
|
|
26
|
+
let { streamId, dataProvider, analyticsHandler, localization: localizationInit = 'en', showStreamsCloudWatermark, postSocialInteractionsHandler, on, categoriesSwitcher, playerLogo = null, fadeContent = false } = $props();
|
|
27
27
|
const localization = $derived(new StreamPlayerLocalization(localizationInit));
|
|
28
28
|
let model = $state(null);
|
|
29
29
|
let buffer = $state.raw(null);
|
|
@@ -139,6 +139,9 @@ const handleDimensionsChanged = (dimensions) => {
|
|
|
139
139
|
const handleOverviewWidthChanged = (width) => {
|
|
140
140
|
uiManager.updateOverviewWidth(width);
|
|
141
141
|
};
|
|
142
|
+
const onMediaCenterHeaderMounted = (data) => {
|
|
143
|
+
uiManager.updateMediaCenterHeaderHeight(data.height);
|
|
144
|
+
};
|
|
142
145
|
const contentMounted = (node) => {
|
|
143
146
|
const markAsTouched = () => {
|
|
144
147
|
everTouched = true;
|
|
@@ -201,7 +204,14 @@ const onProgress = (pageId, videoId, progress) => {
|
|
|
201
204
|
<div
|
|
202
205
|
class="stream-player-container"
|
|
203
206
|
class:stream-player-container--background-loading={!background}
|
|
207
|
+
class:stream-player-container--faded={fadeContent}
|
|
204
208
|
style={background ? `--background-image: url(${background})` : null}>
|
|
209
|
+
{#if categoriesSwitcher}
|
|
210
|
+
{@render categoriesSwitcher({
|
|
211
|
+
maxItemsWidth: Math.min(uiManager.mainViewColumnWidth * 1.4, uiManager.viewTotalWidth),
|
|
212
|
+
onMounted: onMediaCenterHeaderMounted
|
|
213
|
+
})}
|
|
214
|
+
{/if}
|
|
205
215
|
<div class="stream-player" style={uiManager.globalCssVariables}>
|
|
206
216
|
{#if showStreamsCloudWatermark}
|
|
207
217
|
<div class="stream-player__watermark">
|
|
@@ -240,8 +250,8 @@ const onProgress = (pageId, videoId, progress) => {
|
|
|
240
250
|
autoplay="on-appearance"
|
|
241
251
|
socialInteractionsHandler={postSocialInteractionsHandler}
|
|
242
252
|
localization={localization.shortVideoViewerLocalization}
|
|
243
|
-
showAttachments={uiManager.
|
|
244
|
-
showControls={uiManager.
|
|
253
|
+
showAttachments={uiManager.showShortVideoOverlayAttachments}
|
|
254
|
+
showControls={uiManager.showShortVideoOverlayControls} />
|
|
245
255
|
{/if}
|
|
246
256
|
{/snippet}
|
|
247
257
|
</PlayerSlider>
|
|
@@ -267,6 +277,7 @@ const onProgress = (pageId, videoId, progress) => {
|
|
|
267
277
|
uiManager={uiManager}
|
|
268
278
|
localization={localization}
|
|
269
279
|
postSocialInteractionsHandler={postSocialInteractionsHandler}
|
|
280
|
+
playerLogo={playerLogo}
|
|
270
281
|
on={{
|
|
271
282
|
closePlayer: () => onPlayerClose(),
|
|
272
283
|
productClick: (productId: String) => onProductCardClick(productId),
|
|
@@ -290,6 +301,7 @@ const onProgress = (pageId, videoId, progress) => {
|
|
|
290
301
|
}
|
|
291
302
|
}
|
|
292
303
|
.stream-player-container {
|
|
304
|
+
--stream-player--elements-opacity: 1;
|
|
293
305
|
width: 100%;
|
|
294
306
|
min-width: 100%;
|
|
295
307
|
max-width: 100%;
|
|
@@ -309,6 +321,9 @@ const onProgress = (pageId, videoId, progress) => {
|
|
|
309
321
|
.stream-player-container--background-loading {
|
|
310
322
|
background-color: transparent;
|
|
311
323
|
}
|
|
324
|
+
.stream-player-container--faded {
|
|
325
|
+
--stream-player--elements-opacity: 0;
|
|
326
|
+
}
|
|
312
327
|
|
|
313
328
|
.stream-player {
|
|
314
329
|
display: flex;
|
|
@@ -327,8 +342,12 @@ const onProgress = (pageId, videoId, progress) => {
|
|
|
327
342
|
position: absolute;
|
|
328
343
|
bottom: 5rem;
|
|
329
344
|
left: calc(var(--stream-player--overview--width) + 5rem);
|
|
345
|
+
opacity: var(--stream-player--elements-opacity);
|
|
346
|
+
transition: opacity 0.3s ease-in-out;
|
|
330
347
|
}
|
|
331
348
|
.stream-player__content {
|
|
332
349
|
width: 100%;
|
|
333
350
|
height: 100%;
|
|
351
|
+
opacity: var(--stream-player--elements-opacity);
|
|
352
|
+
transition: opacity 0.3s ease-in-out;
|
|
334
353
|
}</style>
|
|
@@ -1,4 +1,15 @@
|
|
|
1
1
|
import type { StreamPlayerProps } from './types';
|
|
2
|
-
|
|
2
|
+
import { type Snippet } from 'svelte';
|
|
3
|
+
type $$ComponentProps = StreamPlayerProps & {
|
|
4
|
+
categoriesSwitcher?: Snippet<[{
|
|
5
|
+
maxItemsWidth: number;
|
|
6
|
+
onMounted: (data: {
|
|
7
|
+
height: number;
|
|
8
|
+
}) => void;
|
|
9
|
+
}]>;
|
|
10
|
+
playerLogo?: string | null;
|
|
11
|
+
fadeContent?: boolean;
|
|
12
|
+
};
|
|
13
|
+
declare const StreamPlayer: import("svelte").Component<$$ComponentProps, {}, "">;
|
|
3
14
|
type StreamPlayer = ReturnType<typeof StreamPlayer>;
|
|
4
15
|
export default StreamPlayer;
|
|
@@ -4,17 +4,24 @@ export declare class StreamPlayerUiManager {
|
|
|
4
4
|
globalCssVariables: string;
|
|
5
5
|
isMobileView: boolean;
|
|
6
6
|
viewInitialized: boolean;
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
private
|
|
10
|
-
private
|
|
11
|
-
private
|
|
12
|
-
private
|
|
13
|
-
private
|
|
14
|
-
private
|
|
7
|
+
showShortVideoOverlayAttachments: boolean;
|
|
8
|
+
showShortVideoOverlayControls: boolean;
|
|
9
|
+
private _viewTotalWidth;
|
|
10
|
+
private _mainViewColumnWidth;
|
|
11
|
+
private _mediaCenterHeaderHeight;
|
|
12
|
+
private _overviewWidth;
|
|
13
|
+
private _controlsAttachmentsPanelWidth;
|
|
14
|
+
private _controlsNavitagionButtonsWidth;
|
|
15
|
+
private _controlsAvailableSpace;
|
|
16
|
+
private _controlsContentWidth;
|
|
17
|
+
get viewTotalWidth(): number;
|
|
18
|
+
get mainViewColumnWidth(): number;
|
|
15
19
|
updateDimensions: (dimensions: {
|
|
16
20
|
viewTotalWidth: number;
|
|
17
21
|
mainViewColumnWidth: number;
|
|
18
22
|
}) => void;
|
|
19
23
|
updateOverviewWidth: (width: number) => void;
|
|
24
|
+
updateMediaCenterHeaderHeight: (height: number) => void;
|
|
25
|
+
setAttachmentsPanelWidth: (width: number) => void;
|
|
26
|
+
setNavigationButtonsBlockWidth: (width: number) => void;
|
|
20
27
|
}
|
|
@@ -1,32 +1,53 @@
|
|
|
1
|
+
const CONTROLS_PADDING_HORIZONTAL = 28;
|
|
2
|
+
const CONTROLS_PADDING_VERTICAL = 28;
|
|
3
|
+
const CONTROLS_ATTACHMENTS_MAX_WIDTH = 176;
|
|
4
|
+
const PLAYER_PADDING_VERTICAL = 10;
|
|
1
5
|
export class StreamPlayerUiManager {
|
|
2
6
|
overviewCollapsed = $state(false);
|
|
3
7
|
showShortVideoAttachments = $state(true);
|
|
4
8
|
globalCssVariables = $derived.by(() => {
|
|
5
9
|
const values = [
|
|
6
|
-
`--stream-player--
|
|
7
|
-
`--stream-player--
|
|
8
|
-
`--stream-player--controls--
|
|
9
|
-
`--stream-player--
|
|
10
|
-
`--stream-player--overview--width: ${this.
|
|
11
|
-
`--stream-player--
|
|
10
|
+
`--stream-player--controls--attachments--max-width: ${CONTROLS_ATTACHMENTS_MAX_WIDTH}px`,
|
|
11
|
+
`--stream-player--controls--available-space: ${this._controlsAvailableSpace}px`,
|
|
12
|
+
`--stream-player--controls--padding: ${this._mediaCenterHeaderHeight ? 0 : CONTROLS_PADDING_VERTICAL}px ${CONTROLS_PADDING_HORIZONTAL}px ${CONTROLS_PADDING_VERTICAL}px`,
|
|
13
|
+
`--stream-player--media-center-header--height: ${this._mediaCenterHeaderHeight || 72}px`,
|
|
14
|
+
`--stream-player--overview--width: ${this._overviewWidth}px`,
|
|
15
|
+
`--stream-player--padding: ${this._mediaCenterHeaderHeight ? this._mediaCenterHeaderHeight : PLAYER_PADDING_VERTICAL}px 0 ${PLAYER_PADDING_VERTICAL}px`
|
|
12
16
|
];
|
|
13
17
|
return values.join(';');
|
|
14
18
|
});
|
|
15
|
-
isMobileView = $derived.by(() => this.
|
|
16
|
-
viewInitialized = $derived.by(() => !!this.
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
19
|
+
isMobileView = $derived.by(() => this._viewTotalWidth <= 576);
|
|
20
|
+
viewInitialized = $derived.by(() => !!this._viewTotalWidth && !!this._mainViewColumnWidth);
|
|
21
|
+
showShortVideoOverlayAttachments = $derived.by(() => this.viewInitialized && this._controlsAttachmentsPanelWidth < CONTROLS_ATTACHMENTS_MAX_WIDTH + 10);
|
|
22
|
+
showShortVideoOverlayControls = $derived.by(() => this.viewInitialized && this._controlsContentWidth < this._controlsNavitagionButtonsWidth);
|
|
23
|
+
_viewTotalWidth = $state(0);
|
|
24
|
+
_mainViewColumnWidth = $state(0);
|
|
25
|
+
_mediaCenterHeaderHeight = $state(0);
|
|
26
|
+
_overviewWidth = $state(0);
|
|
27
|
+
_controlsAttachmentsPanelWidth = $state(0);
|
|
28
|
+
_controlsNavitagionButtonsWidth = $state(0);
|
|
29
|
+
_controlsAvailableSpace = $derived.by(() => (this._viewTotalWidth - this._mainViewColumnWidth) / 2);
|
|
30
|
+
_controlsContentWidth = $derived.by(() => this._controlsAvailableSpace - CONTROLS_PADDING_HORIZONTAL * 2);
|
|
31
|
+
get viewTotalWidth() {
|
|
32
|
+
return this._viewTotalWidth;
|
|
33
|
+
}
|
|
34
|
+
get mainViewColumnWidth() {
|
|
35
|
+
return this._mainViewColumnWidth;
|
|
36
|
+
}
|
|
25
37
|
updateDimensions = (dimensions) => {
|
|
26
|
-
this.
|
|
27
|
-
this.
|
|
38
|
+
this._viewTotalWidth = dimensions.viewTotalWidth;
|
|
39
|
+
this._mainViewColumnWidth = dimensions.mainViewColumnWidth;
|
|
28
40
|
};
|
|
29
41
|
updateOverviewWidth = (width) => {
|
|
30
|
-
this.
|
|
42
|
+
this._overviewWidth = width;
|
|
43
|
+
};
|
|
44
|
+
updateMediaCenterHeaderHeight = (height) => {
|
|
45
|
+
this._mediaCenterHeaderHeight = height;
|
|
46
|
+
};
|
|
47
|
+
setAttachmentsPanelWidth = (width) => {
|
|
48
|
+
this._controlsAttachmentsPanelWidth = width;
|
|
49
|
+
};
|
|
50
|
+
setNavigationButtonsBlockWidth = (width) => {
|
|
51
|
+
this._controlsNavitagionButtonsWidth = width;
|
|
31
52
|
};
|
|
32
53
|
}
|