@tivio/sdk-react 3.5.2 → 3.6.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (63) hide show
  1. package/README.md +12 -3
  2. package/README.md.bak +12 -3
  3. package/dist/index.d.ts +1946 -21
  4. package/dist/index.js +1 -1
  5. package/dist/index.js.LICENSE.txt +12 -0
  6. package/package.json +10 -7
  7. package/dist/components/ContextProvider.d.ts +0 -7
  8. package/dist/components/PlayerProvider.d.ts +0 -19
  9. package/dist/components/TivioProvider.d.ts +0 -16
  10. package/dist/components/TivioWidget.d.ts +0 -7
  11. package/dist/components/TivioWidgetError.d.ts +0 -10
  12. package/dist/components/TivioWidgetLoader.d.ts +0 -6
  13. package/dist/components/TvTivioProvider.d.ts +0 -7
  14. package/dist/components/context/ChannelsContext.d.ts +0 -6
  15. package/dist/components/context/RowItemsContext.d.ts +0 -7
  16. package/dist/components/context/ScreensContext.d.ts +0 -6
  17. package/dist/components/context/SectionsContext.d.ts +0 -6
  18. package/dist/components/context/VideosContext.d.ts +0 -6
  19. package/dist/components/context/index.d.ts +0 -5
  20. package/dist/components/context/types.d.ts +0 -27
  21. package/dist/components/hooks/contentHooks.d.ts +0 -68
  22. package/dist/components/hooks/index.d.ts +0 -22
  23. package/dist/components/hooks/playerHooks.d.ts +0 -28
  24. package/dist/components/hooks/useApplyInviteCode.d.ts +0 -17
  25. package/dist/components/hooks/useCancelSubscription.d.ts +0 -2
  26. package/dist/components/hooks/useError.d.ts +0 -9
  27. package/dist/components/hooks/useFreePurchase.d.ts +0 -4
  28. package/dist/components/hooks/useIsMonetizationPurchased.d.ts +0 -3
  29. package/dist/components/hooks/useItemsInRow.d.ts +0 -11
  30. package/dist/components/hooks/useLastVideoByWidgetId.d.ts +0 -5
  31. package/dist/components/hooks/useOrganizationSubscriptions.d.ts +0 -3
  32. package/dist/components/hooks/usePurchaseRecovery.d.ts +0 -14
  33. package/dist/components/hooks/usePurchaseSubscription.d.ts +0 -4
  34. package/dist/components/hooks/usePurchasesWithVideos.d.ts +0 -7
  35. package/dist/components/hooks/useRowsInScreen.d.ts +0 -6
  36. package/dist/components/hooks/useScreen.d.ts +0 -10
  37. package/dist/components/hooks/useScreens.d.ts +0 -5
  38. package/dist/components/hooks/useSearch.d.ts +0 -8
  39. package/dist/components/hooks/useTaggedVideos.d.ts +0 -11
  40. package/dist/components/hooks/useTivio.d.ts +0 -3
  41. package/dist/components/hooks/useTransactionPayment.d.ts +0 -5
  42. package/dist/components/hooks/useUser.d.ts +0 -5
  43. package/dist/components/hooks/useVoucher.d.ts +0 -42
  44. package/dist/components/hooks/useWatchWithoutAdsOffer.d.ts +0 -4
  45. package/dist/config.d.ts +0 -20
  46. package/dist/info.d.ts +0 -2
  47. package/dist/services/bundleLoader.d.ts +0 -15
  48. package/dist/services/bundlePromise.d.ts +0 -7
  49. package/dist/services/dependencyResolver.d.ts +0 -24
  50. package/dist/services/gdpr.d.ts +0 -1
  51. package/dist/services/localFetch/coreReactDomDist.d.ts +0 -1
  52. package/dist/services/localFetch/none.d.ts +0 -1
  53. package/dist/services/logger.d.ts +0 -26
  54. package/dist/services/login.d.ts +0 -9
  55. package/dist/services/packageLoader.d.ts +0 -6
  56. package/dist/services/pubSub.d.ts +0 -13
  57. package/dist/services/sentry.d.ts +0 -4
  58. package/dist/services/settings.d.ts +0 -13
  59. package/dist/types/bundle.types.d.ts +0 -444
  60. package/dist/types/common.d.ts +0 -6
  61. package/dist/types/config.types.d.ts +0 -0
  62. package/dist/types/customPlayer.types.d.ts +0 -171
  63. package/dist/types/types.d.ts +0 -174
