@tivio/sdk-react 9.4.0 → 9.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/README.md +305 -103
- package/README.md.bak +305 -103
- package/dist/index.d.ts +82 -3
- package/dist/index.js +1 -1
- package/dist/sdk-react.d.ts +93 -3
- package/package.json +2 -2
package/README.md.bak
CHANGED
@@ -52,6 +52,17 @@ await setUser('userId', { token: 'xxx'})
|
|
52
52
|
await setUser(null)
|
53
53
|
```
|
54
54
|
|
55
|
+
## Single Sign-On (SSO) across subdomains
|
56
|
+
If you want to enable Single Sign-On (SSO) for all subdomains under the same parent domain, you can specify the customTokenCookiesDomain in the configuration object.
|
57
|
+
``` javascript
|
58
|
+
import type { Config } from '@tivio/sdk-react'
|
59
|
+
|
60
|
+
const config: Config = {
|
61
|
+
// ... other required tivio config properties
|
62
|
+
customTokenCookiesDomain: 'example.com' // allows SSO across example.com, app.example.com, admin.example.com, etc.
|
63
|
+
};
|
64
|
+
```
|
65
|
+
|
55
66
|
### Create user with email and password
|
56
67
|
|
57
68
|
Returns user's firebase uid or null if error occurs
|
@@ -315,7 +326,7 @@ const favorites = await tivio.getUser()?.favorites
|
|
315
326
|
favorites[0]?.removeFromFavorites()
|
316
327
|
```
|
317
328
|
|
318
|
-
>
|
329
|
+
> ℹ️ **_Note:_** When user saves favorite without profileId, it will only be shown if the app doesn't have any active user profile.
|
319
330
|
|
320
331
|
### Get screen by ID
|
321
332
|
|
@@ -582,9 +593,63 @@ The VideoController returned by `renderWebPlayer` provides the following methods
|
|
582
593
|
|
583
594
|
The Tivio player supports different types of sources:
|
584
595
|
|
596
|
+
**PathSourceParams** - Path-based sources with ad configuration
|
597
|
+
- Used for playing Tivio-hosted videos and TV channels with custom VAST ad configurations
|
598
|
+
- Supports both `videos/ID` and `tvChannels/ID` paths
|
599
|
+
- Includes `staticAdsConfig` for custom VAST ad insertion
|
600
|
+
- Example usage:
|
601
|
+
```typescript
|
602
|
+
const sourceWithAds = {
|
603
|
+
path: 'videos/123', // or 'tvChannels/456'
|
604
|
+
staticAdsConfig: [
|
605
|
+
{
|
606
|
+
type: 'preroll',
|
607
|
+
url: 'https://example.com/vast-preroll-ad.xml',
|
608
|
+
},
|
609
|
+
{
|
610
|
+
type: 'midroll',
|
611
|
+
from: 30000, // 30 seconds
|
612
|
+
url: 'https://example.com/vast-midroll-ad.xml',
|
613
|
+
},
|
614
|
+
{
|
615
|
+
type: 'postroll',
|
616
|
+
url: 'https://example.com/vast-postroll-ad.xml',
|
617
|
+
},
|
618
|
+
],
|
619
|
+
}
|
620
|
+
```
|
621
|
+
|
622
|
+
**VOD_TIVIO** - Tivio-hosted video-on-demand content
|
623
|
+
- Used for playing videos that are hosted within Tivio's infrastructure
|
624
|
+
- Example usage:
|
625
|
+
```typescript
|
626
|
+
const vodSource = {
|
627
|
+
type: SourceType.VOD_TIVIO,
|
628
|
+
videoPath: 'videos/123', // Video path
|
629
|
+
sourcePlayMode: SourcePlayMode.ON_DEMAND,
|
630
|
+
name: 'Tivio Video',
|
631
|
+
autoplay: false,
|
632
|
+
continuePositionMs: 10000, // Start at 10 seconds (optional)
|
633
|
+
}
|
634
|
+
```
|
635
|
+
|
636
|
+
**CHANNEL** - TV channel content (both classic and virtual channels)
|
637
|
+
- Used for playing live TV channels
|
638
|
+
- Example usage:
|
639
|
+
```typescript
|
640
|
+
const channelSource = {
|
641
|
+
type: SourceType.CHANNEL,
|
642
|
+
path: 'tvChannels/456', // TV channel path
|
643
|
+
sourcePlayMode: SourcePlayMode.LIVE,
|
644
|
+
name: 'TV Channel',
|
645
|
+
autoplay: true,
|
646
|
+
}
|
647
|
+
```
|
648
|
+
|
585
649
|
**VOD_EXTERNAL** - External video-on-demand content from third-party URLs
|
586
650
|
- Used for playing videos that are hosted outside of Tivio's infrastructure
|
587
651
|
- Supports various streaming protocols (HLS, DASH, MP4)
|
652
|
+
- Optionally, you can include `staticAdsConfig` for custom ad insertion
|
588
653
|
- Example usage (single url):
|
589
654
|
```typescript
|
590
655
|
const externalSource = {
|
@@ -595,6 +660,114 @@ const externalSource = {
|
|
595
660
|
name: 'External Video',
|
596
661
|
autoplay: false,
|
597
662
|
continuePositionMs: 10000, // Start at 10 seconds (optional)
|
663
|
+
staticAdsConfig: [
|
664
|
+
{
|
665
|
+
type: 'preroll',
|
666
|
+
url: 'https://example.com/preroll-ad.xml',
|
667
|
+
},
|
668
|
+
{
|
669
|
+
type: 'midroll',
|
670
|
+
from: 20000, // 20 seconds
|
671
|
+
url: 'https://example.com/midroll-ad.xml',
|
672
|
+
},
|
673
|
+
],
|
674
|
+
}
|
675
|
+
```
|
676
|
+
|
677
|
+
**Path-Based Sources**
|
678
|
+
You can also use simple path strings for both video and TV channel sources:
|
679
|
+
```typescript
|
680
|
+
// Video path
|
681
|
+
videoController.setSource('videos/123')
|
682
|
+
|
683
|
+
// TV channel path
|
684
|
+
videoController.setSource('tvChannels/456')
|
685
|
+
```
|
686
|
+
|
687
|
+
#### Static Ads Configuration
|
688
|
+
|
689
|
+
> ℹ️ **_Note:_** To enable ad functionality, you must configure the IMA ad service in your Tivio configuration:
|
690
|
+
> ```typescript
|
691
|
+
> import { AD_SERVICE_PROXY_NAME } from '@tivio/sdk-react'
|
692
|
+
>
|
693
|
+
> const config = {
|
694
|
+
> // ... other config properties
|
695
|
+
> player: {
|
696
|
+
> adService: {
|
697
|
+
> name: AD_SERVICE_PROXY_NAME.IMA,
|
698
|
+
> },
|
699
|
+
> },
|
700
|
+
> }
|
701
|
+
> ```
|
702
|
+
|
703
|
+
The `staticAdsConfig` property lets you specify custom ad insertion points within your content.
|
704
|
+
If multiple ads are set for the same entry point, they will be played one after another in sequence. For example, if you have two preroll ads, the first will play, followed by the second. Similarly, midroll ads that share the same `from` time will be grouped and played sequentially.
|
705
|
+
|
706
|
+
It supports the following ad types:
|
707
|
+
|
708
|
+
**Preroll Ads** - Play before the main content starts
|
709
|
+
```typescript
|
710
|
+
{
|
711
|
+
type: 'preroll',
|
712
|
+
url: 'https://example.com/preroll-ad.xml',
|
713
|
+
}
|
714
|
+
```
|
715
|
+
|
716
|
+
**Midroll Ads** - Play during the main content at specified time
|
717
|
+
```typescript
|
718
|
+
{
|
719
|
+
type: 'midroll',
|
720
|
+
from: 30000, // Time in milliseconds (30 seconds)
|
721
|
+
url: 'https://example.com/midroll-ad.xml',
|
722
|
+
}
|
723
|
+
```
|
724
|
+
|
725
|
+
**Postroll Ads** - Play after the main content ends
|
726
|
+
```typescript
|
727
|
+
{
|
728
|
+
type: 'postroll',
|
729
|
+
url: 'https://example.com/postroll-ad.xml',
|
730
|
+
}
|
731
|
+
```
|
732
|
+
|
733
|
+
**Complete Example:**
|
734
|
+
```typescript
|
735
|
+
const sourceWithAds = {
|
736
|
+
path: 'videos/123',
|
737
|
+
name: 'Video with Multiple Ad Types',
|
738
|
+
staticAdsConfig: [
|
739
|
+
// multiple preroll ads
|
740
|
+
{
|
741
|
+
type: 'preroll',
|
742
|
+
url: 'https://vasterix.joj.sk/api/v1/creative?id=0c5d96fd-2ab9-4207-a325-4607437965e3&vast=4.0',
|
743
|
+
},
|
744
|
+
{
|
745
|
+
type: 'preroll',
|
746
|
+
url: 'https://example.com/preroll-ad.xml',
|
747
|
+
},
|
748
|
+
// multiple midroll ads (with same from time)
|
749
|
+
{
|
750
|
+
type: 'midroll',
|
751
|
+
from: 30000, // 30 seconds
|
752
|
+
url: 'https://example.com/midroll-ad-1.xml',
|
753
|
+
},
|
754
|
+
{
|
755
|
+
type: 'midroll',
|
756
|
+
from: 30000, // 30 seconds
|
757
|
+
url: 'https://example.com/midroll-ad-2.xml',
|
758
|
+
},
|
759
|
+
// one midroll ad with different from time
|
760
|
+
{
|
761
|
+
type: 'midroll',
|
762
|
+
from: 60000, // 1 minute
|
763
|
+
url: 'https://example.com/midroll-ad-2.xml',
|
764
|
+
},
|
765
|
+
// postroll ad
|
766
|
+
{
|
767
|
+
type: 'postroll',
|
768
|
+
url: 'https://example.com/postroll-ad.xml',
|
769
|
+
},
|
770
|
+
],
|
598
771
|
}
|
599
772
|
```
|
600
773
|
- It is also possible to set multiple urls for external source type, e.g. when you want to use both DASH and HLS formats. Player then automatically will pick most suitable format to play depending on device capabilities.
|
@@ -634,6 +807,23 @@ The `setSource` method allows you to dynamically change what's playing:
|
|
634
807
|
// Change to a different video
|
635
808
|
videoController.setSource('videos/newVideoId')
|
636
809
|
|
810
|
+
// Change to a video with custom ads
|
811
|
+
videoController.setSource({
|
812
|
+
path: 'videos/newVideoId',
|
813
|
+
name: 'Video with Ads',
|
814
|
+
staticAdsConfig: [
|
815
|
+
{
|
816
|
+
type: 'preroll',
|
817
|
+
url: 'https://example.com/preroll-ad.xml',
|
818
|
+
},
|
819
|
+
{
|
820
|
+
type: 'midroll',
|
821
|
+
from: 30000,
|
822
|
+
url: 'https://example.com/midroll-ad.xml',
|
823
|
+
},
|
824
|
+
],
|
825
|
+
})
|
826
|
+
|
637
827
|
// Change to an external video
|
638
828
|
videoController.setSource({
|
639
829
|
type: SourceType.VOD_EXTERNAL,
|
@@ -645,6 +835,18 @@ videoController.setSource({
|
|
645
835
|
// Change to a TV channel
|
646
836
|
videoController.setSource('tvChannels/channelId')
|
647
837
|
|
838
|
+
// Change to a TV channel with custom ads
|
839
|
+
videoController.setSource({
|
840
|
+
path: 'tvChannels/channelId',
|
841
|
+
name: 'TV Channel with Ads',
|
842
|
+
staticAdsConfig: [
|
843
|
+
{
|
844
|
+
type: 'preroll',
|
845
|
+
url: 'https://example.com/tv-preroll-ad.xml',
|
846
|
+
},
|
847
|
+
],
|
848
|
+
})
|
849
|
+
|
648
850
|
// Stop playback
|
649
851
|
videoController.setSource(null)
|
650
852
|
```
|
@@ -665,6 +867,107 @@ The `setSource` method is particularly useful for:
|
|
665
867
|
|
666
868
|
The VideoController emits various events that you can listen to:
|
667
869
|
|
870
|
+
#### Ad events
|
871
|
+
|
872
|
+
```typescript
|
873
|
+
videoController.addEventListener('ad_started', (adMetadata: AdMetadata | null) => {
|
874
|
+
if (!adMetadata) {
|
875
|
+
console.log('Ad started playing (no metadata available)')
|
876
|
+
return
|
877
|
+
}
|
878
|
+
|
879
|
+
console.log('Ad started playing', adMetadata)
|
880
|
+
|
881
|
+
if ('customAdMetadata' in adMetadata && adMetadata.customAdMetadata) {
|
882
|
+
console.log('Ad custom metadata:', adMetadata.customAdMetadata)
|
883
|
+
// customAdMetadata contains VAST trafficking parameters (from VAST AdParameters tag)
|
884
|
+
}
|
885
|
+
|
886
|
+
// Access CTA element for rendering custom call-to-action buttons
|
887
|
+
const { ctaElement } = adMetadata
|
888
|
+
if (ctaElement) {
|
889
|
+
console.log('CTA element available for rendering custom buttons', ctaElement)
|
890
|
+
|
891
|
+
const { customAdMetadata } = adMetadata
|
892
|
+
if (!customAdMetadata) {
|
893
|
+
console.log('No custom ad metadata available')
|
894
|
+
return
|
895
|
+
}
|
896
|
+
|
897
|
+
const { extensions } = customAdMetadata
|
898
|
+
if (!extensions) {
|
899
|
+
console.log('No extensions available')
|
900
|
+
return
|
901
|
+
}
|
902
|
+
|
903
|
+
const { parameters } = extensions[0]
|
904
|
+
if (!parameters) {
|
905
|
+
console.log('No parameters available')
|
906
|
+
return
|
907
|
+
}
|
908
|
+
|
909
|
+
const metadataParameters = parameters as {
|
910
|
+
main_title?: string
|
911
|
+
subtitle?: string
|
912
|
+
image?: string
|
913
|
+
button_text: string
|
914
|
+
url: string
|
915
|
+
}
|
916
|
+
|
917
|
+
const buttonText = metadataParameters.button_text as string | undefined
|
918
|
+
|
919
|
+
if (!buttonText) {
|
920
|
+
console.log('No button text available')
|
921
|
+
return
|
922
|
+
}
|
923
|
+
|
924
|
+
// Example: Create a custom CTA button using React portal
|
925
|
+
const CTAButton = () => (
|
926
|
+
<div style={{
|
927
|
+
position: 'absolute',
|
928
|
+
bottom: '20px',
|
929
|
+
right: '20px',
|
930
|
+
backgroundColor: 'rgba(0, 0, 0, 0.8)',
|
931
|
+
color: 'white',
|
932
|
+
padding: '12px 24px',
|
933
|
+
borderRadius: '6px',
|
934
|
+
cursor: 'pointer',
|
935
|
+
fontSize: '16px',
|
936
|
+
fontWeight: 'bold',
|
937
|
+
pointerEvents: 'auto',
|
938
|
+
}}>
|
939
|
+
Learn More
|
940
|
+
</div>
|
941
|
+
)
|
942
|
+
|
943
|
+
// Render the CTA button using React portal
|
944
|
+
const root = ReactDOM.createRoot(ctaElement)
|
945
|
+
root.render(<CTAButton />)
|
946
|
+
}
|
947
|
+
|
948
|
+
// adMetadata contains information like:
|
949
|
+
// - ctaElement?: HTMLElement (for rendering custom CTA buttons)
|
950
|
+
// - customAdMetadata?: Record<string, unknown> (for IMA ads with rich metadata)
|
951
|
+
// - type: 'ad'
|
952
|
+
// - subType: 'inserted' | 'original'
|
953
|
+
// - secondsToEnd: number
|
954
|
+
// - secondsToSkippable: number | null
|
955
|
+
// - canTriggerSkip: boolean
|
956
|
+
// - isSkippable: boolean
|
957
|
+
// - order: number | null
|
958
|
+
// - totalCount: number | null
|
959
|
+
// - skip: () => void
|
960
|
+
// Update UI, show ad overlay, etc.
|
961
|
+
})
|
962
|
+
|
963
|
+
videoController.addEventListener('ad_ended', () => {
|
964
|
+
console.log('Ad finished playing')
|
965
|
+
})
|
966
|
+
```
|
967
|
+
|
968
|
+
> ℹ️ **_Note:_** The CTA overlay element is visible in the WebPlayer only while an ad is playing and is automatically cleaned up on source changes.
|
969
|
+
|
970
|
+
#### Video state changes
|
668
971
|
```typescript
|
669
972
|
// Video state changes
|
670
973
|
videoController.addEventListener('statechange', (state) => {
|
@@ -737,105 +1040,4 @@ The `WebPlayerProps` interface defines the properties that can be passed to the
|
|
737
1040
|
|
738
1041
|
### Visual Properties
|
739
1042
|
|
740
|
-
- **`showMarkers
|
741
|
-
- **`markerColor`** (optional): Color for video markers (CSS color value)
|
742
|
-
- **`showTvStreamType`** (optional): Whether to show TV stream type indicator
|
743
|
-
- **`showCookiesSettings`** (optional): Whether to show cookies settings
|
744
|
-
- **`showOsd`** (optional, default: `true`): Whether to show the On-Screen Display (OSD)
|
745
|
-
- **`showBufferingSpinner`** (optional, default: `true`): Whether to show buffering spinner
|
746
|
-
|
747
|
-
### Audio Properties
|
748
|
-
|
749
|
-
- **`isMutedByDefault`** (optional): If `true`, the player starts muted but can be unmuted
|
750
|
-
|
751
|
-
### Keyboard Shortcuts Properties
|
752
|
-
|
753
|
-
- **`enableKeyboardShortcuts`** (optional, default: `true`): Whether to enable keyboard shortcuts
|
754
|
-
- **`customShortcuts`** (optional): Custom keyboard shortcuts configuration:
|
755
|
-
```typescript
|
756
|
-
{
|
757
|
-
toggleFullscreen: number[], // Array of key codes
|
758
|
-
togglePause: number[],
|
759
|
-
toggleMute: number[],
|
760
|
-
jumpForward: number[],
|
761
|
-
jumpBack: number[],
|
762
|
-
volumeUp: number[],
|
763
|
-
volumeDown: number[]
|
764
|
-
}
|
765
|
-
```
|
766
|
-
|
767
|
-
### Ad Block Properties
|
768
|
-
|
769
|
-
- **`checkAdBlock`** (optional, default: `false`): Whether to check for ad blockers and show warnings
|
770
|
-
|
771
|
-
## Data hooks
|
772
|
-
Gets information about current user.
|
773
|
-
|
774
|
-
```ts
|
775
|
-
useUser: () => {
|
776
|
-
user: User | null
|
777
|
-
error: string | null
|
778
|
-
isInitialized: boolean
|
779
|
-
}
|
780
|
-
```
|
781
|
-
|
782
|
-
### useRowsInScreen hook
|
783
|
-
Gets array of Rows objects of specific screen and subscribes to its changes.
|
784
|
-
|
785
|
-
```ts
|
786
|
-
/**
|
787
|
-
* Use rows in screen
|
788
|
-
* @param screenId - screen id (from studio.tiv.io)
|
789
|
-
* @param options - subscription options
|
790
|
-
*/
|
791
|
-
useRowsInScreen: (screenId: string, options?: PaginationOptions) => {
|
792
|
-
pagination: PaginationInterface<Row> | null
|
793
|
-
error: Error | null
|
794
|
-
}
|
795
|
-
```
|
796
|
-
|
797
|
-
### useItemsInRow hook
|
798
|
-
Gets array of row items objects of specific row and subscribes to its changes.
|
799
|
-
|
800
|
-
```ts
|
801
|
-
/**
|
802
|
-
* Use row items
|
803
|
-
* @param rowId - row ID
|
804
|
-
* @param options - subscription options
|
805
|
-
*/
|
806
|
-
useItemsInRow: (rowId: string, options?: SubscribeToItemsInRowOptions) => {
|
807
|
-
pagination: PaginationInterface<ItemInRow> | null
|
808
|
-
error: Error | null
|
809
|
-
}
|
810
|
-
```
|
811
|
-
|
812
|
-
### useVideo hook
|
813
|
-
|
814
|
-
Gets Video object and subscribes to its changes.
|
815
|
-
|
816
|
-
```ts
|
817
|
-
/**
|
818
|
-
* Use video
|
819
|
-
* @param videoId - video id
|
820
|
-
*/
|
821
|
-
useVideo: (videoId: string) => {
|
822
|
-
error: string | null;
|
823
|
-
data: Video | null;
|
824
|
-
}
|
825
|
-
```
|
826
|
-
|
827
|
-
### useTaggedVideos hook
|
828
|
-
Gets videos with given tag IDs.
|
829
|
-
|
830
|
-
```ts
|
831
|
-
/**
|
832
|
-
* Use tagged videos
|
833
|
-
* @param tagIds - tag ids
|
834
|
-
* @param options - subscription options
|
835
|
-
* @public
|
836
|
-
*/
|
837
|
-
useTaggedVideos: (tagIds: string[], options?: SubscribeToItemsInRowOptions) => {
|
838
|
-
pagination: PaginationInterface<Video> | null
|
839
|
-
error: Error | null
|
840
|
-
}
|
841
|
-
```
|
1043
|
+
- **`showMarkers`
|
package/dist/index.d.ts
CHANGED
@@ -1,3 +1,4 @@
|
|
1
|
+
import { AD_SERVICE_PROXY_NAME } from '@tivio/common';
|
1
2
|
import type { ComponentType } from 'react';
|
2
3
|
import type dayjs from 'dayjs';
|
3
4
|
import { DocumentReference } from '@firebase/firestore-types';
|
@@ -34,6 +35,8 @@ declare interface actualPriceDetails {
|
|
34
35
|
currency?: primaSupportedCurrency;
|
35
36
|
}
|
36
37
|
|
38
|
+
export { AD_SERVICE_PROXY_NAME }
|
39
|
+
|
37
40
|
export declare type AdBannerScene = InteractiveWidgetSceneBase<InteractiveWidgetSceneTemplateType.AD_BANNER>;
|
38
41
|
|
39
42
|
export declare type AddEditCommentResponse = {
|
@@ -100,6 +103,7 @@ export declare type AdMetadata = {
|
|
100
103
|
isSkippable: boolean;
|
101
104
|
order: number | null;
|
102
105
|
totalCount: number | null;
|
106
|
+
customAdMetadata?: Record<string, unknown>;
|
103
107
|
skip: () => void;
|
104
108
|
} | null;
|
105
109
|
|
@@ -217,6 +221,10 @@ export declare interface AdSourceInterface extends CommonSourceInterface<SourceT
|
|
217
221
|
skipAll(): void;
|
218
222
|
onRemainingTimeChanged(ms: number): void;
|
219
223
|
click(): void;
|
224
|
+
/**
|
225
|
+
* Rich IMA ad metadata including customAdMetadata (only available for IMA ads)
|
226
|
+
*/
|
227
|
+
imaAdMetadata?: any;
|
220
228
|
}
|
221
229
|
|
222
230
|
/**
|
@@ -1210,7 +1218,8 @@ export declare enum CustomerId {
|
|
1210
1218
|
KAROL_A_KVIDO = "KAROL_A_KVIDO",
|
1211
1219
|
UZ_BUDU = "UZ_BUDU",
|
1212
1220
|
PRIMA = "PRIMA",
|
1213
|
-
NORA_FRIDRICHOVA = "NORA_FRIDRICHOVA"
|
1221
|
+
NORA_FRIDRICHOVA = "NORA_FRIDRICHOVA",
|
1222
|
+
LONGEVITY = "LONGEVITY"
|
1214
1223
|
}
|
1215
1224
|
|
1216
1225
|
export declare interface CustomScript {
|
@@ -3056,6 +3065,20 @@ export declare interface PartialRegistrationOverlayContextState {
|
|
3056
3065
|
voucher?: string;
|
3057
3066
|
}
|
3058
3067
|
|
3068
|
+
/**
|
3069
|
+
* @public
|
3070
|
+
* Generic interface for sources that can be identified by a path (video or TV channel)
|
3071
|
+
*/
|
3072
|
+
export declare type PathSourceParams = PathSourceParamsTvChannel | PathSourceParamsVideo;
|
3073
|
+
|
3074
|
+
declare interface PathSourceParamsTvChannel extends Partial<ChannelSourceParams> {
|
3075
|
+
path: `tvChannels/${string}`;
|
3076
|
+
}
|
3077
|
+
|
3078
|
+
declare interface PathSourceParamsVideo extends Partial<Omit<VodTivioSourceParams, 'videoPath'>> {
|
3079
|
+
path: `videos/${string}`;
|
3080
|
+
}
|
3081
|
+
|
3059
3082
|
export declare type PatreonCreatorData = {
|
3060
3083
|
campaign: string;
|
3061
3084
|
tiers: Tier[];
|
@@ -3502,6 +3525,7 @@ export declare interface PlayerSourceInterface<T extends NonAdSourceType = NonAd
|
|
3502
3525
|
start?: Date;
|
3503
3526
|
from?: Date;
|
3504
3527
|
sourceHistory?: string[];
|
3528
|
+
staticAdsConfig?: StaticAdsBreak[];
|
3505
3529
|
}
|
3506
3530
|
|
3507
3531
|
/**
|
@@ -3520,6 +3544,7 @@ export declare interface PlayerSourceParams<T extends NonAdSourceType = NonAdSou
|
|
3520
3544
|
seekingMatrix?: SeekingMatrixTemplate;
|
3521
3545
|
sessionType?: VideoSourceField['sessionType'];
|
3522
3546
|
sessionId?: string;
|
3547
|
+
staticAdsConfig?: StaticAdsBreak[];
|
3523
3548
|
}
|
3524
3549
|
|
3525
3550
|
export declare type PlayersScene = InteractiveWidgetSceneBase<InteractiveWidgetSceneTemplateType.PLAYERS>;
|
@@ -3680,7 +3705,15 @@ export declare enum PlayerWrapperEvents {
|
|
3680
3705
|
/**
|
3681
3706
|
* Un-pause was triggered
|
3682
3707
|
*/
|
3683
|
-
'unpause_triggered' = "unpause_triggered"
|
3708
|
+
'unpause_triggered' = "unpause_triggered",
|
3709
|
+
/**
|
3710
|
+
* Triggered when an ad starts playing
|
3711
|
+
*/
|
3712
|
+
'ad_started' = "ad_started",
|
3713
|
+
/**
|
3714
|
+
* Triggered when an ad finishes playing
|
3715
|
+
*/
|
3716
|
+
'ad_ended' = "ad_ended"
|
3684
3717
|
}
|
3685
3718
|
|
3686
3719
|
/**
|
@@ -3940,6 +3973,11 @@ export declare type Purchase = {
|
|
3940
3973
|
voucherId: string | null;
|
3941
3974
|
isVoucherActivation?: boolean;
|
3942
3975
|
rebalancingVideoRef?: any;
|
3976
|
+
/**
|
3977
|
+
* Returns all purchases that are connected via originalPurchaseRef.
|
3978
|
+
* For example, if user has subscription purchase, this method will return all purchases that are RENEWED + PAID/CANCELLED latest one.
|
3979
|
+
*/
|
3980
|
+
getRelatedPurchases: () => Promise<Purchase[]>;
|
3943
3981
|
};
|
3944
3982
|
|
3945
3983
|
/**
|
@@ -5362,6 +5400,21 @@ export declare interface SimplifiedVideoController {
|
|
5362
5400
|
muted: boolean;
|
5363
5401
|
volume: number;
|
5364
5402
|
}) => void): void;
|
5403
|
+
/**
|
5404
|
+
* Add an event listener for ad started events
|
5405
|
+
* @param event - Must be 'ad_started'
|
5406
|
+
* @param callback - Function called when an ad starts playing
|
5407
|
+
*/
|
5408
|
+
addEventListener(event: 'ad_started', callback: (adMetadata: AdMetadata & {
|
5409
|
+
customAdMetadata?: Record<string, unknown> | null;
|
5410
|
+
ctaElement: HTMLElement | null;
|
5411
|
+
}) => void): void;
|
5412
|
+
/**
|
5413
|
+
* Add an event listener for ad ended events
|
5414
|
+
* @param event - Must be 'ad_ended'
|
5415
|
+
* @param callback - Function called when an ad finishes playing
|
5416
|
+
*/
|
5417
|
+
addEventListener(event: 'ad_ended', callback: () => void): void;
|
5365
5418
|
/**
|
5366
5419
|
* Remove an event listener
|
5367
5420
|
* @param event - The event name to stop listening for
|
@@ -5373,6 +5426,7 @@ export declare interface SimplifiedVideoController {
|
|
5373
5426
|
* @param source - The new source to load (can be a video path, channel path, or source parameters)
|
5374
5427
|
*/
|
5375
5428
|
setSource(source: WebPlayerProps['source']): void;
|
5429
|
+
setAdsConfig(adsConfig: StaticAdsBreak[]): void;
|
5376
5430
|
/**
|
5377
5431
|
* Destroy the player and clean up all resources
|
5378
5432
|
*/
|
@@ -5492,6 +5546,19 @@ export declare interface StartLiveStreamResponse {
|
|
5492
5546
|
error?: string;
|
5493
5547
|
}
|
5494
5548
|
|
5549
|
+
export declare type StaticAdsBreak = StaticAdsBreakPostrollPreroll | StaticAdsBreakMidroll;
|
5550
|
+
|
5551
|
+
export declare interface StaticAdsBreakMidroll {
|
5552
|
+
type: 'midroll';
|
5553
|
+
from: number;
|
5554
|
+
url: string;
|
5555
|
+
}
|
5556
|
+
|
5557
|
+
declare interface StaticAdsBreakPostrollPreroll {
|
5558
|
+
type: 'preroll' | 'postroll';
|
5559
|
+
url: string;
|
5560
|
+
}
|
5561
|
+
|
5495
5562
|
/**
|
5496
5563
|
* @public
|
5497
5564
|
*/
|
@@ -5969,6 +6036,12 @@ export declare interface TivioConfig {
|
|
5969
6036
|
* (otherwise organizations would share login token).
|
5970
6037
|
*/
|
5971
6038
|
customerId?: CustomerId;
|
6039
|
+
/**
|
6040
|
+
* An optional variable that enables Single Sign-On (SSO) for all subdomains under the same parent domain.
|
6041
|
+
* @example
|
6042
|
+
* customTokenCookiesDomain: 'example.com'
|
6043
|
+
*/
|
6044
|
+
customTokenCookiesDomain?: string;
|
5972
6045
|
}
|
5973
6046
|
|
5974
6047
|
/**
|
@@ -7192,6 +7265,7 @@ export declare enum VastProvider {
|
|
7192
7265
|
TEST = "test",
|
7193
7266
|
TEST_VPAID = "test-vpaid",
|
7194
7267
|
TIVIO_ADS = "tivio-ads",
|
7268
|
+
STATIC_ADS_PROVIDER = "static-ads-provider",
|
7195
7269
|
JOJ_TEST_AD_FORM_PROGRAMMATIC = "joj-test-ad-form-programmatic",
|
7196
7270
|
JOJ_TEST_TESTER_VASTERIX = "joj-test-tester-vasterix",
|
7197
7271
|
JOJ_TEST_TESTER_ADFORM_30 = "joj-test-tester-adform-30"
|
@@ -7333,6 +7407,9 @@ export declare interface VideoController {
|
|
7333
7407
|
muted: boolean;
|
7334
7408
|
volume: number;
|
7335
7409
|
}) => void): void;
|
7410
|
+
addEventListener(event: 'ad_started', callback: (value: AdMetadata & {
|
7411
|
+
adCtaElement: HTMLElement | null;
|
7412
|
+
}) => void): void;
|
7336
7413
|
/**
|
7337
7414
|
* Remove an event listener
|
7338
7415
|
* @param event - The event name to stop listening for
|
@@ -7458,6 +7535,7 @@ export declare interface VideoController {
|
|
7458
7535
|
* @param mutations - Array of DOM mutation records
|
7459
7536
|
*/
|
7460
7537
|
onWatermarkElementChange(mutations: MutationRecord[]): void;
|
7538
|
+
setAdCtaElement: (element: HTMLElement | null) => void;
|
7461
7539
|
}
|
7462
7540
|
|
7463
7541
|
declare type VideoDetailResponsiveField = OrganizationResponsiveSetting<{
|
@@ -8062,7 +8140,7 @@ export declare interface WebGridScreenProps {
|
|
8062
8140
|
*/
|
8063
8141
|
export declare interface WebPlayerProps {
|
8064
8142
|
id: string;
|
8065
|
-
source?: InputSourceParams | VideoPath | ChannelPath | null;
|
8143
|
+
source?: InputSourceParams | PathSourceParams | VideoPath | ChannelPath | null;
|
8066
8144
|
onEnded?: () => any;
|
8067
8145
|
/**
|
8068
8146
|
* If true, the player will inherit the width and height of its parent element.
|
@@ -8148,6 +8226,7 @@ export declare interface WebPlayerProps {
|
|
8148
8226
|
setPaymentOverlayVisible?: React_2.Dispatch<React_2.SetStateAction<boolean>>;
|
8149
8227
|
hideOverlay?: boolean;
|
8150
8228
|
sourcePlayMode?: SourcePlayMode;
|
8229
|
+
adsConfig?: StaticAdsBreak[];
|
8151
8230
|
}
|
8152
8231
|
|
8153
8232
|
/**
|