@hubspot/video-player-core 0.1.28 → 0.1.29

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.
Files changed (37) hide show
  1. package/dist/index.d.ts +264 -16
  2. package/package.json +1 -1
  3. package/dist/api/utils.d.ts +0 -3
  4. package/dist/api/utils.d.ts.map +0 -1
  5. package/dist/api/video.d.ts +0 -9
  6. package/dist/api/video.d.ts.map +0 -1
  7. package/dist/components/CaptionTracks.d.ts +0 -8
  8. package/dist/components/CaptionTracks.d.ts.map +0 -1
  9. package/dist/components/HSPlayerIcons.d.ts +0 -12
  10. package/dist/components/HSPlayerIcons.d.ts.map +0 -1
  11. package/dist/components/HSThemeTemplate.d.ts +0 -25
  12. package/dist/components/HSThemeTemplate.d.ts.map +0 -1
  13. package/dist/components/TranslationsProvider.d.ts +0 -13
  14. package/dist/components/TranslationsProvider.d.ts.map +0 -1
  15. package/dist/components/VideoFetchProvider.d.ts +0 -22
  16. package/dist/components/VideoFetchProvider.d.ts.map +0 -1
  17. package/dist/components/VideoPlayer.d.ts +0 -12
  18. package/dist/components/VideoPlayer.d.ts.map +0 -1
  19. package/dist/components/VideoPlayerProvider.d.ts +0 -46
  20. package/dist/components/VideoPlayerProvider.d.ts.map +0 -1
  21. package/dist/constants.d.ts +0 -8
  22. package/dist/constants.d.ts.map +0 -1
  23. package/dist/hooks/useAsyncEffect.d.ts +0 -9
  24. package/dist/hooks/useAsyncEffect.d.ts.map +0 -1
  25. package/dist/hooks/useSubtitles.d.ts +0 -6
  26. package/dist/hooks/useSubtitles.d.ts.map +0 -1
  27. package/dist/hooks/useVideo.d.ts +0 -8
  28. package/dist/hooks/useVideo.d.ts.map +0 -1
  29. package/dist/index.d.ts.map +0 -1
  30. package/dist/styles/player-theme-styles.d.ts +0 -3
  31. package/dist/styles/player-theme-styles.d.ts.map +0 -1
  32. package/dist/types.d.ts +0 -60
  33. package/dist/types.d.ts.map +0 -1
  34. package/dist/utils/i18n.d.ts +0 -47
  35. package/dist/utils/i18n.d.ts.map +0 -1
  36. package/dist/utils/playerContainer.d.ts +0 -4
  37. package/dist/utils/playerContainer.d.ts.map +0 -1
