@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,16 +1,14 @@
|
|
|
1
1
|
const CONTROLS_PADDING_HORIZONTAL = 28;
|
|
2
2
|
const CONTROLS_PADDING_VERTICAL = 28;
|
|
3
|
+
const CONTROLS_ATTACHMENTS_MAX_WIDTH = 176;
|
|
3
4
|
const PLAYER_PADDING_VERTICAL = 10;
|
|
4
|
-
const BUTTON_SIZE = 48;
|
|
5
|
-
const ICON_SIZE = 28;
|
|
6
5
|
export class ShortVideosPlayerUiManager {
|
|
7
6
|
showAttachments = $state(true);
|
|
8
7
|
globalCssVariables = $derived.by(() => {
|
|
9
8
|
const values = [
|
|
10
|
-
`--short-videos-player--
|
|
11
|
-
`--short-videos-player--controls--available-space: ${
|
|
9
|
+
`--short-videos-player--controls--attachments--max-width: ${CONTROLS_ATTACHMENTS_MAX_WIDTH}px`,
|
|
10
|
+
`--short-videos-player--controls--available-space: ${this._controlsAvailableSpace}px`,
|
|
12
11
|
`--short-videos-player--controls--padding: ${this._mediaCenterHeaderHeight ? 0 : CONTROLS_PADDING_VERTICAL}px ${CONTROLS_PADDING_HORIZONTAL}px ${CONTROLS_PADDING_VERTICAL}px`,
|
|
13
|
-
`--short-videos-player--icon--size: ${ICON_SIZE}px`,
|
|
14
12
|
`--short-videos-player--media-center-header--height: ${this._mediaCenterHeaderHeight || 72}px`,
|
|
15
13
|
`--short-videos-player--padding: ${this._mediaCenterHeaderHeight ? this._mediaCenterHeaderHeight : PLAYER_PADDING_VERTICAL}px 0 ${PLAYER_PADDING_VERTICAL}px`
|
|
16
14
|
];
|
|
@@ -18,10 +16,15 @@ export class ShortVideosPlayerUiManager {
|
|
|
18
16
|
});
|
|
19
17
|
isMobileView = $derived.by(() => this._viewTotalWidth <= 576);
|
|
20
18
|
viewInitialized = $derived.by(() => !!this._viewTotalWidth && !!this._mainViewColumnWidth);
|
|
21
|
-
|
|
19
|
+
showShortVideoOverlayAttachments = $derived.by(() => this.viewInitialized && this._controlsAttachmentsPanelWidth < CONTROLS_ATTACHMENTS_MAX_WIDTH + 10);
|
|
20
|
+
showShortVideoOverlayControls = $derived.by(() => this.viewInitialized && this._controlsContentWidth < this._controlsNavitagionButtonsWidth);
|
|
22
21
|
_viewTotalWidth = $state(0);
|
|
23
22
|
_mainViewColumnWidth = $state(0);
|
|
24
23
|
_mediaCenterHeaderHeight = $state(0);
|
|
24
|
+
_controlsAttachmentsPanelWidth = $state(0);
|
|
25
|
+
_controlsNavitagionButtonsWidth = $state(0);
|
|
26
|
+
_controlsAvailableSpace = $derived.by(() => (this._viewTotalWidth - this._mainViewColumnWidth) / 2);
|
|
27
|
+
_controlsContentWidth = $derived.by(() => this._controlsAvailableSpace - CONTROLS_PADDING_HORIZONTAL * 2);
|
|
25
28
|
get viewTotalWidth() {
|
|
26
29
|
return this._viewTotalWidth;
|
|
27
30
|
}
|
|
@@ -35,4 +38,10 @@ export class ShortVideosPlayerUiManager {
|
|
|
35
38
|
updateMediaCenterHeaderHeight = (height) => {
|
|
36
39
|
this._mediaCenterHeaderHeight = height;
|
|
37
40
|
};
|
|
41
|
+
setAttachmentsPanelWidth = (width) => {
|
|
42
|
+
this._controlsAttachmentsPanelWidth = width;
|
|
43
|
+
};
|
|
44
|
+
setNavigationButtonsBlockWidth = (width) => {
|
|
45
|
+
this._controlsNavitagionButtonsWidth = width;
|
|
46
|
+
};
|
|
38
47
|
}
|
|
@@ -22,21 +22,23 @@ const lineHeight = 1.2;
|
|
|
22
22
|
const elementHeight = $derived(adjustedHeight);
|
|
23
23
|
const priceHeight = $derived(model.stock ? elementHeight * 0.68 : elementHeight);
|
|
24
24
|
const adjustableHeight = $derived(!!(on === null || on === void 0 ? void 0 : on.heightAdjusted));
|
|
25
|
-
const
|
|
25
|
+
const priceOptions = $derived({
|
|
26
|
+
currencyMode: model.includeCurrency ? 'symbol' : 'none'
|
|
27
|
+
});
|
|
26
28
|
const currentPrice = $derived.by(() => {
|
|
27
29
|
if (data.salePrice) {
|
|
28
|
-
return toPriceRepresentation({ amount: data.salePrice, currency: data.currency,
|
|
30
|
+
return toPriceRepresentation({ amount: data.salePrice, currency: data.currency, options: priceOptions });
|
|
29
31
|
}
|
|
30
|
-
return toPriceRepresentation({ amount: data.price, currency: data.currency,
|
|
32
|
+
return toPriceRepresentation({ amount: data.price, currency: data.currency, options: priceOptions });
|
|
31
33
|
});
|
|
32
34
|
const saveValue = $derived.by(() => {
|
|
33
35
|
if (data.salePrice) {
|
|
34
|
-
return toPriceRepresentation({ amount: data.price - data.salePrice, currency: data.currency,
|
|
36
|
+
return toPriceRepresentation({ amount: data.price - data.salePrice, currency: data.currency, options: priceOptions });
|
|
35
37
|
}
|
|
36
38
|
return 0;
|
|
37
39
|
});
|
|
38
40
|
const beforeValue = $derived.by(() => {
|
|
39
|
-
return toPriceRepresentation({ amount: data.price, currency: data.currency,
|
|
41
|
+
return toPriceRepresentation({ amount: data.price, currency: data.currency, options: priceOptions });
|
|
40
42
|
});
|
|
41
43
|
const elementContainerStyles = $derived.by(() => {
|
|
42
44
|
var _a, _b;
|
|
@@ -36,8 +36,8 @@ export type StreamLayoutShortVideoProductModel = {
|
|
|
36
36
|
price: number;
|
|
37
37
|
currency: Currency;
|
|
38
38
|
salePrice: number | null;
|
|
39
|
-
brand
|
|
40
|
-
name
|
|
41
|
-
};
|
|
42
|
-
shortDescription
|
|
39
|
+
brand: {
|
|
40
|
+
name: string;
|
|
41
|
+
} | null;
|
|
42
|
+
shortDescription: string | null;
|
|
43
43
|
};
|
|
@@ -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,57 +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
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
{
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
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>
|
|
70
99
|
</div>
|
|
71
|
-
{/if}
|
|
72
|
-
<div class="stream-player-controls__navigation-buttons" class:stream-player-controls__navigation-buttons--single-web-view-page={singleWebViewPage}>
|
|
73
|
-
<button type="button" class="navigation-button" disabled={!buffer.canLoadPrevious} onclick={buffer.loadPrevious}>
|
|
74
|
-
<span class="navigation-button__icon">
|
|
75
|
-
<Icon src={IconChevronUp} />
|
|
76
|
-
</span>
|
|
77
|
-
</button>
|
|
78
|
-
<button type="button" class="navigation-button" disabled={!buffer.canLoadNext} onclick={buffer.loadNext}>
|
|
79
|
-
<span class="navigation-button__icon">
|
|
80
|
-
<Icon src={IconChevronDown} />
|
|
81
|
-
</span>
|
|
82
|
-
</button>
|
|
83
100
|
</div>
|
|
84
|
-
|
|
85
|
-
<div class="stream-player-controls__right">
|
|
86
|
-
{#if
|
|
87
|
-
|
|
88
|
-
<
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
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}
|
|
98
120
|
{/if}
|
|
99
121
|
</div>
|
|
100
122
|
</div>
|
|
@@ -120,18 +142,24 @@ const changeShowShortVideoAttachments = () => {
|
|
|
120
142
|
top: 0;
|
|
121
143
|
right: 0;
|
|
122
144
|
height: 100%;
|
|
123
|
-
width: var(--stream-player--
|
|
145
|
+
width: var(--stream-player--controls--available-space);
|
|
124
146
|
display: flex;
|
|
125
147
|
justify-content: space-between;
|
|
126
|
-
padding: var(--stream-player--controls--
|
|
148
|
+
padding: var(--stream-player--controls--padding);
|
|
127
149
|
container-type: inline-size;
|
|
128
150
|
}
|
|
151
|
+
.stream-player-controls--with-logo {
|
|
152
|
+
padding-top: 0;
|
|
153
|
+
}
|
|
129
154
|
.stream-player-controls__left {
|
|
130
155
|
display: flex;
|
|
131
156
|
flex-direction: column;
|
|
132
157
|
gap: 2.3125rem;
|
|
133
158
|
justify-content: flex-end;
|
|
134
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;
|
|
135
163
|
}
|
|
136
164
|
.stream-player-controls__right {
|
|
137
165
|
flex: 1;
|
|
@@ -139,63 +167,63 @@ const changeShowShortVideoAttachments = () => {
|
|
|
139
167
|
justify-content: space-between;
|
|
140
168
|
align-items: flex-end;
|
|
141
169
|
flex-direction: column;
|
|
142
|
-
scrollbar-gutter: stable;
|
|
143
|
-
}
|
|
144
|
-
.stream-player-controls__short-video-hub {
|
|
145
|
-
gap: 2.5rem;
|
|
146
|
-
display: flex;
|
|
147
|
-
flex: 1;
|
|
148
|
-
min-height: 0;
|
|
149
|
-
flex-direction: column;
|
|
150
|
-
align-items: flex-start;
|
|
151
|
-
justify-content: flex-end;
|
|
152
|
-
--short-video-controls--icon--size: var(--stream-player--icon--size);
|
|
153
|
-
}
|
|
154
|
-
.stream-player-controls__short-video-attachments-inline {
|
|
155
|
-
display: none;
|
|
156
|
-
/* Set 'container-type: inline-size;' to reference container*/
|
|
157
|
-
}
|
|
158
|
-
@container (width < calc(11rem + 3.75rem)) {
|
|
159
|
-
.stream-player-controls__short-video-attachments-inline {
|
|
160
|
-
display: contents;
|
|
161
|
-
}
|
|
162
|
-
}
|
|
163
|
-
.stream-player-controls__short-video-attachments {
|
|
164
|
-
flex: 1;
|
|
165
170
|
overflow-x: hidden;
|
|
166
171
|
overflow-y: auto;
|
|
167
172
|
scrollbar-color: transparent transparent;
|
|
168
173
|
scrollbar-width: thin;
|
|
169
|
-
|
|
170
|
-
max-width: 11rem;
|
|
171
|
-
/* Set 'container-type: inline-size;' to reference container*/
|
|
174
|
+
scrollbar-gutter: stable;
|
|
172
175
|
}
|
|
173
|
-
.stream-player-
|
|
176
|
+
.stream-player-controls__right::-webkit-scrollbar {
|
|
174
177
|
width: 3px;
|
|
175
178
|
height: 3px;
|
|
176
|
-
background:
|
|
177
|
-
visibility: hidden;
|
|
179
|
+
background: transparent;
|
|
178
180
|
}
|
|
179
|
-
.stream-player-
|
|
181
|
+
.stream-player-controls__right::-webkit-scrollbar-thumb {
|
|
180
182
|
background: transparent;
|
|
181
183
|
}
|
|
182
|
-
.stream-player-
|
|
184
|
+
.stream-player-controls__right:hover {
|
|
183
185
|
scrollbar-color: var(--custom-scrollbar-color, #7d7d7d) var(--custom-scrollbar-background, transparent);
|
|
184
186
|
scrollbar-width: thin;
|
|
185
187
|
}
|
|
186
|
-
.stream-player-
|
|
188
|
+
.stream-player-controls__right:hover::-webkit-scrollbar {
|
|
187
189
|
width: 3px;
|
|
188
190
|
height: 3px;
|
|
189
191
|
background: var(--custom-scrollbar-background, transparent);
|
|
190
|
-
visibility: hidden;
|
|
191
192
|
}
|
|
192
|
-
.stream-player-
|
|
193
|
+
.stream-player-controls__right:hover::-webkit-scrollbar-thumb {
|
|
193
194
|
background: var(--custom-scrollbar-color, #7d7d7d);
|
|
194
195
|
}
|
|
195
|
-
|
|
196
|
-
.
|
|
197
|
-
|
|
198
|
-
|
|
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;
|
|
199
227
|
}
|
|
200
228
|
.stream-player-controls__navigation-buttons {
|
|
201
229
|
display: flex;
|
|
@@ -205,18 +233,18 @@ const changeShowShortVideoAttachments = () => {
|
|
|
205
233
|
}
|
|
206
234
|
|
|
207
235
|
.close-button {
|
|
208
|
-
width:
|
|
209
|
-
min-width:
|
|
210
|
-
max-width:
|
|
211
|
-
height:
|
|
212
|
-
min-height:
|
|
213
|
-
max-height:
|
|
236
|
+
width: 3rem;
|
|
237
|
+
min-width: 3rem;
|
|
238
|
+
max-width: 3rem;
|
|
239
|
+
height: 3rem;
|
|
240
|
+
min-height: 3rem;
|
|
241
|
+
max-height: 3rem;
|
|
214
242
|
background-color: rgba(0, 0, 0, 0.6);
|
|
215
243
|
border: 0.0625rem solid #1c1c1c;
|
|
216
244
|
border-radius: 50%;
|
|
217
245
|
text-align: center;
|
|
218
246
|
--icon--color: #ffffff;
|
|
219
|
-
--icon--size:
|
|
247
|
+
--icon--size: 1.75rem;
|
|
220
248
|
position: absolute;
|
|
221
249
|
top: 0.9375rem;
|
|
222
250
|
left: calc(var(--stream-player--overview--width) + 0.625rem);
|
|
@@ -240,18 +268,18 @@ const changeShowShortVideoAttachments = () => {
|
|
|
240
268
|
|
|
241
269
|
.navigation-button {
|
|
242
270
|
--_icon-scale: 1;
|
|
243
|
-
width:
|
|
244
|
-
min-width:
|
|
245
|
-
max-width:
|
|
246
|
-
height:
|
|
247
|
-
min-height:
|
|
248
|
-
max-height:
|
|
271
|
+
width: 3rem;
|
|
272
|
+
min-width: 3rem;
|
|
273
|
+
max-width: 3rem;
|
|
274
|
+
height: 3rem;
|
|
275
|
+
min-height: 3rem;
|
|
276
|
+
max-height: 3rem;
|
|
249
277
|
background-color: rgba(0, 0, 0, 0.6);
|
|
250
278
|
border: 0.0625rem solid #1c1c1c;
|
|
251
279
|
border-radius: 50%;
|
|
252
280
|
text-align: center;
|
|
253
281
|
--icon--color: #ffffff;
|
|
254
|
-
--icon--size:
|
|
282
|
+
--icon--size: 1.75rem;
|
|
255
283
|
}
|
|
256
284
|
.navigation-button:disabled {
|
|
257
285
|
opacity: 0.5;
|
|
@@ -7,12 +7,11 @@ 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;
|
|
13
14
|
productImpression?: (productId: string) => void;
|
|
14
|
-
adClick?: (adId: string) => void;
|
|
15
|
-
adImpression?: (adId: string, videoId: string) => void;
|
|
16
15
|
};
|
|
17
16
|
};
|
|
18
17
|
declare const Controls: import("svelte").Component<Props, {}, "">;
|
|
@@ -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
|
+
}
|
|
@@ -13,6 +13,4 @@ export declare class InternalStreamAnalyticsHandler implements IStreamAnalyticsH
|
|
|
13
13
|
trackShortVideoProductImpression: (productId: string, videoId: string) => void;
|
|
14
14
|
trackShortVideoProductClick: (productId: string, videoId: string) => void;
|
|
15
15
|
trackShortVideoProgress: (pageId: string, videoId: string, progress: number, streamId: string) => void;
|
|
16
|
-
trackAdImpression: (adId: string) => void;
|
|
17
|
-
trackAdClick: (adId: string) => void;
|
|
18
16
|
}
|
|
@@ -18,6 +18,4 @@ export class InternalStreamAnalyticsHandler {
|
|
|
18
18
|
trackShortVideoProductImpression = (productId, videoId) => AppEventsTracker.trackShortVideoProductImpression(productId, videoId);
|
|
19
19
|
trackShortVideoProductClick = (productId, videoId) => AppEventsTracker.trackShortVideoProductClick(productId, videoId);
|
|
20
20
|
trackShortVideoProgress = (pageId, videoId, progress, streamId) => AppEventsTracker.trackShortVideoProgress(pageId, videoId, progress, streamId);
|
|
21
|
-
trackAdImpression = (adId) => AppEventsTracker.trackAdImpression(adId);
|
|
22
|
-
trackAdClick = (adId) => AppEventsTracker.trackAdClick(adId);
|
|
23
21
|
}
|
|
@@ -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;
|
|
@@ -178,12 +181,6 @@ const onStreamProductImpression = (productId) => {
|
|
|
178
181
|
const onShortVideoProductImpression = (productId, videoId) => {
|
|
179
182
|
analyticsHandler === null || analyticsHandler === void 0 ? void 0 : analyticsHandler.trackShortVideoProductImpression(productId, videoId);
|
|
180
183
|
};
|
|
181
|
-
const onShortVideoAdClick = (adId) => {
|
|
182
|
-
analyticsHandler === null || analyticsHandler === void 0 ? void 0 : analyticsHandler.trackAdClick(adId);
|
|
183
|
-
};
|
|
184
|
-
const onShortVideoAdImpression = (adId, videoId) => {
|
|
185
|
-
analyticsHandler === null || analyticsHandler === void 0 ? void 0 : analyticsHandler.trackAdImpression(adId);
|
|
186
|
-
};
|
|
187
184
|
const onPlayerClose = () => {
|
|
188
185
|
var _a;
|
|
189
186
|
stopActivityTracking();
|
|
@@ -207,7 +204,14 @@ const onProgress = (pageId, videoId, progress) => {
|
|
|
207
204
|
<div
|
|
208
205
|
class="stream-player-container"
|
|
209
206
|
class:stream-player-container--background-loading={!background}
|
|
207
|
+
class:stream-player-container--faded={fadeContent}
|
|
210
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}
|
|
211
215
|
<div class="stream-player" style={uiManager.globalCssVariables}>
|
|
212
216
|
{#if showStreamsCloudWatermark}
|
|
213
217
|
<div class="stream-player__watermark">
|
|
@@ -241,15 +245,13 @@ const onProgress = (pageId, videoId, progress) => {
|
|
|
241
245
|
on={{
|
|
242
246
|
progress: (progress) => onProgress(item.id, item.shortVideo.id, progress),
|
|
243
247
|
productClick: (productId) => onShortVideoProductClick(productId, item.shortVideo.id),
|
|
244
|
-
productImpression: (productId, videoId) => onShortVideoProductImpression(productId, videoId)
|
|
245
|
-
adClick: (adId) => onShortVideoAdClick(adId),
|
|
246
|
-
adImpression: (adId, videoId) => onShortVideoAdImpression(adId, videoId)
|
|
248
|
+
productImpression: (productId, videoId) => onShortVideoProductImpression(productId, videoId)
|
|
247
249
|
}}
|
|
248
250
|
autoplay="on-appearance"
|
|
249
251
|
socialInteractionsHandler={postSocialInteractionsHandler}
|
|
250
252
|
localization={localization.shortVideoViewerLocalization}
|
|
251
|
-
showAttachments={uiManager.
|
|
252
|
-
showControls={uiManager.
|
|
253
|
+
showAttachments={uiManager.showShortVideoOverlayAttachments}
|
|
254
|
+
showControls={uiManager.showShortVideoOverlayControls} />
|
|
253
255
|
{/if}
|
|
254
256
|
{/snippet}
|
|
255
257
|
</PlayerSlider>
|
|
@@ -275,12 +277,11 @@ const onProgress = (pageId, videoId, progress) => {
|
|
|
275
277
|
uiManager={uiManager}
|
|
276
278
|
localization={localization}
|
|
277
279
|
postSocialInteractionsHandler={postSocialInteractionsHandler}
|
|
280
|
+
playerLogo={playerLogo}
|
|
278
281
|
on={{
|
|
279
282
|
closePlayer: () => onPlayerClose(),
|
|
280
283
|
productClick: (productId: String) => onProductCardClick(productId),
|
|
281
|
-
productImpression: (productId: String) => onStreamProductImpression(productId)
|
|
282
|
-
adClick: (adId: string) => onShortVideoAdClick(adId),
|
|
283
|
-
adImpression: (adId: string, videoId: string) => onShortVideoAdImpression(adId, videoId)
|
|
284
|
+
productImpression: (productId: String) => onStreamProductImpression(productId)
|
|
284
285
|
}} />
|
|
285
286
|
{:else}
|
|
286
287
|
<Loading positionFixedCenter={true} timeout={1000} />
|
|
@@ -300,6 +301,7 @@ const onProgress = (pageId, videoId, progress) => {
|
|
|
300
301
|
}
|
|
301
302
|
}
|
|
302
303
|
.stream-player-container {
|
|
304
|
+
--stream-player--elements-opacity: 1;
|
|
303
305
|
width: 100%;
|
|
304
306
|
min-width: 100%;
|
|
305
307
|
max-width: 100%;
|
|
@@ -319,6 +321,9 @@ const onProgress = (pageId, videoId, progress) => {
|
|
|
319
321
|
.stream-player-container--background-loading {
|
|
320
322
|
background-color: transparent;
|
|
321
323
|
}
|
|
324
|
+
.stream-player-container--faded {
|
|
325
|
+
--stream-player--elements-opacity: 0;
|
|
326
|
+
}
|
|
322
327
|
|
|
323
328
|
.stream-player {
|
|
324
329
|
display: flex;
|
|
@@ -337,8 +342,12 @@ const onProgress = (pageId, videoId, progress) => {
|
|
|
337
342
|
position: absolute;
|
|
338
343
|
bottom: 5rem;
|
|
339
344
|
left: calc(var(--stream-player--overview--width) + 5rem);
|
|
345
|
+
opacity: var(--stream-player--elements-opacity);
|
|
346
|
+
transition: opacity 0.3s ease-in-out;
|
|
340
347
|
}
|
|
341
348
|
.stream-player__content {
|
|
342
349
|
width: 100%;
|
|
343
350
|
height: 100%;
|
|
351
|
+
opacity: var(--stream-player--elements-opacity);
|
|
352
|
+
transition: opacity 0.3s ease-in-out;
|
|
344
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;
|
|
@@ -53,6 +53,4 @@ export interface IStreamAnalyticsHandler {
|
|
|
53
53
|
trackShortVideoProductImpression: (productId: string, videoId: string) => void;
|
|
54
54
|
trackShortVideoProductClick: (productId: string, videoId: string) => void;
|
|
55
55
|
trackShortVideoProgress: (pageId: string, videoId: string, progress: number, streamId: string) => void;
|
|
56
|
-
trackAdImpression: (adId: string) => void;
|
|
57
|
-
trackAdClick: (adId: string) => void;
|
|
58
56
|
}
|
|
@@ -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
|
}
|