@@ -1,171 +0,0 @@
1
- import { Empty } from './common';
2
- export declare type ChannelSource = {
3
- new (uri: string, originalOptions: Record<string, any>, channelName: string, programName: string, programDescription: string, from: Date, to: Date): ChannelSource;
4
- description: string;
5
- name: string;
6
- uri: string;
7
- from: Date;
8
- channelName: string;
9
- to: Date;
10
- type: 'channel';
11
- watchWithoutAdsRecommendation: {
12
- showPurchaseDialog: () => void;
13
- } | null;
14
- };
15
- export declare type AdSource = {
16
- new (uri: string, name: string, description: string, skipDelayMs: number | null, adDurationMs: number, trackingContext?: any, // internal Tivio types
17
- adMarker?: any, // internal Tivio types
18
- packInfo?: any, // internal Tivio types
19
- provider?: any): AdSource;
20
- description: string;
21
- name: string;
22
- uri: string;
23
- durationMs: number;
24
- skipDelayMs: number | null;
25
- type: 'ad';
26
- /**
27
- * true if is skippable and skip countdown has passed
28
- */
29
- canSkip: boolean;
30
- /**
31
- * true ad if is skippable after some skipDelayMs (if it is skippable, skipDelayMs is defined)
32
- */
33
- isSkippable: boolean;
34
- /**
35
- * Skip ad. Only works when canSkip is true
36
- */
37
- skip: () => void;
38
- /**
39
- * Order in ad break (ad break is a group of ads played right after each other)
40
- */
41
- order: number;
42
- /**
43
- * Total number of ads in ad break (ad break is a group of ads played right after each other)
44
- */
45
- totalCount: number;
46
- secondsToEnd: number;
47
- secondsToSkippable: number | null;
48
- };
49
- export declare type VodTivioSource = {
50
- new (uri: string, videoId: string, name: string, description: string, adMonetizationId?: string): VodTivioSource;
51
- type: 'vod_tivio';
52
- description: string;
53
- name: string;
54
- uri: string;
55
- };
56
- export declare type VodExternalSource = {
57
- new (uri: string, monetizationId: string, name: string, description: string, originalOptions: Record<string, any>): VodTivioSource;
58
- type: 'vod_external';
59
- description: string;
60
- name: string;
61
- uri: string;
62
- };
63
- export declare type InputSource = AdSource | ChannelSource | VodTivioSource | VodExternalSource;
64
- declare type PlayerState = 'playing' | 'paused' | 'idle';
65
- export interface PlayerInterface {
66
- pause: () => void;
67
- /**
68
- * unpause
69
- */
70
- play: () => void;
71
- /**
72
- * @param {number} ms - milliseconds relative to start of video (relative to 0 ms)
73
- * or in case of TV programs relative to start of the program (relative to source.from ms)
74
- */
75
- seekTo: (ms: number) => void;
76
- /**
77
- * Source to be passed to player.
78
- *
79
- * Depending on autoplay settings it should either start playing
80
- * immediately or just be loaded by player and stay paused.
81
- */
82
- setSource: (source: InputSource | null) => void;
83
- /**
84
- * volume in [0,1]
85
- */
86
- setVolume?: (volume: number) => void;
87
- mute?: () => void;
88
- /**
89
- * restore volume to previous value
90
- */
91
- unmute?: () => void;
92
- }
93
- export declare type PlayerWrapper = {
94
- /**
95
- * Report that playback of video has finished
96
- */
97
- onPlaybackEnded: () => void;
98
- /**
99
- * Report video progress in milliseconds
100
- */
101
- onTimeChanged: (ms: number) => void;
102
- /**
103
- * Report that video state changed
104
- */
105
- onStateChanged: (state: PlayerState) => void;
106
- /**
107
- * Send source to Tivio
108
- */
109
- onSourceChanged: (source: InputSource | null) => void;
110
- /**
111
- * Report that video failed to load (never started playing)
112
- */
113
- onLoadError: (error: Error) => void;
114
- /**
115
- * Report that video failed during playback (successfully loaded and then failed, e.g. part of stream is invalid)
116
- */
117
- onError: (error: Error) => void;
118
- /**
119
- * Unpause video
120
- */
121
- play: () => void;
122
- /**
123
- * Pause video
124
- */
125
- pause: () => void;
126
- /**
127
- * Currently playing source
128
- */
129
- source: InputSource | null;
130
- events: {
131
- isSupported: (even: string) => boolean;
132
- addListener: <T = any>(event: string, cb: (value: T) => Empty) => void;
133
- removeListener: <T = any>(event: string, cb: (value: T) => Empty) => void;
134
- removeAllListeners: () => void;
135
- };
136
- /**
137
- * Register a low level player that implements player methods, like play video, change volume, etc.
138
- */
139
- register: (playerInterface: PlayerInterface) => void;
140
- /**
141
- * duration of current source in ms (both setter and getter)
142
- */
143
- durationMs: number | null;
144
- isPlaybackStarted: boolean;
145
- isPaused: boolean;
146
- isPlaying: boolean;
147
- isIdle: boolean;
148
- error: Error | null;
149
- /**
150
- * Replay the video that finished playback
151
- */
152
- replay: () => void;
153
- /**
154
- * Retry to play a video that failed to start playing (e.g. due to a network error)
155
- */
156
- retry: () => void;
157
- togglePlayPause: () => void;
158
- seekTo: (ms: number) => void;
159
- /**
160
- * set volume to value between 0,1
161
- */
162
- setVolume: (volume: number) => void;
163
- /**
164
- * change volume by value between -1,1
165
- */
166
- changeVolumeBy: (volume: number) => void;
167
- setMuted: (muted: boolean) => void;
168
- toggleMuted: () => void;
169
- };
170
- export declare type UsePlayerEvent = <T = any>(eventName: string) => T | null;
171
- export {};
@@ -1,174 +0,0 @@
1
- /**
2
- * Copyright (c) 2021, nangu.TV, a.s. All rights reserved.
3
- * nangu.TV, a.s PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
4
- */
5
- /**
6
- * Export public client side API
7
- */
8
- import type { Monetization, Video, User } from '@tivio/common';
9
- import type React from 'react';
10
- declare type RemoteProviderProps = {
11
- disableUnmounting?: boolean;
12
- language?: string;
13
- };
14
- declare enum LangCode {
15
- CS = "cs",
16
- DE = "de",
17
- EN = "en",
18
- FR = "fr",
19
- PL = "pl",
20
- SK = "sk",
21
- SP = "sp"
22
- }
23
- declare type Widget = {
24
- id: string;
25
- channels: Channel[];
26
- isEnabled: boolean | null;
27
- name: string | null;
28
- recentVideos: Video[] | null;
29
- widgetId: string | null;
30
- lastVideo: Video | null;
31
- };
32
- declare type Channel = {
33
- id: string;
34
- name: string;
35
- header: string;
36
- headerLogo: string;
37
- recentVideos: Video[];
38
- };
39
- declare type Section = {
40
- id: string;
41
- name: string;
42
- channel: Channel;
43
- videos: Video[];
44
- };
45
- declare type Chapter = any;
46
- declare type Purchase = {
47
- isPurchased: boolean;
48
- monetizationId: string;
49
- videoId: string;
50
- status: string;
51
- video: Video | null;
52
- };
53
- declare type Marker = {
54
- id: string;
55
- type: string;
56
- from: Date;
57
- to: Date;
58
- count?: number;
59
- fromMs?: number;
60
- toMs?: number;
61
- };
62
- declare type BetOffer = {
63
- betService: string;
64
- league: string;
65
- odds: {
66
- winner: string;
67
- rate: number;
68
- }[];
69
- sport: string;
70
- opponent1: string;
71
- opponent2: string;
72
- time: Date;
73
- };
74
- export interface TivioWidgetProps {
75
- id: string;
76
- ref: React.MutableRefObject<TivioWidgetRef>;
77
- onEnabled?: (enabled: boolean) => any;
78
- onBlur?: (event: {
79
- key: string;
80
- width: number;
81
- x: number;
82
- }) => any;
83
- }
84
- export interface TivioWidgetRef {
85
- focus: (args: {
86
- x?: number;
87
- }) => void;
88
- handleKey: (key: string) => ({
89
- handled: boolean;
90
- x: number;
91
- });
92
- unfocus: () => ({
93
- x: number;
94
- });
95
- }
96
- interface VodTivioSourcePojo {
97
- type: 'VodTivioSource';
98
- description: string;
99
- path: string;
100
- name: string;
101
- uri: string;
102
- poster?: string;
103
- adMonetizationId?: string;
104
- }
105
- interface ChannelSourcePojo {
106
- type: 'ChannelSource';
107
- uri: string;
108
- originalOptions: any;
109
- channelName: string;
110
- programName: string;
111
- programDescription: string;
112
- from: Date;
113
- to: Date;
114
- poster?: string;
115
- }
116
- declare type VideoPath = string;
117
- interface WebPlayerProps {
118
- id: string;
119
- source?: VodTivioSourcePojo | ChannelSourcePojo | VideoPath | null;
120
- onEnded?: () => any;
121
- /**
122
- * If this function is specified, then "Back" button is shown in top right corner.
123
- */
124
- onBack?: () => void;
125
- className?: string;
126
- /**
127
- * default false
128
- *
129
- * If you choose `autoplay` make sure that autoplay is allowed in the specific situation.
130
- * In some cases it may not be allowed, e.g. before the user interacted with the site, and the video
131
- * will stay paused.
132
- *
133
- * Source: https://developer.mozilla.org/en-US/docs/Web/Media/Autoplay_guide
134
- */
135
- autoplay?: boolean;
136
- /**
137
- * default false
138
- */
139
- canReplay?: boolean;
140
- /**
141
- * default false
142
- */
143
- showMarkers?: boolean;
144
- /**
145
- * number[] is array of keyboard event.which numeric codes
146
- * (see https://keycode.info/)
147
- */
148
- customShortcuts?: Partial<{
149
- toggleFullscreen: number[];
150
- togglePause: number[];
151
- toggleMute: number[];
152
- jumpForward: number[];
153
- jumpBack: number[];
154
- volumeUp: number[];
155
- volumeDown: number[];
156
- }>;
157
- /**
158
- * default true
159
- */
160
- enableKeyboardShortcuts?: boolean;
161
- onProgress?: (event: React.ChangeEvent<HTMLVideoElement>) => void;
162
- /**
163
- * @deprecated this callback is never called. Will be removed in @tivio/sdk-react version 4
164
- */
165
- onPlayerControllerCreated?: (playerController: any) => void;
166
- }
167
- declare type TivioSources = {
168
- AdSource: any;
169
- ChannelSource: any;
170
- VodExternalSource: any;
171
- VodTivioSource: any;
172
- };
173
- export type { RemoteProviderProps, WebPlayerProps, Marker, BetOffer, Purchase, Chapter, Widget, Channel, Section, Video, TivioSources, User, Monetization, VodTivioSourcePojo, ChannelSourcePojo, };
174
- export { LangCode };