package/dist/index.d.ts CHANGED
@@ -1,16 +1,264 @@
1
- export { VideoPlayer } from './components/VideoPlayer.js';
2
- export type * from './components/VideoPlayer.js';
3
- export { VideoFetchProvider, VideoFetchContext, } from './components/VideoFetchProvider.js';
4
- export type * from './components/VideoFetchProvider.js';
5
- export * from './components/VideoPlayerProvider.js';
6
- export type * from './components/VideoPlayerProvider.js';
7
- export * from './components/TranslationsProvider.js';
8
- export type * from './components/TranslationsProvider.js';
9
- export * from './components/HSPlayerIcons.js';
10
- export { HSPlayerThemes } from './components/HSThemeTemplate.js';
11
- export { useVideo } from './hooks/useVideo.js';
12
- export * from './api/video.js';
13
- export type * from './api/video.js';
14
- export type * from './types.js';
15
- export * from './constants.js';
16
- //# sourceMappingURL=index.d.ts.map
1
+ import { Context } from 'react';
2
+ import { default as default_2 } from '@mux/mux-video';
3
+ import { JSX as JSX_2 } from 'react/jsx-runtime';
4
+ import { MediaError as MediaError_2 } from '@mux/mux-video';
5
+ import { PropsWithChildren } from 'react';
6
+
7
+ export declare const BigPlayIcon: () => JSX_2.Element;
8
+
9
+ export declare const CaptionsMenuIcon: () => JSX_2.Element;
10
+
11
+ export declare type Chapter = {
12
+ title: string;
13
+ startTime: number;
14
+ };
15
+
16
+ export declare const CloseIcon: () => JSX_2.Element;
17
+
18
+ export declare type ConversionAsset = {
19
+ type: 'CTA' | 'FORM';
20
+ id: string;
21
+ position: 'PRE' | 'POST' | 'CUSTOM';
22
+ overlay_delay_seconds?: number;
23
+ prevent_skip?: boolean;
24
+ };
25
+
26
+ export declare const DEFAULT_ASPECT_RATIO: number;
27
+
28
+ export declare const DEFAULT_HLS_OPTIONS: {
29
+ debug: boolean;
30
+ maxBufferSize: number;
31
+ maxBufferLength: number;
32
+ };
33
+
34
+ export declare const DEFAULT_PLAY_BUTTON_COLOR = "#F7761F";
35
+
36
+ declare const DEFAULT_TRANSLATIONS: {
37
+ readonly play: "Play";
38
+ readonly pause: "Pause";
39
+ readonly mute: "Mute";
40
+ readonly unmute: "Unmute";
41
+ readonly captions: "Captions";
42
+ readonly settings: "Settings";
43
+ readonly playbackSpeed: "Playback speed";
44
+ readonly quality: "Quality";
45
+ readonly auto: "Auto";
46
+ readonly off: "Off";
47
+ readonly enterFullscreen: "Enter fullscreen mode";
48
+ readonly exitFullscreen: "Exit fullscreen mode";
49
+ readonly enterPipMode: "Enter picture-in-picture mode";
50
+ readonly exitPipMode: "Exit picture-in-picture mode";
51
+ readonly seek: "Seek";
52
+ readonly playbackTime: "playback time";
53
+ readonly videoPlayer: "video player";
54
+ readonly audioPlayer: "audio player";
55
+ readonly loading: "media loading";
56
+ readonly closedCaptions: "closed captions";
57
+ readonly networkError: "Network Error";
58
+ readonly decodeError: "Decode Error";
59
+ readonly sourceNotSupported: "Source Not Supported";
60
+ readonly encryptionError: "Encryption Error";
61
+ readonly networkErrorMessage: "A network error caused the media download to fail.";
62
+ readonly decodeErrorMessage: "A media error caused playback to be aborted. The media could be corrupt or your browser does not support this format.";
63
+ readonly unsupportedErrorMessage: "An unsupported error occurred. The server or network failed, or your browser does not support this format.";
64
+ readonly encryptionErrorMessage: "The media is encrypted and there are no keys to decrypt it.";
65
+ readonly watchVideo: "Watch video";
66
+ readonly defaultInlineMessage: "Thanks for your response!";
67
+ readonly notFoundVideoFetchError: "Video not found";
68
+ readonly notAuthorizedVideoFetchError: "Video not enabled";
69
+ readonly genericVideoFetchError: "Could not load video";
70
+ readonly retry: "Try again";
71
+ };
72
+
73
+ export declare const EnterFullscreenIcon: () => JSX_2.Element;
74
+
75
+ export declare const ExitFullscreenIcon: () => JSX_2.Element;
76
+
77
+ export declare type FetchError = Error & {
78
+ status: number;
79
+ };
80
+
81
+ export declare function fetchSubtitles(videoId: number, portalId: number, env?: HsEnvironment, hublet?: string): Promise<SubtitlesByLanguage>;
82
+
83
+ export declare function fetchVideo(videoId: number, portalId: number, env?: HsEnvironment, hublet?: string, skip?: boolean): Promise<VideoResponse | {
84
+ video: undefined;
85
+ }>;
86
+
87
+ export declare type HsEnvironment = 'qa' | 'prod';
88
+
89
+ declare type HSPlayerTheme = {
90
+ themeName: string;
91
+ primaryColor: string;
92
+ secondaryColor: string;
93
+ accentColor: string;
94
+ };
95
+
96
+ export declare const HSPlayerThemes: Record<string, HSPlayerTheme>;
97
+
98
+ export declare type HubSpotVideoParams = {
99
+ player_id: number;
100
+ width: number;
101
+ height: number;
102
+ max_width?: number;
103
+ max_height?: number;
104
+ size_type?: 'auto_full_width' | 'auto_custom_max' | 'exact';
105
+ autoplay?: boolean;
106
+ hide_controls?: boolean;
107
+ loop_video?: boolean;
108
+ mute_by_default?: boolean;
109
+ conversion_asset?: ConversionAsset;
110
+ };
111
+
112
+ export declare type MenuType = 'captions' | 'settings';
113
+
114
+ export declare const PipIcon: () => JSX_2.Element;
115
+
116
+ export declare type PlayerActions = {
117
+ play: () => void;
118
+ pause: (reason?: string) => void;
119
+ exitFullscreen: () => void;
120
+ changeVolume: (volume: number) => void;
121
+ setElement: (el: default_2 | null) => void;
122
+ toggleMenu: (menuType: MenuType, isOpen: boolean) => void;
123
+ };
124
+
125
+ export declare type PlayerCallbacks = Pick<React.VideoHTMLAttributes<default_2>, 'onPlay' | 'onPlaying' | 'onSeeked' | 'onTimeUpdate' | 'onEnded'> & {
126
+ onPause?: (event: React.SyntheticEvent<default_2>, reason?: string) => void;
127
+ onError?: (error: MediaError_2) => void;
128
+ onCaptionChange?: (lang: string) => void;
129
+ onToggleMenu?: (menuType: MenuType, isOpen: boolean) => void;
130
+ onPlaybackRateChange?: (playbackRate: number) => void;
131
+ onQualityChange?: (renditionId: string) => void;
132
+ };
133
+
134
+ export declare type PlayerState = {
135
+ hasStarted: boolean;
136
+ isPaused: boolean;
137
+ currentTime: number;
138
+ hasEnded: boolean;
139
+ playbackStartedAt?: number;
140
+ element: default_2 | null;
141
+ loadedDuration: number;
142
+ selectedCaptionTrack: string | null;
143
+ playbackRate: number;
144
+ isPipMode: boolean;
145
+ selectedRendition?: string;
146
+ isFullscreen: boolean;
147
+ isPipAvailable: boolean;
148
+ volume: number;
149
+ };
150
+
151
+ export declare const PlayPauseIcon: () => JSX_2.Element;
152
+
153
+ export declare const SettingsMenuIcon: () => JSX_2.Element;
154
+
155
+ export declare type SubtitlesByLanguage = Record<string, string>;
156
+
157
+ declare type TranslationKeys = keyof typeof DEFAULT_TRANSLATIONS;
158
+
159
+ declare type Translations = Record<TranslationKeys, string>;
160
+
161
+ export declare const TranslationsContext: Context< {
162
+ translations: Translations;
163
+ language: string;
164
+ }>;
165
+
166
+ export declare const TranslationsProvider: ({ children, translations, language, }: PropsWithChildren<{
167
+ translations: Partial<Translations>;
168
+ language?: string;
169
+ }>) => JSX_2.Element;
170
+
171
+ export declare const useLanguage: () => string;
172
+
173
+ export declare const useTranslations: () => Translations;
174
+
175
+ export declare const useVideo: (videoId: number, portalId: number, env?: HsEnvironment, hublet?: string, skip?: boolean) => {
176
+ video: VideoCrmObject | undefined;
177
+ fetchError: FetchError | undefined;
178
+ refetch: () => void;
179
+ };
180
+
181
+ export declare const useVideoPlayer: () => {
182
+ state: PlayerState;
183
+ actions: PlayerActions;
184
+ eventCallbacks: Record<string, React.ReactEventHandler<default_2>>;
185
+ };
186
+
187
+ export declare type VideoCrmObject = {
188
+ portalId: number;
189
+ videoId: number;
190
+ crmObjectId: number;
191
+ sourceFileId: number;
192
+ fileUrl: string;
193
+ mp4FileUrl: string | null;
194
+ primaryPlaybackId: string | null;
195
+ transcodingState: string;
196
+ title: string;
197
+ createdAt: string;
198
+ updatedAt: string | null;
199
+ deletedAt: string | null;
200
+ thumbnailUrl: string;
201
+ thumbnailSourceFileId: number | null;
202
+ thumbnailSourceFileUrl: number | null;
203
+ posterUrl: string;
204
+ width: number;
205
+ height: number;
206
+ duration: number;
207
+ isEmbeddable: boolean;
208
+ folderId: number | null;
209
+ folderPath: string | null;
210
+ altText: string | null;
211
+ subtitleLanguageCodes: string[];
212
+ seoDescription?: string;
213
+ chapters?: {
214
+ items: Chapter[];
215
+ };
216
+ };
217
+
218
+ export declare const VideoFetchContext: Context< {
219
+ video?: VideoCrmObject;
220
+ videoFetchError?: FetchError;
221
+ hubspotVideoParams?: HubSpotVideoParams;
222
+ hublet: string;
223
+ env: HsEnvironment;
224
+ }>;
225
+
226
+ export declare const VideoFetchProvider: ({ children, video, videoFetchError, hubspotVideoParams, onRefetch, ...props }: VideoFetchProviderProps) => JSX_2.Element;
227
+
228
+ declare type VideoFetchProviderProps = PropsWithChildren<{
229
+ env: HsEnvironment;
230
+ hublet: string;
231
+ videoId: number;
232
+ video?: VideoCrmObject;
233
+ videoFetchError?: FetchError;
234
+ hubspotVideoParams: HubSpotVideoParams;
235
+ onRefetch?: () => void;
236
+ }>;
237
+
238
+ export declare const VideoPlayer: ({ portalId, playButtonColor, theme, overlay, }: VideoPlayerProps) => JSX_2.Element | null;
239
+
240
+ declare type VideoPlayerProps = {
241
+ portalId: number;
242
+ playButtonColor?: {
243
+ color: string;
244
+ };
245
+ theme?: keyof typeof HSPlayerThemes;
246
+ overlay?: React.ReactNode;
247
+ };
248
+
249
+ export declare const VideoPlayerProvider: ({ video, children, playerCallbacks, }: PropsWithChildren<{
250
+ video?: VideoCrmObject;
251
+ playerCallbacks?: PlayerCallbacks;
252
+ }>) => JSX_2.Element;
253
+
254
+ export declare type VideoResponse = {
255
+ video: VideoCrmObject;
256
+ };
257
+
258
+ export declare const VolumeHighIcon: () => JSX_2.Element;
259
+
260
+ export declare const VolumeLowIcon: () => JSX_2.Element;
261
+
262
+ export declare const VolumeMuteIcon: () => JSX_2.Element;
263
+
264
+ export { }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hubspot/video-player-core",
3
- "version": "0.1.28",
3
+ "version": "0.1.29",
4
4
  "description": "Core video player components",
5
5
  "main": "dist/index.cjs",
6
6
  "module": "dist/index.js",
