@streamscloud/embeddable 8.0.0 → 8.0.1
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.
|
@@ -48,6 +48,13 @@ const handleContentPlayerMounted = (node) => {
|
|
|
48
48
|
node.addEventListener('wheel', markAsTouched);
|
|
49
49
|
node.addEventListener('click', markAsTouched);
|
|
50
50
|
node.addEventListener('keypress', markAsTouched);
|
|
51
|
+
return {
|
|
52
|
+
destroy: () => {
|
|
53
|
+
removeListeners();
|
|
54
|
+
}
|
|
55
|
+
};
|
|
56
|
+
};
|
|
57
|
+
const handleSliderMounted = (node) => {
|
|
51
58
|
let resizeObserver = new ResizeObserver(() => {
|
|
52
59
|
const { width: playerWidth, height: playerHeight } = node.getBoundingClientRect();
|
|
53
60
|
uiManager.playerTotalWidth = playerWidth;
|
|
@@ -95,7 +102,6 @@ const handleContentPlayerMounted = (node) => {
|
|
|
95
102
|
resizeObserver.observe(node);
|
|
96
103
|
return {
|
|
97
104
|
destroy: () => {
|
|
98
|
-
removeListeners();
|
|
99
105
|
resizeObserver.disconnect();
|
|
100
106
|
}
|
|
101
107
|
};
|
|
@@ -157,35 +163,37 @@ const variables = $derived.by(() => {
|
|
|
157
163
|
</div>
|
|
158
164
|
{/if}
|
|
159
165
|
{#if config.playerBuffer}
|
|
160
|
-
<
|
|
161
|
-
{
|
|
162
|
-
{
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
{
|
|
181
|
-
|
|
166
|
+
<div class="content-player__slider" use:handleSliderMounted>
|
|
167
|
+
<PlayerSlider buffer={config.playerBuffer} on={config.playerSliderCallbacks}>
|
|
168
|
+
{#snippet children({ item })}
|
|
169
|
+
{@const postModel = config.itemAsPostViewerModel(item)}
|
|
170
|
+
<div class="content-player__content">
|
|
171
|
+
{#if postModel}
|
|
172
|
+
<PostViewer
|
|
173
|
+
model={postModel}
|
|
174
|
+
socialInteractionsHandler={config.socialInteractionsHandler}
|
|
175
|
+
enableAttachments={config.uiManager.showPostOverlayAttachments}
|
|
176
|
+
enableControls={config.uiManager.showPostOverlayControls}
|
|
177
|
+
autoplay="on-appearance"
|
|
178
|
+
locale={config.settings.locale}
|
|
179
|
+
on={{
|
|
180
|
+
progress: (progress) => config.callbacks?.videoProgress?.(item.id, postModel.id, progress),
|
|
181
|
+
productClick: (productId) => config.callbacks?.productClick?.(productId, postModel.id),
|
|
182
|
+
productImpression: (productId) => config.callbacks?.productImpression?.(productId, postModel.id),
|
|
183
|
+
adClick: (adId) => config.callbacks?.adClick?.(adId, postModel.id),
|
|
184
|
+
adImpression: (adId) => config.callbacks?.adImpression?.(adId, postModel.id)
|
|
185
|
+
}} />
|
|
186
|
+
{:else if nonPostItemView}
|
|
187
|
+
{@render nonPostItemView({ item })}
|
|
188
|
+
{/if}
|
|
182
189
|
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
190
|
+
{#if uiManager.isMobileView && config.playerBuffer && config.playerBuffer.loaded.length > 1 && !everTouched}
|
|
191
|
+
<SwipeIndicator locale={config.settings.locale} />
|
|
192
|
+
{/if}
|
|
193
|
+
</div>
|
|
194
|
+
{/snippet}
|
|
195
|
+
</PlayerSlider>
|
|
196
|
+
</div>
|
|
189
197
|
<ControlsAndAttachments config={config} />
|
|
190
198
|
{:else}
|
|
191
199
|
<Loading positionFixedCenter={true} timeout={1000} />
|
|
@@ -242,6 +250,14 @@ const variables = $derived.by(() => {
|
|
|
242
250
|
padding: 0;
|
|
243
251
|
}
|
|
244
252
|
}
|
|
253
|
+
.content-player__slider {
|
|
254
|
+
width: 100%;
|
|
255
|
+
min-width: 100%;
|
|
256
|
+
max-width: 100%;
|
|
257
|
+
height: 100%;
|
|
258
|
+
min-height: 100%;
|
|
259
|
+
max-height: 100%;
|
|
260
|
+
}
|
|
245
261
|
.content-player__watermark {
|
|
246
262
|
position: absolute;
|
|
247
263
|
bottom: 5rem;
|
|
@@ -256,4 +272,7 @@ const variables = $derived.by(() => {
|
|
|
256
272
|
position: relative;
|
|
257
273
|
opacity: var(--content-player--elements-opacity);
|
|
258
274
|
transition: opacity 0.3s ease-in-out;
|
|
275
|
+
display: flex;
|
|
276
|
+
justify-content: center;
|
|
277
|
+
align-items: center;
|
|
259
278
|
}</style>
|