@tivio/sdk-react 9.7.0 → 9.8.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/CHANGELOG.md ADDED
@@ -0,0 +1,369 @@
1
+ ## Changelog
2
+
3
+ ## 9.8.0
4
+ * minor: add addToFavoritesByPath and removeFromFavoritesByPath methods to tivio entity
5
+ * patch: fix support of multiple players on the same page
6
+ * patch: fix support of multiple players on the same page
7
+ * minor: add minimal OSD to web player
8
+ * minor: add setIsMinimal method to video controller
9
+ * minor: fix IMA ads playback
10
+ * minor: fix IMA black screen when multiple WebPlayers are on one page: scope ad container / video / click element DOM ids per `playerWrapper.id`.
11
+
12
+ ## 9.7.1
13
+ * patch: add replacement type to ad static config
14
+
15
+ ## 9.7.0
16
+ * minor: add optional enableGtmPlayerEvents parameter into TivioConfig
17
+ * minor: add companion-ads events
18
+ * minor: add replacement of VAST macros and Vasterix templates
19
+ * minor: add possibility to use Single Sign-On (SSO) for all subdomains under the same parent domain
20
+ * minor: add optional enableGtmPlayerEvents parameter into TivioConfig
21
+ * minor: add getTagsByIds method
22
+
23
+ ## 9.6.0
24
+ * minor: change ad_started and ad_ended events to ad-started and ad-ended
25
+ * patch: fix crash when custom token in cookies is expired or invalid
26
+ * minor: add userAuthCallbacks -> onGoToLogin and onGoToRegistration to WebPlayerProps
27
+
28
+ ## 9.5.0
29
+ * minor: add possibility to use Single Sign-On (SSO) for all subdomains under the same parent domain
30
+ * minor: add staticAdsConfig to source types
31
+ * minor: add ad_started and ad_ended events to video controller
32
+ * minor: add ctaElement to ad_started event
33
+ * minor: add customAdMetadata to ad_started event
34
+
35
+ ## 9.4.0
36
+ * minor: add support for multiple urls in external sources
37
+
38
+ ## 9.3.1
39
+ * patch: fix documentation
40
+
41
+ ## 9.3.0
42
+ * minor: add getFavorites, getWatchPositions, getWatchHistory methods to user entity
43
+ * minor: add GetUserProfileDataOptions type to exported types
44
+ * minor: add FavoriteWithData and WatchPositionWithData types to exported types
45
+ * minor: add profileId to FavoriteWithData and WatchPositionWithData types
46
+ * minor: update documentation
47
+
48
+ * 9.2.0
49
+ * minor: remove deprecated TivioWidget component
50
+ * minor: remove deprecated TivioWidgetError component
51
+ * minor: remove deprecated TivioWidgetLoader component
52
+ * patch: deprecate PurchasesWithVideosContextProvider
53
+ * minor: remove unused WebProfileScreen component
54
+ * minor: remove unused ChannelContext context
55
+ * minor: added video controller return from renderWebPlayer
56
+ * minor: update docs usage of renderWebPlayer and video controller
57
+
58
+ * 9.2.0-alpha.4
59
+ * patch: expose getUser, resetPassword and signOut methods in RemoteBundleState type
60
+ * patch: more precise types for user profile fields and methods
61
+ * patch: add missing jsdocs for some User type fields
62
+
63
+ * 9.2.0-alpha.0
64
+ * minor: add renderWebPlayer method for rendering outside of React
65
+ * minor: "expose createTivio"
66
+
67
+ * 9.1.7
68
+ * patch: update remote controller component API
69
+
70
+ * 9.1.6
71
+ * minor: add remote controller
72
+
73
+ * 9.1.5
74
+ * patch: expose purchase loyalty points through types
75
+ * patch: enable setUser check
76
+
77
+ * 9.1.4
78
+ * patch: disable setUser check
79
+ * patch: rollback "add renderWebPlayer method for rendering outside of React"
80
+ * patch: rollback "expose createTivio"
81
+
82
+ * 9.1.3
83
+ * patch: add renderWebPlayer method for rendering outside of React
84
+ * patch: expose createTivio
85
+
86
+ * 9.1.4
87
+ * patch: disable setUser check
88
+
89
+ * 9.1.3
90
+ * minor: add renderWebPlayer method for rendering outside of React
91
+ * minor: expose createTivio
92
+
93
+ * 9.1.2
94
+ * patch: update PurchaseEndpointPayload type (cityName, externalId, geoPoint)
95
+
96
+ * 9.1.1
97
+ * patch: fix changelog
98
+
99
+ * 9.1.0
100
+ * patch: add gateway to Purchase type
101
+ * minor: add QerkoPaymentWebhookByApiKeyRequest to exported types
102
+
103
+ * 9.0.0
104
+ * patch: remove i18next and react-i18next from externals and dependencies
105
+ * patch: do not send react-spring to core-react-dom bundle, remove react-spring from dependencies
106
+ * patch: clean-up externals in webpack config
107
+ * patch: send only required dependencies to the bundle
108
+ * major: change purchase statuses lifecycle
109
+ * minor: add originalPurchaseId to PurchaseEndpointPayload
110
+
111
+ * 8.0.0
112
+ * major: deprecated usePurchasesWithVideos hook removed
113
+ * patch: add id to user type
114
+ * patch: add @types/react to peerDependencies
115
+
116
+ * 7.1.0
117
+ * minor: export useTvChannelHook
118
+ * patch: bump "react-i18next", "i18next" versions.
119
+
120
+ * 7.0.1
121
+ * patch: fix dependency to @tivio/common
122
+
123
+ * 7.0.0
124
+ * major: delete deprecated useWatchWithoutAdsOffer hook
125
+ * major: consolidate duplicated source types
126
+ * patch: add new properties to PlayerInterface
127
+ * patch: expose getSeekingMatrixPreviewByTime in Video interface
128
+ * major: delete deprecated useBetOffer hook
129
+ * major: rework of source types
130
+ * major: make useChannelSource deprecated
131
+
132
+ * 6.0.1
133
+ * patch: fix dependency to @tivio/common
134
+
135
+ * 6.0.0
136
+ * major: delete usePlayerEvent hook
137
+ * major: replace uri attributes in types with url
138
+ * major: delete uri attributes from types
139
+ * minor: add purchase expiration to PurchaseEndpointPayload
140
+ * minor: add optional videoId parameter to useOrganizationSubscription hook
141
+
142
+ * 5.0.2
143
+ * patch: export hook useChannelSource
144
+
145
+ * 5.0.1
146
+ * patch: move changelog
147
+
148
+ * 5.0.0
149
+ * major: upgrade to React 18, change react and react-dom peer dependencies to 17.x || 18.x
150
+ * major: fix typing for useReferralInfo, now correctly showing that `null` can be returned
151
+ * major: fix typing for `WebRowProps.onTileClick`, now correctly showing that `null` can be accepted
152
+ * minor: add analytics
153
+ * minor: add getSourceUrl function to video and tv channel types
154
+ * minor: add uri property to tv channel type
155
+ * minor: add useChannelSource to hooks
156
+
157
+ * 4.5.0
158
+ * minor: extend PurchaseEndpointPayload type with purchase previousStatus and newStatus fields
159
+
160
+ * 4.4.1
161
+ * patch: added waitForTags param in useSearch hook for videos
162
+
163
+ * 4.4.0
164
+ * minor: PrimaryButton component props type set to any for now
165
+ * patch: isPurchasableAsVoucher added to PurchasableMonetization
166
+ * patch: voucherPurchase flag added to purchase overlays
167
+ * patch: item added to MonetizationsSelectOverlayData
168
+ * minor: added hungarian language to `LangCode` enum
169
+
170
+ * 4.3.0:
171
+ * minor: add GetPurchaseInfoResponse and PurchaseEndpointPayload to exported types
172
+ * minor: support for disabling purchase of specified subscriptions (new param in useOrganizationSubscriptions hook)
173
+ * minor: more specific PurchasableMonetization type usage instead of Monetization
174
+ * minor: monetization property deleted from Video type
175
+ * minor: monetization now has originalPrice and promotion properties available
176
+ * patch: remove not used OrganizationSubscriptionsContext, **this change requires bundle 3.20.0 or newer**
177
+
178
+ * 4.2.0:
179
+ * minor: fix useSearch loading type
180
+ * patch: added italian language to `LangCode` enum
181
+
182
+ * 4.1.0
183
+ * patch: added italian language to `LangCode` enum
184
+ * minor: fixed spanish language code in `LangCode` enum (`sp` -> `es`)
185
+ * minor: other misc type changes
186
+
187
+ * 4.0.1
188
+ * patch: added setBundleVersion setter to bundle type
189
+ * patch: added setStorageManager setter to bundle type
190
+ * patch: `Purchase.isPurchased` is deprecated
191
+ * patch: fill `useSearch` field `hasNextPage` with proper value
192
+
193
+ * 4.0.0
194
+ * minor: Types cleanup
195
+ * MAJOR: Remove deprecated and unused stuff
196
+ * auth
197
+ * changePassword
198
+ * changeUserPhoto
199
+ * removeUserPhoto
200
+ * getPurchasedVodsWithInitializedVideos
201
+ * initializeUser
202
+ * createFreePurchase
203
+ * components
204
+ * videoAdBanner
205
+ * getters
206
+ * getExportedConfig
207
+ * getChannelById
208
+ * getSectionById
209
+ * getWidgetById
210
+ * hooks
211
+ * useLastVideoByWidgetId
212
+ * useScreen
213
+ * useFreePurchase
214
+ * useWidget
215
+ * useChannel
216
+ * useSection
217
+ * useVideosInSection
218
+ * useSectionsInChannel
219
+ * useChannelsInWidget
220
+ * subscriptions
221
+ * subscribeToWidget
222
+ * subscribeToChannel
223
+ * subscribeToSection
224
+ * subscribeToVideosInSection
225
+ * subscribeToSectionsInChannel
226
+ * subscribeToChannelsInWidget
227
+ * subscribeToScreen
228
+ ---
229
+ _Versions <= v3.7.0 requires core-react-dom bundle < v3.0.0 (because sdk-react used some sdk API deleted in core-react-dom@4.0.0)_
230
+
231
+ * 3.7.0
232
+ * minor: purchase contains created and updated
233
+
234
+ * 3.6.3
235
+ * patch: improve README.md
236
+
237
+ * 3.6.2
238
+ * patch: Fix types
239
+
240
+ * 3.6.1
241
+ * patch: Fix README
242
+
243
+ * 3.6.0
244
+ * minor: Update types
245
+
246
+ * 3.5.2
247
+ * patch: All types are available again.
248
+
249
+ * 3.5.1
250
+ * patch: remove incorrect dependency (@tivio/types)
251
+
252
+ * 3.5.0
253
+ * minor: Types change - Video.price and Video.detailedPrice can be null
254
+ * minor: Types change - Video.cover is marked as deprecated
255
+
256
+ * 3.4.0
257
+ * minor: more precise type for errors in usePurchaseRecovery and usePurchaseRecovery
258
+ * patch: jsdocs for usePurchaseRecovery and usePurchaseRecovery
259
+ * minor: inviteCodeReset in useApplyInviteCode
260
+ * minor: Reset forgotten password
261
+ * minor: Consolidating monetization logic
262
+ * 3.3.2
263
+ * patch: Adding new optional parameters (where, orderBy) to useTaggedVideos hook
264
+ * 3.3.1
265
+ * patch: Fixed types of `setUser`
266
+ * 3.3.0
267
+ * minor: Add getPlayerCapabilities to getters.
268
+ * patch: Added option to log out via `setUser(null)`, requires @tivio/core-react-dom@2.17.9
269
+ * 3.2.5
270
+ * patch: added recovery flag to QerkoPaymentInfo type
271
+ * patch: bundle.types changes - internal.components.WebVideoScreen
272
+ * patch: types changes - add new onBack prop to WebPlayerProps
273
+ * patch: Refactor useVideo hook, now uses hook from core-react
274
+ * 3.2.4
275
+ * minor: added useApplyInviteCode
276
+ * minor: better errors from useVoucher
277
+ * 3.2.3
278
+ * minor: added usePurchaseRecovery hook
279
+ * patch: deprecated `useLastVideoByWidgetId`
280
+ * 3.2.2
281
+ * minor: useRowsInScreen, useItemsInRow, useTaggedVideos - hasNextPage and loading added to pagination
282
+ * minor: useRowsInScreen, useItemsInRow, useTaggedVideos - implementation moved to remote bundle
283
+ * patch: Fixed Tivio startup on Tizen 6
284
+ * minor: Added `forceCloudFnResolver` option
285
+ * 3.2.1
286
+ * patch: fix of @tivio/common version
287
+ * 3.2.0
288
+ * minor: Added `capabilitiesOptions` for finer configuration of device capabilities
289
+ * minor: tag names are returned in correct language (the one from tivio config); language value should be one from enum "LangCode"
290
+ * 3.1.3
291
+ * patch: Hotfix made sure disabled Tivio does not break React Native
292
+ * 3.1.2
293
+ * patch: Allow `conf` prop of `TivioProvider` to be `null` or `undefined` in order to turn off Tivio
294
+ * 3.1.1
295
+ * patch: fixed `setUser()` crash when bundle fails to load
296
+ * 3.1.0
297
+ * patch: `useAdSegment()` now returns null if no monetization is configured, ad segments are not managed in that situation
298
+ * minor: enriched `AdSegment` type from `useAdSegment()`
299
+ * minor: Added `setUser()` function for login and logout
300
+ * 3.0.0
301
+ * minor: Added hook `useWatchWithoutAdsOffer` to trigger purchase dialog to "watch without ads", if available
302
+ * patch: fix peerDependency declaration for react, react-dom
303
+ * major: TivioProvider requires deviceCapabilities
304
+ * major: TivioProvider requires currency
305
+ * minor: add voucher support (see usePurchaseSubscription and useTransactionPayment hooks)
306
+ * minor: device limit support
307
+ * minor: drm (Widevine, PlayReady) support
308
+ * minor: watermarking support
309
+ * minor: add useSearch hook
310
+ * patch: price on video is 0 when purchased
311
+ * 2.4.2
312
+ * patch: added back changelog
313
+ * 2.4.1
314
+ * patch: improved doc about player wrapper
315
+ * 2.4.0
316
+ * patch: improved Player wrapper types
317
+ * minor: added Tivio DOM events `tivio_key_input_handling_change`, `tivio_context_switch` and `tivio_request_goto`
318
+ * patch: added support for remote code on browsers that do not implement [indexedDB API](https://developer.mozilla.org/en-US/docs/Web/API/IndexedDB_API)
319
+ * patch: added support for browsers that do not implement [indexedDB API](https://developer.mozilla.org/en-US/docs/Web/API/IndexedDB_API)
320
+ * 2.3.4
321
+ * patch: fix of usePurchaseSubscription not reactive
322
+ * 2.3.3
323
+ * patch: fix of useUser not updating
324
+ * 2.3.2
325
+ * patch: next app doesn't fail anymore due to "self is not defined"
326
+ * 2.3.1
327
+ * patch: fix of @tivio/common dependency
328
+ * 2.3.0
329
+ * minor: add useTaggedVideos that allows to fetch videos with given tags
330
+ * minor: add option to fetch tags (on hook useItemsInRow), useVideo always fetching videos tags
331
+ * 2.2.1
332
+ * patch: disable Sentry when no config is supplied to `TivioProvider`
333
+ * 2.2.0
334
+ * patch: reduced bundle size
335
+ * minor: disable Sentry when no config is supplied to `TivioProvider` or when Tivio is disabled `{ enable: false }`, or when Sentry is disabled via config `{ enableSentry: false }`
336
+ * 2.1.5
337
+ * patch fix of `useVideosInSection` hook (fetching video's monetizations)
338
+ * 2.1.4
339
+ * patch: fix re-rendering of `useAd` during non-skippable ads (requires core-react-dom@2.1.9)
340
+ * 2.1.3
341
+ * patch: fix changelog
342
+ * 2.1.2
343
+ * patch: Fixed exported types
344
+ * 2.1.1
345
+ * patch: TivioWidget now correctly reports `false` via `onEnabled` callback when in invalid internal state
346
+ * 2.1.0
347
+ * patch: fix of useItemsInRow hook
348
+ * patch: fix of useScreen hook
349
+ * add: useRowsInScreen hook
350
+ * 2.0.3
351
+ * patch: fix of useItemsInRow hook
352
+ * 2.0.2
353
+ * patch: screen and row IDs fixed
354
+ * `TivioBundle.subscriptions.subscribeToItemsInRow` now accepts user-defined ID via studio.tiv.io
355
+ * `TivioBundle.subscriptions.subscribeToScreen` now accepts user-defined ID via studio.tiv.io
356
+ * `Screen` and `Row` types returned by `useScreen()` return their user-defined IDs (`.id`) correctly
357
+ * 2.0.1
358
+ * no changes
359
+ * 2.0.0
360
+ * major: video.channelId can now be `string | null` used to be `string`
361
+ * minor: added data API and hooks for screens (screens, rows of screen and row items)
362
+ * hooks: `useScreen()`, `useItemsInRow()`
363
+ * api: `TivioBundle.subscriptions.subscribeToScreen`, `TivioBundle.subscriptions.subscribeToItemsInRow`
364
+ * 1.3.6
365
+ * ?
366
+ * 1.3.5
367
+ * minor: added WebPlayer props (canReplay, showMarkers, customShortcuts, enableKeyboardShortcuts, source.poster)
368
+ * 1.3.4
369
+ * ...
package/README.md CHANGED
@@ -203,21 +203,44 @@ user.deleteUserProfile(profileId: string): Promise<void>
203
203
 
204
204
  ## Content
205
205
 
206
- ### Assets
206
+ ### Tiles and assets
207
207
 
208
- In order to obtain assets (images) from a Video or Tag, you can use these methods:
208
+ A **tile** is a single item rendered inside a content row. The tile is the
209
+ same entity the row points to (a `Video`, `Tag`, `TvChannel`, `Series`,
210
+ `Article` or `Application`), so anything you can read off the entity (name,
211
+ description, ids, monetization flags, …) is also available directly on the
212
+ tile returned by `useItemsInRow` / `row.tiles`.
209
213
 
210
- #### Video or Tag
211
- - `video.cover` - cover image (landscape)
212
- - `video.banner` - banner image
213
- - `video.circled` - circled image
214
- - `video.detailBanner` - detail banner image (landscape)
215
- - `video.portrait` - portrait image (portrait)
214
+ Each tile carries several named image **assets** so the same entity can be
215
+ rendered in different shapes without an extra fetch. Every named getter is a
216
+ shortcut into the underlying `tile.assets` map use the map directly if you
217
+ need a custom asset that does not have a dedicated getter.
216
218
 
217
- #### Tag only
218
- - `tag.bannerMobile` - banner image mobile
219
+ **Shared across all entity types**
219
220
 
220
- __All of the assets fallback to type cover or empty string if cover is not available__
221
+ - `tile.landscape` 16:9 thumbnail (standard rows)
222
+ - `tile.portrait` — 2:3 poster (portrait rows)
223
+ - `tile.circled` — 1:1 circular crop (e.g. creators)
224
+ - `tile.square` — 1:1 square (square rows)
225
+ - `tile.banner` — 16:9 hero banner (banner rows / top of screens)
226
+ - `tile.bannerMobile` — narrow 16:9 banner variant for phones
227
+ - `tile.assets` — raw `{ [assetName]: ScalableAsset }` map behind the getters
228
+
229
+ **Extras by entity type (on top of the shared set above)**
230
+
231
+ - `Video` — `detailBanner` (backdrop above the player), `image`, `cover`
232
+ (deprecated, kept for compatibility), `backgroundBlurBannerMobile`
233
+ - `Tag` / `Article` / `Series` — `detailBanner`, `cover`
234
+ - `TvChannel` — `logo`, `logoPendingOverlayWidth`, `cover`
235
+ - `Application` — read via `tile.application`: `logo`, `logoLandscape`,
236
+ `profilePhoto`
237
+
238
+ If an asset is not set on the entity, the getter returns `null` rather than
239
+ throwing, so it's safe to fall back from a specific variant to a more
240
+ generic one (for example `tile.landscape ?? tile.banner ?? tile.cover`).
241
+
242
+ A live example that renders the same video through every getter is included
243
+ in `examples/sdk-react/src/index.tsx` (`createAssetsShowcaseDemo`).
221
244
 
222
245
  ### Get content based on user profile
223
246
 
@@ -326,6 +349,19 @@ const favorites = await tivio.getUser()?.favorites
326
349
  favorites[0]?.removeFromFavorites()
327
350
  ```
328
351
 
352
+ ### Add to/remove from favorites by path
353
+
354
+ You can also add or remove favorites using content paths directly:
355
+ ```typescript
356
+ // Add to favorites by path
357
+ await tivio.addToFavoritesByPath('videos/videoId')
358
+ await tivio.addToFavoritesByPath('tags/tagId')
359
+
360
+ // Remove from favorites by path
361
+ await tivio.removeFromFavoritesByPath('videos/videoId')
362
+ await tivio.removeFromFavoritesByPath('tags/tagId')
363
+ ```
364
+
329
365
  > ℹ️ **_Note:_** When user saves favorite without profileId, it will only be shown if the app doesn't have any active user profile.
330
366
 
331
367
  ### Get screen by ID
@@ -799,6 +835,22 @@ The `sourcePlayMode` property determines how the content is played:
799
835
  - **LIVE** - Live stream mode with no seeking
800
836
  - **HYBRID** - Combines LIVE with seeking
801
837
 
838
+ #### Player Authentication Configuration
839
+
840
+ Use `disableTvChannelsForAnonymousUsers` property to show overlay to sign in when user is anonymous and tries to play a TV channel (free or monetized).
841
+ Set the property to `true` inside the `player` property in Tivio config.
842
+
843
+ Tivio config:
844
+ ```typescript
845
+ const config = {
846
+ // ... other config properties
847
+ player: {
848
+ // ... other player properties
849
+ disableTvChannelsForAnonymousUsers: true, // or false
850
+ },
851
+ }
852
+ ```
853
+
802
854
  #### User Authentication Callbacks
803
855
 
804
856
  The `userAuthCallbacks` property allows you to handle user authentication flows when the player requires user login or registration. This is particularly useful for content that requires authentication (e.g., premium content).
@@ -906,11 +958,115 @@ The `setSource` method is particularly useful for:
906
958
  - Implementing playlists
907
959
  - Dynamic content loading
908
960
 
961
+ #### Minimal OSD / Sticky Mini Player
962
+
963
+ The player supports a minimal OSD mode designed for small or pinned containers such as a
964
+ scroll-fixed "mini" player. When enabled, only the essential controls are rendered:
965
+
966
+ - `play` / `pause` (small button in the bottom-left corner)
967
+ - `volume`
968
+ - `fullscreen`
969
+
970
+ The mode can be toggled in two ways:
971
+
972
+ 1. Declaratively, via the `isMinimal` prop on `WebPlayerProps`.
973
+ 2. Imperatively, via the vanilla controller's `setIsMinimal(isMinimal: boolean)` method — useful
974
+ for switching on/off at runtime (e.g. when the player becomes pinned after the user scrolls
975
+ past it).
976
+
977
+ **Example: scroll-pinned mini player**
978
+
979
+ The layout is driven entirely by CSS — the JS only toggles an `is-floating` class and calls
980
+ `setIsMinimal(true|false)` accordingly. Responsive behavior (desktop corner vs. mobile
981
+ top-full-width) is handled with a media query, so there is no need to watch viewport size from
982
+ React/JS.
983
+
984
+ ```html
985
+ <section class="mini-player-demo">
986
+ <div class="mini-player-anchor">
987
+ <div class="mini-player" id="mini-player"></div>
988
+ </div>
989
+ <!-- ...page content... -->
990
+ </section>
991
+ ```
992
+
993
+ ```css
994
+ .mini-player-anchor {
995
+ position: relative;
996
+ width: 100%;
997
+ aspect-ratio: 16 / 9;
998
+ }
999
+
1000
+ .mini-player {
1001
+ position: absolute;
1002
+ inset: 0;
1003
+ background: #000;
1004
+ }
1005
+
1006
+ /* Floating (desktop): pinned to bottom-right. */
1007
+ .mini-player.is-floating {
1008
+ position: fixed;
1009
+ inset: auto 24px 24px auto;
1010
+ width: 360px;
1011
+ aspect-ratio: 16 / 9;
1012
+ z-index: 1000;
1013
+ border-radius: 8px;
1014
+ overflow: hidden;
1015
+ box-shadow: 0 12px 32px rgba(0, 0, 0, 0.45);
1016
+ }
1017
+
1018
+ /* Floating (narrow viewports): pinned to top, full width. */
1019
+ @media (max-width: 600px) {
1020
+ .mini-player.is-floating {
1021
+ inset: 0 0 auto 0;
1022
+ width: 100%;
1023
+ border-radius: 0;
1024
+ }
1025
+ }
1026
+ ```
1027
+
1028
+ ```ts
1029
+ import { renderWebPlayer } from '@tivio/sdk-react'
1030
+
1031
+ const container = document.getElementById('mini-player')!
1032
+ const anchor = document.querySelector('.mini-player-anchor')!
1033
+
1034
+ const controller = await renderWebPlayer(container, {
1035
+ id: 'mini-player',
1036
+ source: 'videos/YOUR_VIDEO_ID',
1037
+ isSameSizeAsParent: true,
1038
+ isMutedByDefault: true,
1039
+ autoplay: true,
1040
+ })
1041
+
1042
+ // Pop out of the flow once the inline anchor leaves the viewport,
1043
+ // and switch the OSD between minimal and default accordingly.
1044
+ new IntersectionObserver(
1045
+ ([entry]) => {
1046
+ const isFloating = !entry.isIntersecting
1047
+ container.classList.toggle('is-floating', isFloating)
1048
+ controller.setIsMinimal(isFloating)
1049
+ },
1050
+ { threshold: 0.1 },
1051
+ ).observe(anchor)
1052
+ ```
1053
+
1054
+ Notes:
1055
+ - The anchor stays in the flow with its original 16:9 size, so the page layout does not jump
1056
+ when the player detaches.
1057
+ - The desktop/mobile floating layout is fully CSS-driven; resizing the browser window
1058
+ updates it live with no extra JS.
1059
+
1060
+ You can see this pattern in action in `examples/sdk-react/src/index.tsx` (the
1061
+ `createStickyMiniPlayerDemo` function) with styles in `examples/sdk-react/src/index.css`.
1062
+
909
1063
  **Event Handling:**
910
1064
  - `addEventListener(event: string, callback: (value: T) => void)` - Add event listener
911
1065
  - `removeEventListener(event: string, callback: (value: T) => void)` - Remove event listener
912
1066
 
913
1067
  **Utility:**
1068
+ - `setIsMinimal(isMinimal: boolean)` - Toggle the minimal OSD mode at runtime (see
1069
+ [Minimal OSD / Sticky Mini Player](#minimal-osd--sticky-mini-player))
914
1070
  - `destroy()` - Destroy player and clean up resources
915
1071
 
916
1072
  #### Playback Events
@@ -1111,6 +1267,11 @@ The `WebPlayerProps` interface defines the properties that can be passed to the
1111
1267
  - **`showTvStreamType`** (optional): Whether to show TV stream type indicator
1112
1268
  - **`showCookiesSettings`** (optional): Whether to show cookies settings
1113
1269
  - **`showOsd`** (optional, default: `true`): Whether to show the On-Screen Display (OSD)
1270
+ - **`isMinimal`** (optional, default: `false`): If `true`, the player uses a minimal OSD that
1271
+ exposes only `play`/`pause`, `volume` and `fullscreen` controls. A small center play/pause
1272
+ icon flashes briefly when the state toggles and then fades out.
1273
+ Designed for small/pinned containers such as scroll-fixed mini players. See
1274
+ [Minimal OSD / Sticky Mini Player](#minimal-osd--sticky-mini-player) for usage details.
1114
1275
  - **`showBufferingSpinner`** (optional, default: `true`): Whether to show buffering spinner
1115
1276
 
1116
1277
  ### Audio Properties