@@ -1,3 +0,0 @@
1
- import { HsEnvironment } from '../types';
2
- export declare function getApiOrigin(env?: HsEnvironment, hublet?: string): string;
3
- //# sourceMappingURL=utils.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../src/api/utils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAOzC,wBAAgB,YAAY,CAAC,GAAG,CAAC,EAAE,aAAa,EAAE,MAAM,SAAQ,UAG/D"}
@@ -1,9 +0,0 @@
1
- import { HsEnvironment, SubtitlesByLanguage, VideoResponse } from '../types';
2
- export type FetchError = Error & {
3
- status: number;
4
- };
5
- export declare function fetchVideo(videoId: number, portalId: number, env?: HsEnvironment, hublet?: string, skip?: boolean): Promise<VideoResponse | {
6
- video: undefined;
7
- }>;
8
- export declare function fetchSubtitles(videoId: number, portalId: number, env?: HsEnvironment, hublet?: string): Promise<SubtitlesByLanguage>;
9
- //# sourceMappingURL=video.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"video.d.ts","sourceRoot":"","sources":["../../src/api/video.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,mBAAmB,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAG7E,MAAM,MAAM,UAAU,GAAG,KAAK,GAAG;IAAE,MAAM,EAAE,MAAM,CAAA;CAAE,CAAC;AAEpD,wBAAsB,UAAU,CAC9B,OAAO,EAAE,MAAM,EACf,QAAQ,EAAE,MAAM,EAChB,GAAG,CAAC,EAAE,aAAa,EACnB,MAAM,CAAC,EAAE,MAAM,EACf,IAAI,CAAC,EAAE,OAAO;;GAkBf;AAED,wBAAsB,cAAc,CAClC,OAAO,EAAE,MAAM,EACf,QAAQ,EAAE,MAAM,EAChB,GAAG,CAAC,EAAE,aAAa,EACnB,MAAM,CAAC,EAAE,MAAM,gCAahB"}
@@ -1,8 +0,0 @@
1
- import { HsEnvironment } from '../types';
2
- export declare const CaptionTracks: ({ videoId, portalId, hsEnv, displayLang, }: {
3
- videoId: number;
4
- portalId: number;
5
- hsEnv: HsEnvironment;
6
- displayLang: string;
7
- }) => import("react/jsx-runtime").JSX.Element[] | null;
8
- //# sourceMappingURL=CaptionTracks.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"CaptionTracks.d.ts","sourceRoot":"","sources":["../../src/components/CaptionTracks.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAKzC,eAAO,MAAM,aAAa,+CAKvB;IACD,OAAO,EAAE,MAAM,CAAC;IAChB,QAAQ,EAAE,MAAM,CAAC;IACjB,KAAK,EAAE,aAAa,CAAC;IACrB,WAAW,EAAE,MAAM,CAAC;CACrB,qDAyBA,CAAC"}
@@ -1,12 +0,0 @@
1
- export declare const BigPlayIcon: () => import("react/jsx-runtime").JSX.Element;
2
- export declare const PlayPauseIcon: () => import("react/jsx-runtime").JSX.Element;
3
- export declare const VolumeHighIcon: () => import("react/jsx-runtime").JSX.Element;
4
- export declare const VolumeLowIcon: () => import("react/jsx-runtime").JSX.Element;
5
- export declare const VolumeMuteIcon: () => import("react/jsx-runtime").JSX.Element;
6
- export declare const CaptionsMenuIcon: () => import("react/jsx-runtime").JSX.Element;
7
- export declare const SettingsMenuIcon: () => import("react/jsx-runtime").JSX.Element;
8
- export declare const PipIcon: () => import("react/jsx-runtime").JSX.Element;
9
- export declare const EnterFullscreenIcon: () => import("react/jsx-runtime").JSX.Element;
10
- export declare const ExitFullscreenIcon: () => import("react/jsx-runtime").JSX.Element;
11
- export declare const CloseIcon: () => import("react/jsx-runtime").JSX.Element;
12
- //# sourceMappingURL=HSPlayerIcons.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"HSPlayerIcons.d.ts","sourceRoot":"","sources":["../../src/components/HSPlayerIcons.tsx"],"names":[],"mappings":"AAAA,eAAO,MAAM,WAAW,+CASvB,CAAC;AAEF,eAAO,MAAM,aAAa,+CAazB,CAAC;AAEF,eAAO,MAAM,cAAc,+CAa1B,CAAC;AAEF,eAAO,MAAM,aAAa,+CAYzB,CAAC;AAEF,eAAO,MAAM,cAAc,+CAW1B,CAAC;AAEF,eAAO,MAAM,gBAAgB,+CAY5B,CAAC;AAEF,eAAO,MAAM,gBAAgB,+CAY5B,CAAC;AAEF,eAAO,MAAM,OAAO,+CASnB,CAAC;AAEF,eAAO,MAAM,mBAAmB,+CAa/B,CAAC;AAEF,eAAO,MAAM,kBAAkB,+CAc9B,CAAC;AAEF,eAAO,MAAM,SAAS,+CAarB,CAAC"}
@@ -1,25 +0,0 @@
1
- import { HubSpotVideoParams } from '../types';
2
- import { Translations } from '../utils/i18n';
3
- import { PlayerActions } from './VideoPlayerProvider';
4
- type HSPlayerTheme = {
5
- themeName: string;
6
- primaryColor: string;
7
- secondaryColor: string;
8
- accentColor: string;
9
- };
10
- export declare const HSPlayerThemes: Record<string, HSPlayerTheme>;
11
- type HubspotPlayerProps = {
12
- videoPlayer: React.ReactNode;
13
- themeProps: HSPlayerTheme;
14
- translations: Translations;
15
- hubspotVideoParams: HubSpotVideoParams;
16
- fullscreenElement?: HTMLElement;
17
- actions: PlayerActions;
18
- language: string;
19
- isPipMode: boolean;
20
- isPipAvailable: boolean;
21
- volume: number;
22
- };
23
- export declare const HSThemeWrapper: ({ videoPlayer, themeProps, hubspotVideoParams, }: Pick<HubspotPlayerProps, "videoPlayer" | "themeProps" | "hubspotVideoParams">) => import("react/jsx-runtime").JSX.Element;
24
- export {};
25
- //# sourceMappingURL=HSThemeTemplate.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"HSThemeTemplate.d.ts","sourceRoot":"","sources":["../../src/components/HSThemeTemplate.tsx"],"names":[],"mappings":"AAiCA,OAAO,EAAE,kBAAkB,EAAE,MAAM,UAAU,CAAC;AAC9C,OAAO,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAc7C,OAAO,EAAE,aAAa,EAAkB,MAAM,uBAAuB,CAAC;AAEtE,KAAK,aAAa,GAAG;IACnB,SAAS,EAAE,MAAM,CAAC;IAClB,YAAY,EAAE,MAAM,CAAC;IACrB,cAAc,EAAE,MAAM,CAAC;IACvB,WAAW,EAAE,MAAM,CAAC;CACrB,CAAC;AAEF,eAAO,MAAM,cAAc,EAAE,MAAM,CAAC,MAAM,EAAE,aAAa,CAaxD,CAAC;AAEF,KAAK,kBAAkB,GAAG;IACxB,WAAW,EAAE,KAAK,CAAC,SAAS,CAAC;IAC7B,UAAU,EAAE,aAAa,CAAC;IAC1B,YAAY,EAAE,YAAY,CAAC;IAC3B,kBAAkB,EAAE,kBAAkB,CAAC;IACvC,iBAAiB,CAAC,EAAE,WAAW,CAAC;IAChC,OAAO,EAAE,aAAa,CAAC;IACvB,QAAQ,EAAE,MAAM,CAAC;IACjB,SAAS,EAAE,OAAO,CAAC;IACnB,cAAc,EAAE,OAAO,CAAC;IACxB,MAAM,EAAE,MAAM,CAAC;CAChB,CAAC;AAEF,eAAO,MAAM,cAAc,qDAIxB,IAAI,CACL,kBAAkB,EAClB,aAAa,GAAG,YAAY,GAAG,oBAAoB,CACpD,4CAsEA,CAAC"}
@@ -1,13 +0,0 @@
1
- import { PropsWithChildren } from 'react';
2
- import { Translations } from '../utils/i18n';
3
- export declare const TranslationsContext: import('react').Context<{
4
- translations: Translations;
5
- language: string;
6
- }>;
7
- export declare const TranslationsProvider: ({ children, translations, language, }: PropsWithChildren<{
8
- translations: Partial<Translations>;
9
- language?: string;
10
- }>) => import("react/jsx-runtime").JSX.Element;
11
- export declare const useTranslations: () => Translations;
12
- export declare const useLanguage: () => string;
13
- //# sourceMappingURL=TranslationsProvider.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"TranslationsProvider.d.ts","sourceRoot":"","sources":["../../src/components/TranslationsProvider.tsx"],"names":[],"mappings":"AAAA,OAAO,EAEL,iBAAiB,EAIlB,MAAM,OAAO,CAAC;AAIf,OAAO,EAIL,YAAY,EACb,MAAM,eAAe,CAAC;AAEvB,eAAO,MAAM,mBAAmB;kBAChB,YAAY;cAChB,MAAM;EACoD,CAAC;AAEvE,eAAO,MAAM,oBAAoB,0CAI9B,iBAAiB,CAAC;IACnB,YAAY,EAAE,OAAO,CAAC,YAAY,CAAC,CAAC;IACpC,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB,CAAC,4CAsBD,CAAC;AAEF,eAAO,MAAM,eAAe,oBAG3B,CAAC;AAEF,eAAO,MAAM,WAAW,cAGvB,CAAC"}
@@ -1,22 +0,0 @@
1
- import { PropsWithChildren } from 'react';
2
- import { FetchError } from '../api/video';
3
- import { HsEnvironment, HubSpotVideoParams, VideoCrmObject } from '../types';
4
- type VideoFetchProviderProps = PropsWithChildren<{
5
- env: HsEnvironment;
6
- hublet: string;
7
- videoId: number;
8
- video?: VideoCrmObject;
9
- videoFetchError?: FetchError;
10
- hubspotVideoParams: HubSpotVideoParams;
11
- onRefetch?: () => void;
12
- }>;
13
- export declare const VideoFetchContext: import('react').Context<{
14
- video?: VideoCrmObject;
15
- videoFetchError?: FetchError;
16
- hubspotVideoParams?: HubSpotVideoParams;
17
- hublet: string;
18
- env: HsEnvironment;
19
- }>;
20
- export declare const VideoFetchProvider: ({ children, video, videoFetchError, hubspotVideoParams, onRefetch, ...props }: VideoFetchProviderProps) => import("react/jsx-runtime").JSX.Element;
21
- export {};
22
- //# sourceMappingURL=VideoFetchProvider.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"VideoFetchProvider.d.ts","sourceRoot":"","sources":["../../src/components/VideoFetchProvider.tsx"],"names":[],"mappings":"AACA,OAAO,EAAiB,iBAAiB,EAAE,MAAM,OAAO,CAAC;AAEzD,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,EAAE,aAAa,EAAE,kBAAkB,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AAI7E,KAAK,uBAAuB,GAAG,iBAAiB,CAAC;IAC/C,GAAG,EAAE,aAAa,CAAC;IACnB,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,MAAM,CAAC;IAChB,KAAK,CAAC,EAAE,cAAc,CAAC;IACvB,eAAe,CAAC,EAAE,UAAU,CAAC;IAC7B,kBAAkB,EAAE,kBAAkB,CAAC;IACvC,SAAS,CAAC,EAAE,MAAM,IAAI,CAAC;CACxB,CAAC,CAAC;AAEH,eAAO,MAAM,iBAAiB;YACpB,cAAc;sBACJ,UAAU;yBACP,kBAAkB;YAC/B,MAAM;SACT,aAAa;EAOlB,CAAC;AA2EH,eAAO,MAAM,kBAAkB,kFAO5B,uBAAuB,4CA8BzB,CAAC"}
@@ -1,12 +0,0 @@
1
- import { HSPlayerThemes } from './HSThemeTemplate';
2
- type VideoPlayerProps = {
3
- portalId: number;
4
- playButtonColor?: {
5
- color: string;
6
- };
7
- theme?: keyof typeof HSPlayerThemes;
8
- overlay?: React.ReactNode;
9
- };
10
- export declare const VideoPlayer: ({ portalId, playButtonColor, theme, overlay, }: VideoPlayerProps) => import("react/jsx-runtime").JSX.Element | null;
11
- export {};
12
- //# sourceMappingURL=VideoPlayer.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"VideoPlayer.d.ts","sourceRoot":"","sources":["../../src/components/VideoPlayer.tsx"],"names":[],"mappings":"AAYA,OAAO,0BAA0B,CAAC;AAKlC,OAAO,EAAE,cAAc,EAAkB,MAAM,mBAAmB,CAAC;AAInE,KAAK,gBAAgB,GAAG;IACtB,QAAQ,EAAE,MAAM,CAAC;IACjB,eAAe,CAAC,EAAE;QAChB,KAAK,EAAE,MAAM,CAAC;KACf,CAAC;IACF,KAAK,CAAC,EAAE,MAAM,OAAO,cAAc,CAAC;IACpC,OAAO,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;CAC3B,CAAC;AAEF,eAAO,MAAM,WAAW,mDAKrB,gBAAgB,mDAgGlB,CAAC"}
@@ -1,46 +0,0 @@
1
- import { default as MuxVideoElement, MediaError } from '@mux/mux-video';
2
- import { PropsWithChildren } from 'react';
3
- import { VideoCrmObject } from '../types';
4
- export type PlayerState = {
5
- hasStarted: boolean;
6
- isPaused: boolean;
7
- currentTime: number;
8
- hasEnded: boolean;
9
- playbackStartedAt?: number;
10
- element: MuxVideoElement | null;
11
- loadedDuration: number;
12
- selectedCaptionTrack: string | null;
13
- playbackRate: number;
14
- isPipMode: boolean;
15
- selectedRendition?: string;
16
- isFullscreen: boolean;
17
- isPipAvailable: boolean;
18
- volume: number;
19
- };
20
- export type MenuType = 'captions' | 'settings';
21
- export type PlayerActions = {
22
- play: () => void;
23
- pause: (reason?: string) => void;
24
- exitFullscreen: () => void;
25
- changeVolume: (volume: number) => void;
26
- setElement: (el: MuxVideoElement | null) => void;
27
- toggleMenu: (menuType: MenuType, isOpen: boolean) => void;
28
- };
29
- export type PlayerCallbacks = Pick<React.VideoHTMLAttributes<MuxVideoElement>, 'onPlay' | 'onPlaying' | 'onSeeked' | 'onTimeUpdate' | 'onEnded'> & {
30
- onPause?: (event: React.SyntheticEvent<MuxVideoElement>, reason?: string) => void;
31
- onError?: (error: MediaError) => void;
32
- onCaptionChange?: (lang: string) => void;
33
- onToggleMenu?: (menuType: MenuType, isOpen: boolean) => void;
34
- onPlaybackRateChange?: (playbackRate: number) => void;
35
- onQualityChange?: (renditionId: string) => void;
36
- };
37
- export declare const VideoPlayerProvider: ({ video, children, playerCallbacks, }: PropsWithChildren<{
38
- video?: VideoCrmObject;
39
- playerCallbacks?: PlayerCallbacks;
40
- }>) => import("react/jsx-runtime").JSX.Element;
41
- export declare const useVideoPlayer: () => {
42
- state: PlayerState;
43
- actions: PlayerActions;
44
- eventCallbacks: Record<string, React.ReactEventHandler<MuxVideoElement>>;
45
- };
46
- //# sourceMappingURL=VideoPlayerProvider.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"VideoPlayerProvider.d.ts","sourceRoot":"","sources":["../../src/components/VideoPlayerProvider.tsx"],"names":[],"mappings":"AAAA,OAAO,eAAe,EAAE,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAS7D,OAAO,EAEL,iBAAiB,EAMlB,MAAM,OAAO,CAAC;AAEf,OAAO,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AA4C1C,MAAM,MAAM,WAAW,GAAG;IACxB,UAAU,EAAE,OAAO,CAAC;IACpB,QAAQ,EAAE,OAAO,CAAC;IAClB,WAAW,EAAE,MAAM,CAAC;IACpB,QAAQ,EAAE,OAAO,CAAC;IAClB,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,OAAO,EAAE,eAAe,GAAG,IAAI,CAAC;IAChC,cAAc,EAAE,MAAM,CAAC;IACvB,oBAAoB,EAAE,MAAM,GAAG,IAAI,CAAC;IACpC,YAAY,EAAE,MAAM,CAAC;IACrB,SAAS,EAAE,OAAO,CAAC;IAEnB,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,YAAY,EAAE,OAAO,CAAC;IACtB,cAAc,EAAE,OAAO,CAAC;IACxB,MAAM,EAAE,MAAM,CAAC;CAChB,CAAC;AAEF,MAAM,MAAM,QAAQ,GAAG,UAAU,GAAG,UAAU,CAAC;AAE/C,MAAM,MAAM,aAAa,GAAG;IAC1B,IAAI,EAAE,MAAM,IAAI,CAAC;IACjB,KAAK,EAAE,CAAC,MAAM,CAAC,EAAE,MAAM,KAAK,IAAI,CAAC;IACjC,cAAc,EAAE,MAAM,IAAI,CAAC;IAC3B,YAAY,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,IAAI,CAAC;IACvC,UAAU,EAAE,CAAC,EAAE,EAAE,eAAe,GAAG,IAAI,KAAK,IAAI,CAAC;IACjD,UAAU,EAAE,CAAC,QAAQ,EAAE,QAAQ,EAAE,MAAM,EAAE,OAAO,KAAK,IAAI,CAAC;CAC3D,CAAC;AAQF,MAAM,MAAM,eAAe,GAAG,IAAI,CAChC,KAAK,CAAC,mBAAmB,CAAC,eAAe,CAAC,EAC1C,QAAQ,GAAG,WAAW,GAAG,UAAU,GAAG,cAAc,GAAG,SAAS,CACjE,GAAG;IACF,OAAO,CAAC,EAAE,CACR,KAAK,EAAE,KAAK,CAAC,cAAc,CAAC,eAAe,CAAC,EAC5C,MAAM,CAAC,EAAE,MAAM,KACZ,IAAI,CAAC;IACV,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,UAAU,KAAK,IAAI,CAAC;IACtC,eAAe,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;IACzC,YAAY,CAAC,EAAE,CAAC,QAAQ,EAAE,QAAQ,EAAE,MAAM,EAAE,OAAO,KAAK,IAAI,CAAC;IAC7D,oBAAoB,CAAC,EAAE,CAAC,YAAY,EAAE,MAAM,KAAK,IAAI,CAAC;IACtD,eAAe,CAAC,EAAE,CAAC,WAAW,EAAE,MAAM,KAAK,IAAI,CAAC;CACjD,CAAC;AA8MF,eAAO,MAAM,mBAAmB,0CAI7B,iBAAiB,CAAC;IACnB,KAAK,CAAC,EAAE,cAAc,CAAC;IACvB,eAAe,CAAC,EAAE,eAAe,CAAC;CACnC,CAAC,4CAQD,CAAC;AAEF,eAAO,MAAM,cAAc;WAjPlB,WAAW;aACT,aAAa;oBACN,MAAM,CAAC,MAAM,EAAE,KAAK,CAAC,iBAAiB,CAAC,eAAe,CAAC,CAAC;CAqPzE,CAAC"}
@@ -1,8 +0,0 @@
1
- export declare const DEFAULT_ASPECT_RATIO: number;
2
- export declare const DEFAULT_PLAY_BUTTON_COLOR = "#F7761F";
3
- export declare const DEFAULT_HLS_OPTIONS: {
4
- debug: boolean;
5
- maxBufferSize: number;
6
- maxBufferLength: number;
7
- };
8
- //# sourceMappingURL=constants.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../src/constants.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,oBAAoB,QAAS,CAAC;AAE3C,eAAO,MAAM,yBAAyB,YAAY,CAAC;AAGnD,eAAO,MAAM,mBAAmB;;;;CAI/B,CAAC"}
@@ -1,9 +0,0 @@
1
- type EffectResult = void | undefined | (() => EffectResult) | Promise<void | undefined | (() => EffectResult)>;
2
- /**
3
- * In some cases it may be necessary to mock dismissErrorWithoutHandling
4
- * in tests.
5
- */
6
- export declare function dismissErrorWithoutHandling(error: Error): void;
7
- export declare function useAsyncEffect(effect: () => EffectResult, deps: unknown[]): void;
8
- export {};
9
- //# sourceMappingURL=useAsyncEffect.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"useAsyncEffect.d.ts","sourceRoot":"","sources":["../../src/hooks/useAsyncEffect.ts"],"names":[],"mappings":"AAKA,KAAK,YAAY,GACb,IAAI,GACJ,SAAS,GACT,CAAC,MAAM,YAAY,CAAC,GACpB,OAAO,CAAC,IAAI,GAAG,SAAS,GAAG,CAAC,MAAM,YAAY,CAAC,CAAC,CAAC;AAErD;;;GAGG;AACH,wBAAgB,2BAA2B,CAAC,KAAK,EAAE,KAAK,QAIvD;AAsBD,wBAAgB,cAAc,CAAC,MAAM,EAAE,MAAM,YAAY,EAAE,IAAI,EAAE,OAAO,EAAE,QAgCzE"}
@@ -1,6 +0,0 @@
1
- import { HsEnvironment, SubtitlesByLanguage } from '../types';
2
- export declare const useSubtitles: (videoId: number, portalId: number, env?: HsEnvironment, hublet?: string) => {
3
- subtitles: SubtitlesByLanguage | undefined;
4
- fetchError: Error | undefined;
5
- };
6
- //# sourceMappingURL=useSubtitles.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"useSubtitles.d.ts","sourceRoot":"","sources":["../../src/hooks/useSubtitles.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,aAAa,EAAE,mBAAmB,EAAE,MAAM,UAAU,CAAC;AAE9D,eAAO,MAAM,YAAY,YACd,MAAM,YACL,MAAM,QACV,aAAa,WACV,MAAM;;;CAiBhB,CAAC"}
@@ -1,8 +0,0 @@
1
- import { FetchError } from '../api/video';
2
- import { HsEnvironment, VideoCrmObject } from '../types';
3
- export declare const useVideo: (videoId: number, portalId: number, env?: HsEnvironment, hublet?: string, skip?: boolean) => {
4
- video: VideoCrmObject | undefined;
5
- fetchError: FetchError | undefined;
6
- refetch: () => void;
7
- };
8
- //# sourceMappingURL=useVideo.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"useVideo.d.ts","sourceRoot":"","sources":["../../src/hooks/useVideo.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAc,MAAM,cAAc,CAAC;AACtD,OAAO,EAAE,aAAa,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AAEzD,eAAO,MAAM,QAAQ,YACV,MAAM,YACL,MAAM,QACV,aAAa,WACV,MAAM,SACR,OAAO;;;;CAkCf,CAAC"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,6BAA6B,CAAC;AAC1D,mBAAmB,6BAA6B,CAAC;AAEjD,OAAO,EACL,kBAAkB,EAClB,iBAAiB,GAClB,MAAM,oCAAoC,CAAC;AAC5C,mBAAmB,oCAAoC,CAAC;AAExD,cAAc,qCAAqC,CAAC;AACpD,mBAAmB,qCAAqC,CAAC;AAEzD,cAAc,sCAAsC,CAAC;AACrD,mBAAmB,sCAAsC,CAAC;AAE1D,cAAc,+BAA+B,CAAC;AAC9C,OAAO,EAAE,cAAc,EAAE,MAAM,iCAAiC,CAAC;AACjE,OAAO,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AAE/C,cAAc,gBAAgB,CAAC;AAC/B,mBAAmB,gBAAgB,CAAC;AAEpC,mBAAmB,YAAY,CAAC;AAChC,cAAc,gBAAgB,CAAC"}
@@ -1,3 +0,0 @@
1
- declare const _default: ":host {\n direction: ltr;\n}\n\nmedia-controller {\n --media-font-family: 'Lexend Deca', Helvetica, Arial, sans-serif;\n --media-font-weight: 500;\n --media-font-size: 12px;\n --hs-fullscreen-font-size: 17px;\n --hs-tooltip-font-size: 12px;\n font-family: var(--media-font-family);\n font-weight: var(--media-font-weight);\n font-size: var(--media-font-size);\n -webkit-font-smoothing: antialiased;\n\n /* vars configured through theme props - matches DARK theme defaults.\n accent color is driven by play button color field */\n --media-primary-color: #ffffff;\n --media-text-color: #ffffff;\n --hs-secondary-color: #141414;\n --hs-secondary-color-translucent: #141414cc;\n --media-accent-color: #f7761f;\n /* end configurable vars */\n\n --media-secondary-color: transparent;\n --hs-menu-border-color: #666666;\n --hs-menu-bottom-offset: 40px;\n --media-menu-border-radius: 8px;\n --media-menu-background: color-mix(\n in srgb,\n var(--hs-secondary-color) 75%,\n transparent\n );\n --media-control-hover-background: transparent;\n --media-range-track-height: 3px;\n --media-range-thumb-height: 13px;\n --media-range-thumb-width: 13px;\n --media-range-thumb-border-radius: 13px;\n --media-tooltip-background-color: var(\n --hs-secondary-color,\n rgba(20, 20, 30, 0.7)\n );\n --media-object-fit: cover; /* avoids 1px black bars that tend to occur in safari, depending on exact window & video size */\n position: absolute;\n height: 100%;\n width: 100%;\n}\n\nmedia-controller[breakpointmd] {\n --media-font-size: 14px;\n --hs-menu-bottom-offset: 45px;\n}\n\n/* The biggest size controller is tied to going fullscreen instead of a player width */\nmedia-controller[mediaisfullscreen] {\n font-size: var(--hs-fullscreen-font-size);\n --media-object-fit: contain;\n --hs-menu-bottom-offset: 60px;\n --media-range-thumb-height: 20px;\n --media-range-thumb-width: 20px;\n --media-range-thumb-border-radius: 10px;\n --media-range-track-height: 4px;\n}\n/* attempt to move captions above the control bar, not working except for Chrome, see https://www.mux.com/blog/if-you-can-read-this-your-browser-captions-are-broken */\nvideo::-webkit-media-text-track-display {\n transform: translateY(-3em);\n}\n\n.hs-button {\n position: relative;\n padding: 0 8px;\n height: 100%;\n opacity: 0.9;\n transition: opacity 0.1s cubic-bezier(0.4, 0, 1, 1);\n --media-font-size: var(--hs-tooltip-font-size);\n --media-button-icon-width: 16px;\n --media-button-icon-height: 16px;\n}\n\n.hs-button:hover {\n opacity: 1;\n}\n\n.hs-button[disabled],\n.hs-button[disabled]:hover {\n --media-tooltip-display: none;\n opacity: 0.5;\n}\n\n[mediaisfullscreen] .hs-button {\n padding: 0 12px;\n --media-button-icon-width: 24px;\n --media-button-icon-height: 24px;\n --hs-tooltip-font-size: 14px;\n}\n\n.hs-button svg {\n width: var(--media-button-icon-width);\n height: var(--media-button-icon-height);\n fill: var(--media-primary-color);\n fill-rule: evenodd;\n}\n\n.svg-shadow {\n stroke: #000;\n stroke-opacity: 0.15;\n stroke-width: 2px;\n fill: none;\n}\n\n/* Big centered Play/Pause */\nmedia-play-button.centered-play-button,\nmedia-pause-button.centered-play-button {\n --hs-big-play-button-height: 4rem;\n position: absolute;\n display: flex;\n justify-content: center;\n align-items: center;\n aspect-ratio: 1;\n padding: 0;\n z-index: 1;\n border-radius: 50%;\n opacity: 0;\n transition: opacity 0.7s ease-in;\n height: var(--hs-big-play-button-height);\n\n --media-control-background: color-mix(\n in srgb,\n var(--media-accent-color) 70%,\n transparent\n );\n --media-control-hover-background: color-mix(\n in srgb,\n var(--media-accent-color) 85%,\n transparent\n );\n --media-tooltip-display: none;\n --media-button-icon-width: 28px;\n --media-button-icon-height: 28px;\n --media-icon-color: var(--hs-secondary-color);\n}\n[mediapaused] media-play-button.centered-play-button {\n opacity: 1;\n transition: opacity 0.3s ease-in;\n}\n\n[breakpointsm] media-play-button.centered-play-button {\n --hs-big-play-button-height: 5rem;\n --media-button-icon-height: 32px;\n}\n\n[breakpointlg] media-play-button.centered-play-button,\n[mediaisfullscreen] media-play-button.centered-play-button {\n --hs-big-play-button-height: 7rem;\n --media-button-icon-height: 50px;\n}\n\n/* Error Dialog */\nmedia-error-dialog {\n --media-control-background: rgba(255, 255, 255, 0.7);\n z-index: 2;\n}\n\n/* Gradient */\n.hs-control-bar-background {\n position: absolute;\n display: flex;\n flex-direction: column;\n left: 0;\n right: 0;\n bottom: 0;\n padding: 0;\n background: linear-gradient(\n transparent,\n rgba(0, 0, 0, 0.6) 60%,\n rgba(0, 0, 0, 0.8)\n );\n}\n\n[breakpointmd] .hs-control-bar-background {\n padding: 6px 12px;\n}\n\n[data-theme-variant='light'].hs-control-bar-background {\n background: none;\n background-color: var(--hs-secondary-color-translucent);\n}\n\n.hs-bottom-gradient {\n position: absolute;\n width: 100%;\n height: 100%;\n left: 0;\n bottom: 0;\n pointer-events: none;\n box-shadow: inset 0 -24px 8px -8px rgba(30, 30, 30, 0.3),\n inset 0 -48px 16px -16px rgba(60, 60, 60, 0.25);\n border-radius: 5px;\n}\n[data-theme-variant='light'].hs-bottom-gradient {\n box-shadow: inset 0 -24px 8px -8px rgba(210, 210, 210, 0.3),\n inset 0 -48px 16px -16px rgba(250, 250, 250, 0.25);\n}\n\n/* Settings Menu - media-settings-menu and media-captions menu are at bottom, or else they cannot be clicked and the player toggles play/pause instead */\nmedia-settings-menu {\n position: absolute;\n background-color: var(--media-menu-background);\n border: 1px solid var(--hs-menu-border-color);\n border-radius: var(--media-menu-border-radius);\n right: 2px;\n bottom: var(--hs-menu-bottom-offset);\n z-index: 10;\n will-change: width, height;\n transition: opacity 0.1s cubic-bezier(0, 0, 0.2, 1);\n user-select: none;\n backdrop-filter: blur(5px);\n -webkit-backdrop-filter: blur(5px);\n --media-settings-menu-min-width: 220px;\n}\n[mediaisfullscreen] media-settings-menu {\n --media-settings-menu-min-width: 320px;\n right: 24px;\n}\n\nmedia-settings-menu [slot='title'] {\n padding: 4px 0;\n}\n\nmedia-settings-menu-item {\n height: 40px;\n font-weight: var(--media-font-weight);\n padding-top: 0;\n padding-bottom: 0;\n}\n\n[mediaisfullscreen] media-settings-menu-item {\n font-size: var(--hs-fullscreen-font-size);\n height: 50px;\n}\n\nmedia-settings-menu-item[submenusize='0'] {\n display: none;\n}\n\n/* Also hide if only 'Auto' is added. */\n.quality-settings[submenusize='1'] {\n display: none;\n}\n\nmedia-captions-menu {\n position: absolute;\n background-color: var(--media-menu-background);\n border: 1px solid var(--hs-menu-border-color);\n border-radius: var(--media-menu-border-radius);\n bottom: var(--hs-menu-bottom-offset);\n right: 50px;\n z-index: 10;\n will-change: width, height;\n transition: opacity 0.1s cubic-bezier(0, 0, 0.2, 1);\n user-select: none;\n backdrop-filter: blur(5px);\n -webkit-backdrop-filter: blur(5px);\n}\n[mediaisfullscreen] media-captions-menu {\n bottom: var(--hs-menu-bottom-offset);\n font-size: var(--hs-fullscreen-font-size);\n}\n\n/* Time Range / Progress Bar */\nmedia-time-range {\n width: 100%;\n height: 8px;\n bottom: 6px;\n z-index: 2;\n --media-range-track-background: rgba(155, 155, 155, 0.5);\n --media-range-track-pointer-background: rgba(155, 155, 155, 0.5);\n --media-range-track-height: 6px;\n --media-range-track-border-radius: 10px;\n --media-box-border-radius: 4px;\n --media-time-range-buffered-color: rgba(255, 255, 255, 0.4);\n --media-range-bar-color: var(--media-accent-color);\n\n --media-range-thumb-border-radius: 13px;\n --media-range-thumb-background: var(--media-accent-color);\n --media-range-thumb-transition: transform 0.1s linear;\n --media-range-thumb-transform: scale(0) translate(0%, 0%);\n\n --media-preview-thumbnail-border: 2px solid transparent;\n --media-preview-thumbnail-border-radius: 4px;\n --media-preview-chapter-text-shadow: none;\n --media-preview-time-text-shadow: none;\n --media-preview-thumbnail-background: var(--hs-secondary-color);\n --media-preview-chapter-background: var(--hs-secondary-color);\n --media-preview-time-background: var(--hs-secondary-color);\n}\nmedia-time-range:hover {\n --media-range-thumb-transform: scale(1) translate(0%, 0%);\n}\n[mediaisfullscreen] media-time-range:hover {\n --media-range-track-height: 8px;\n}\n\nmedia-preview-thumbnail {\n background-color: var(--hs-secondary-color);\n}\n\n/* Control Bar */\nmedia-control-bar {\n position: relative;\n height: 35px;\n line-height: 35px;\n padding-right: 5px;\n}\n[breakpointmd] media-control-bar {\n height: 45px;\n line-height: 45px;\n}\n[mediaisfullscreen] media-control-bar {\n height: 54px;\n line-height: 54px;\n}\n\n/* Play/Pause */\n/* Slow down the play icon part hiding slightly to achieve the morphing look a little better */\nmedia-play-button:not([mediapaused]) #play-p2,\nmedia-play-button:not([mediapaused]) #play-p2 {\n transition: clip-path 0.35s ease-in;\n}\n\n/* Show icon */\nmedia-play-button :is(#pause-p1, #pause-p2),\nmedia-play-button[mediapaused] :is(#play-p1, #play-p2) {\n clip-path: inset(0);\n}\n\n/* Hide icon wth clip path mask */\nmedia-play-button #play-p1 {\n clip-path: inset(0 100% 0 0);\n}\nmedia-play-button #play-p2 {\n clip-path: inset(0 20% 0 100%);\n}\nmedia-play-button[mediapaused] #pause-p1 {\n clip-path: inset(50% 0 50% 0);\n}\nmedia-play-button[mediapaused] #pause-p2 {\n clip-path: inset(50% 0 50% 0);\n}\n\n/* Volume/Mute */\nmedia-mute-button.hs-button {\n padding-bottom: 1px;\n}\n\nmedia-mute-button svg {\n stroke: var(--media-primary-color);\n stroke-width: 0.75px;\n}\n\nmedia-mute-button :is(#icon-muted, #icon-volume) {\n transition: clip-path 0.3s ease-out;\n}\nmedia-mute-button #icon-muted {\n clip-path: inset(0 0 100% 0);\n}\nmedia-mute-button[mediavolumelevel='off'] #icon-muted {\n clip-path: inset(0);\n}\nmedia-mute-button #icon-volume {\n clip-path: inset(0);\n}\nmedia-mute-button[mediavolumelevel='off'] #icon-volume {\n clip-path: inset(100% 0 0 0);\n}\n\nmedia-mute-button #volume-high,\nmedia-mute-button[mediavolumelevel='off'] #volume-high {\n opacity: 1;\n transition: opacity 0.3s;\n}\nmedia-mute-button[mediavolumelevel='low'] #volume-high,\nmedia-mute-button[mediavolumelevel='medium'] #volume-high {\n opacity: 0.2;\n}\n\nmedia-controller .media-volume-wrapper {\n position: relative;\n}\n\n.media-volume-range-wrapper {\n position: absolute;\n top: -3.75rem;\n left: -2.5rem;\n height: 40px;\n width: 100px;\n opacity: 0;\n transform: rotate(-90deg);\n z-index: 5;\n}\n\n[mediaisfullscreen] .media-volume-range-wrapper {\n top: -4.75rem;\n left: -3rem;\n width: 8rem;\n}\n\n.media-volume-range-inner {\n position: relative;\n top: 0;\n bottom: 0;\n right: 0;\n left: 12px; /* achieves proper vertical alignment of other popup menus, while ensuring you can move cursor up after hovering on mute button without dismissing */\n background-color: var(--hs-secondary-color-translucent);\n border: 1px solid var(--hs-menu-border-color);\n border-radius: 5px;\n}\n\nmedia-mute-button:hover + .media-volume-range-wrapper,\nmedia-mute-button:focus + .media-volume-range-wrapper,\nmedia-mute-button:focus-within + .media-volume-range-wrapper,\n.media-volume-range-wrapper:hover,\n.media-volume-range-wrapper:focus,\n.media-volume-range-wrapper:focus-within {\n opacity: 1;\n}\n\nmedia-volume-range {\n height: 100%;\n width: 100%;\n vertical-align: middle;\n --media-range-track-background: var(--media-primary-color);\n}\n\n/* Time Display */\nmedia-time-display {\n padding-top: 0;\n padding-bottom: 8px;\n padding-left: 6px;\n}\n[mediaisfullscreen] media-time-display {\n font-size: var(--hs-fullscreen-font-size);\n}\n\n/* Control spacer */\n.control-spacer {\n flex-grow: 1;\n}\n\n/* Subtitles/CC Button */\nmedia-captions-button {\n position: relative;\n}\n\nmedia-captions-menu-button svg {\n stroke: var(--media-primary-color);\n stroke-width: 0.5px;\n}\n\n/* Hide the captions menu button when no subtitles are available */\nmedia-captions-menu-button:not([mediasubtitleslist]) {\n display: none;\n}\n\n/* Disble the captions button when no subtitles are available */\nmedia-captions-button:not([mediasubtitleslist]) svg {\n opacity: 0.3;\n}\n\nmedia-captions-button[mediasubtitleslist]:after {\n content: '';\n display: block;\n position: absolute;\n width: 0;\n height: 3px;\n border-radius: 3px;\n background-color: var(--media-accent-color);\n bottom: 19%;\n left: 50%;\n transition: all 0.1s cubic-bezier(0, 0, 0.2, 1),\n width 0.1s cubic-bezier(0, 0, 0.2, 1);\n}\n\nmedia-captions-button[mediasubtitleslist][aria-checked='true']:after {\n left: 25%;\n width: 50%;\n transition: left 0.25s cubic-bezier(0, 0, 0.2, 1),\n width 0.25s cubic-bezier(0, 0, 0.2, 1);\n}\n\nmedia-captions-button[mediasubtitleslist][aria-checked='true']:after {\n left: 25%;\n width: 50%;\n\n transition: left 0.25s cubic-bezier(0, 0, 0.2, 1),\n width 0.25s cubic-bezier(0, 0, 0.2, 1);\n}\n\n/* Settings Menu Button */\nmedia-settings-menu-button svg {\n stroke: var(--media-primary-color);\n stroke-width: 1px;\n transition: transform 0.1s cubic-bezier(0.4, 0, 1, 1);\n transform: rotateZ(0deg);\n}\nmedia-settings-menu-button[aria-expanded='true'] svg {\n stroke: var(--media-primary-color);\n stroke-width: 0.5px;\n transform: rotateZ(30deg);\n}\n";
2
- export default _default;
3
- //# sourceMappingURL=player-theme-styles.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"player-theme-styles.d.ts","sourceRoot":"","sources":["../../src/styles/player-theme-styles.ts"],"names":[],"mappings":"wBAAe,gyaAAgya;AAA/ya,wBAAgza"}
package/dist/types.d.ts DELETED
@@ -1,60 +0,0 @@
1
- export type HsEnvironment = 'qa' | 'prod';
2
- export type ConversionAsset = {
3
- type: 'CTA' | 'FORM';
4
- id: string;
5
- position: 'PRE' | 'POST' | 'CUSTOM';
6
- overlay_delay_seconds?: number;
7
- prevent_skip?: boolean;
8
- };
9
- export type HubSpotVideoParams = {
10
- player_id: number;
11
- width: number;
12
- height: number;
13
- max_width?: number;
14
- max_height?: number;
15
- size_type?: 'auto_full_width' | 'auto_custom_max' | 'exact';
16
- autoplay?: boolean;
17
- hide_controls?: boolean;
18
- loop_video?: boolean;
19
- mute_by_default?: boolean;
20
- conversion_asset?: ConversionAsset;
21
- };
22
- export type Chapter = {
23
- title: string;
24
- startTime: number;
25
- };
26
- export type VideoCrmObject = {
27
- portalId: number;
28
- videoId: number;
29
- crmObjectId: number;
30
- sourceFileId: number;
31
- fileUrl: string;
32
- mp4FileUrl: string | null;
33
- primaryPlaybackId: string | null;
34
- transcodingState: string;
35
- title: string;
36
- createdAt: string;
37
- updatedAt: string | null;
38
- deletedAt: string | null;
39
- thumbnailUrl: string;
40
- thumbnailSourceFileId: number | null;
41
- thumbnailSourceFileUrl: number | null;
42
- posterUrl: string;
43
- width: number;
44
- height: number;
45
- duration: number;
46
- isEmbeddable: boolean;
47
- folderId: number | null;
48
- folderPath: string | null;
49
- altText: string | null;
50
- subtitleLanguageCodes: string[];
51
- seoDescription?: string;
52
- chapters?: {
53
- items: Chapter[];
54
- };
55
- };
56
- export type VideoResponse = {
57
- video: VideoCrmObject;
58
- };
59
- export type SubtitlesByLanguage = Record<string, string>;
60
- //# sourceMappingURL=types.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,aAAa,GAAG,IAAI,GAAG,MAAM,CAAC;AAE1C,MAAM,MAAM,eAAe,GAAG;IAC5B,IAAI,EAAE,KAAK,GAAG,MAAM,CAAC;IACrB,EAAE,EAAE,MAAM,CAAC;IACX,QAAQ,EAAE,KAAK,GAAG,MAAM,GAAG,QAAQ,CAAC;IACpC,qBAAqB,CAAC,EAAE,MAAM,CAAC;IAC/B,YAAY,CAAC,EAAE,OAAO,CAAC;CACxB,CAAC;AAEF,MAAM,MAAM,kBAAkB,GAAG;IAC/B,SAAS,EAAE,MAAM,CAAC;IAClB,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;IACf,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,SAAS,CAAC,EAAE,iBAAiB,GAAG,iBAAiB,GAAG,OAAO,CAAC;IAC5D,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,gBAAgB,CAAC,EAAE,eAAe,CAAC;CACpC,CAAC;AAEF,MAAM,MAAM,OAAO,GAAG;IACpB,KAAK,EAAE,MAAM,CAAC;IACd,SAAS,EAAE,MAAM,CAAC;CACnB,CAAC;AAEF,MAAM,MAAM,cAAc,GAAG;IAC3B,QAAQ,EAAE,MAAM,CAAC;IACjB,OAAO,EAAE,MAAM,CAAC;IAChB,WAAW,EAAE,MAAM,CAAC;IACpB,YAAY,EAAE,MAAM,CAAC;IACrB,OAAO,EAAE,MAAM,CAAC;IAChB,UAAU,EAAE,MAAM,GAAG,IAAI,CAAC;IAC1B,iBAAiB,EAAE,MAAM,GAAG,IAAI,CAAC;IACjC,gBAAgB,EAAE,MAAM,CAAC;IACzB,KAAK,EAAE,MAAM,CAAC;IACd,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;IACzB,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;IACzB,YAAY,EAAE,MAAM,CAAC;IACrB,qBAAqB,EAAE,MAAM,GAAG,IAAI,CAAC;IACrC,sBAAsB,EAAE,MAAM,GAAG,IAAI,CAAC;IACtC,SAAS,EAAE,MAAM,CAAC;IAClB,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,MAAM,CAAC;IACjB,YAAY,EAAE,OAAO,CAAC;IACtB,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;IACxB,UAAU,EAAE,MAAM,GAAG,IAAI,CAAC;IAC1B,OAAO,EAAE,MAAM,GAAG,IAAI,CAAC;IACvB,qBAAqB,EAAE,MAAM,EAAE,CAAC;IAChC,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,EAAE;QACT,KAAK,EAAE,OAAO,EAAE,CAAC;KAClB,CAAC;CACH,CAAC;AAEF,MAAM,MAAM,aAAa,GAAG;IAC1B,KAAK,EAAE,cAAc,CAAC;CACvB,CAAC;AAEF,MAAM,MAAM,mBAAmB,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC"}
@@ -1,47 +0,0 @@
1
- import { TranslateDictionary } from 'media-chrome/lang/en';
2
- export declare const DEFAULT_LANGUAGE = "en";
3
- export declare const DEFAULT_TRANSLATIONS: {
4
- readonly play: "Play";
5
- readonly pause: "Pause";
6
- readonly mute: "Mute";
7
- readonly unmute: "Unmute";
8
- readonly captions: "Captions";
9
- readonly settings: "Settings";
10
- readonly playbackSpeed: "Playback speed";
11
- readonly quality: "Quality";
12
- readonly auto: "Auto";
13
- readonly off: "Off";
14
- readonly enterFullscreen: "Enter fullscreen mode";
15
- readonly exitFullscreen: "Exit fullscreen mode";
16
- readonly enterPipMode: "Enter picture-in-picture mode";
17
- readonly exitPipMode: "Exit picture-in-picture mode";
18
- readonly seek: "Seek";
19
- readonly playbackTime: "playback time";
20
- readonly videoPlayer: "video player";
21
- readonly audioPlayer: "audio player";
22
- readonly loading: "media loading";
23
- readonly closedCaptions: "closed captions";
24
- readonly networkError: "Network Error";
25
- readonly decodeError: "Decode Error";
26
- readonly sourceNotSupported: "Source Not Supported";
27
- readonly encryptionError: "Encryption Error";
28
- readonly networkErrorMessage: "A network error caused the media download to fail.";
29
- readonly decodeErrorMessage: "A media error caused playback to be aborted. The media could be corrupt or your browser does not support this format.";
30
- readonly unsupportedErrorMessage: "An unsupported error occurred. The server or network failed, or your browser does not support this format.";
31
- readonly encryptionErrorMessage: "The media is encrypted and there are no keys to decrypt it.";
32
- readonly watchVideo: "Watch video";
33
- readonly defaultInlineMessage: "Thanks for your response!";
34
- readonly notFoundVideoFetchError: "Video not found";
35
- readonly notAuthorizedVideoFetchError: "Video not enabled";
36
- readonly genericVideoFetchError: "Could not load video";
37
- readonly retry: "Try again";
38
- };
39
- type TranslationKeys = keyof typeof DEFAULT_TRANSLATIONS;
40
- export type Translations = Record<TranslationKeys, string>;
41
- /**
42
- * Create map of media-chrome's i18n keys to string values of the provided translations object
43
- * https://www.media-chrome.org/docs/en/internationalization/adding-language-support
44
- */
45
- export declare const createTranslationsMap: (translations: Partial<Translations>) => Partial<TranslateDictionary>;
46
- export {};
47
- //# sourceMappingURL=i18n.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"i18n.d.ts","sourceRoot":"","sources":["../../src/utils/i18n.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,mBAAmB,EAAE,MAAM,sBAAsB,CAAC;AAE3D,eAAO,MAAM,gBAAgB,OAAO,CAAC;AAErC,eAAO,MAAM,oBAAoB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAwCvB,CAAC;AAEX,KAAK,eAAe,GAAG,MAAM,OAAO,oBAAoB,CAAC;AAEzD,MAAM,MAAM,YAAY,GAAG,MAAM,CAAC,eAAe,EAAE,MAAM,CAAC,CAAC;AAE3D;;;GAGG;AACH,eAAO,MAAM,qBAAqB,iBAClB,OAAO,CAAC,YAAY,CAAC,KAClC,OAAO,CAAC,mBAAmB,CA4C7B,CAAC"}
@@ -1,4 +0,0 @@
1
- import { CSSProperties } from 'react';
2
- import { HubSpotVideoParams } from '../types';
3
- export declare const getContainerStyles: (hubspotVideoParams: HubSpotVideoParams) => CSSProperties;
4
- //# sourceMappingURL=playerContainer.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"playerContainer.d.ts","sourceRoot":"","sources":["../../src/utils/playerContainer.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AACtC,OAAO,EAAE,kBAAkB,EAAE,MAAM,UAAU,CAAC;AAqB9C,eAAO,MAAM,kBAAkB,uBACT,kBAAkB,KACrC,aASD,CAAC"}