@mottosports/motto-video-player 1.0.1-rc.6 → 1.0.1-rc.60
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 +167 -159
- package/dist/index.d.mts +169 -100
- package/dist/index.d.ts +169 -100
- package/dist/index.js +3989 -1324
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +3959 -1290
- package/dist/index.mjs.map +1 -1
- package/package.json +2 -2
package/dist/index.d.mts
CHANGED
|
@@ -1,5 +1,73 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
1
|
+
import React, { HTMLAttributes } from 'react';
|
|
2
|
+
import { QueryClient } from '@tanstack/react-query';
|
|
3
|
+
|
|
4
|
+
interface VideoData {
|
|
5
|
+
id: string;
|
|
6
|
+
name?: string;
|
|
7
|
+
description?: string;
|
|
8
|
+
playlists?: Playlist[];
|
|
9
|
+
error?: string;
|
|
10
|
+
}
|
|
11
|
+
interface DVRSettings {
|
|
12
|
+
window_size_seconds: number;
|
|
13
|
+
}
|
|
14
|
+
interface Widevine {
|
|
15
|
+
playlistUrl: string;
|
|
16
|
+
licenseUrl: string;
|
|
17
|
+
}
|
|
18
|
+
interface Fairplay {
|
|
19
|
+
certificateUrl: string;
|
|
20
|
+
licenseUrl: string;
|
|
21
|
+
playlistUrl: string;
|
|
22
|
+
}
|
|
23
|
+
interface Playready {
|
|
24
|
+
playlistUrl: string;
|
|
25
|
+
licenseUrl: string;
|
|
26
|
+
}
|
|
27
|
+
interface DRM {
|
|
28
|
+
token?: string;
|
|
29
|
+
licenseCacheKey?: string;
|
|
30
|
+
widevine?: Widevine;
|
|
31
|
+
fairplay?: Fairplay;
|
|
32
|
+
playready?: Playready;
|
|
33
|
+
}
|
|
34
|
+
interface Playlist {
|
|
35
|
+
id: string;
|
|
36
|
+
url: string;
|
|
37
|
+
format: string;
|
|
38
|
+
dvr_settings?: DVRSettings;
|
|
39
|
+
drm: DRM;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
interface EventData {
|
|
43
|
+
id: string;
|
|
44
|
+
title: string;
|
|
45
|
+
description?: string;
|
|
46
|
+
startTime: string;
|
|
47
|
+
endTime?: string;
|
|
48
|
+
posterUrl?: string;
|
|
49
|
+
videoIds?: string[];
|
|
50
|
+
error?: string;
|
|
51
|
+
}
|
|
52
|
+
declare enum EventsSortDirection {
|
|
53
|
+
ASC = "asc",
|
|
54
|
+
DESC = "desc"
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
interface CreativeWorkData {
|
|
58
|
+
id: string;
|
|
59
|
+
title: string;
|
|
60
|
+
description?: string;
|
|
61
|
+
releaseTime: string;
|
|
62
|
+
endTime?: string;
|
|
63
|
+
posterUrl?: string;
|
|
64
|
+
videoIds?: string[];
|
|
65
|
+
error?: string;
|
|
66
|
+
}
|
|
67
|
+
declare enum CreativeWorksSortDirection {
|
|
68
|
+
ASC = "asc",
|
|
69
|
+
DESC = "desc"
|
|
70
|
+
}
|
|
3
71
|
|
|
4
72
|
/**
|
|
5
73
|
* Unified events interface for both Player and Video wrapper
|
|
@@ -94,11 +162,24 @@ interface SeekbarConfig {
|
|
|
94
162
|
*/
|
|
95
163
|
played?: string;
|
|
96
164
|
}
|
|
165
|
+
/**
|
|
166
|
+
* Icon size configuration
|
|
167
|
+
*/
|
|
168
|
+
interface IconSizes {
|
|
169
|
+
/**
|
|
170
|
+
* Size for skip back/forward buttons (in pixels)
|
|
171
|
+
*/
|
|
172
|
+
skipButtons?: number;
|
|
173
|
+
/**
|
|
174
|
+
* Size for the big play button (in pixels)
|
|
175
|
+
*/
|
|
176
|
+
bigPlayButton?: number;
|
|
177
|
+
}
|
|
97
178
|
interface PlayerProps extends Omit<HTMLAttributes<HTMLVideoElement>, 'src' | 'onError'> {
|
|
98
179
|
/**
|
|
99
|
-
* The source URL of the video (DASH, HLS, or regular MP4)
|
|
180
|
+
* The source URL of the video (DASH, HLS, or regular MP4) or playlist object with DRM info
|
|
100
181
|
*/
|
|
101
|
-
src:
|
|
182
|
+
src: Playlist;
|
|
102
183
|
/**
|
|
103
184
|
* Whether the video should autoplay
|
|
104
185
|
*/
|
|
@@ -138,7 +219,7 @@ interface PlayerProps extends Omit<HTMLAttributes<HTMLVideoElement>, 'src' | 'on
|
|
|
138
219
|
*/
|
|
139
220
|
shakaConfig?: any;
|
|
140
221
|
/**
|
|
141
|
-
* DRM configuration for protected content
|
|
222
|
+
* DRM configuration for protected content (deprecated - now derived from src playlist)
|
|
142
223
|
*/
|
|
143
224
|
drmConfig?: {
|
|
144
225
|
clearKeys?: {
|
|
@@ -152,6 +233,10 @@ interface PlayerProps extends Omit<HTMLAttributes<HTMLVideoElement>, 'src' | 'on
|
|
|
152
233
|
* Mux Analytics configuration
|
|
153
234
|
*/
|
|
154
235
|
muxConfig?: MuxAnalyticsConfig;
|
|
236
|
+
/**
|
|
237
|
+
* System73 SDK configuration
|
|
238
|
+
*/
|
|
239
|
+
system73Config?: System73Config;
|
|
155
240
|
/**
|
|
156
241
|
* IMA (Interactive Media Ads) configuration
|
|
157
242
|
*/
|
|
@@ -180,21 +265,15 @@ interface PlayerProps extends Omit<HTMLAttributes<HTMLVideoElement>, 'src' | 'on
|
|
|
180
265
|
nonLinearAdSlotHeight?: number;
|
|
181
266
|
};
|
|
182
267
|
/**
|
|
183
|
-
* Chromecast configuration
|
|
268
|
+
* Chromecast configuration (optional)
|
|
269
|
+
* Chromecast is always enabled by default. This config allows customization.
|
|
184
270
|
*/
|
|
185
271
|
chromecastConfig?: {
|
|
186
|
-
/**
|
|
187
|
-
* Whether to enable Chromecast support
|
|
188
|
-
*/
|
|
189
|
-
enabled?: boolean;
|
|
190
272
|
/**
|
|
191
273
|
* Custom receiver application ID
|
|
274
|
+
* Defaults to 'CC1AD845' (Google's default media receiver)
|
|
192
275
|
*/
|
|
193
276
|
receiverApplicationId?: string;
|
|
194
|
-
/**
|
|
195
|
-
* Whether to auto-join cast sessions
|
|
196
|
-
*/
|
|
197
|
-
autoJoinPolicy?: string;
|
|
198
277
|
};
|
|
199
278
|
/**
|
|
200
279
|
* Quality selection configuration
|
|
@@ -221,21 +300,20 @@ interface PlayerProps extends Omit<HTMLAttributes<HTMLVideoElement>, 'src' | 'on
|
|
|
221
300
|
* Seekbar color configuration
|
|
222
301
|
*/
|
|
223
302
|
seekbarConfig?: SeekbarConfig;
|
|
303
|
+
/**
|
|
304
|
+
* Icon size configuration
|
|
305
|
+
*/
|
|
306
|
+
iconSizes?: IconSizes;
|
|
224
307
|
/**
|
|
225
308
|
* Event callbacks
|
|
226
309
|
*/
|
|
227
310
|
events?: PlayerEvents;
|
|
228
311
|
/**
|
|
229
|
-
*
|
|
312
|
+
* Locale for Shaka Player UI localization (e.g., 'en', 'ar', 'es')
|
|
313
|
+
* Defaults to 'en' if not provided
|
|
230
314
|
*/
|
|
315
|
+
locale?: string;
|
|
231
316
|
containerClassName?: string;
|
|
232
|
-
/**
|
|
233
|
-
* Optional manual override for stream start time
|
|
234
|
-
* If not provided, the player will attempt to auto-detect the stream start time
|
|
235
|
-
* from the manifest for live streams. When provided, shows elapsed time since
|
|
236
|
-
* stream started instead of the current playback position.
|
|
237
|
-
*/
|
|
238
|
-
streamStartDate?: Date;
|
|
239
317
|
}
|
|
240
318
|
/**
|
|
241
319
|
* Mux Analytics type definitions
|
|
@@ -329,82 +407,51 @@ interface MuxAnalyticsConfig {
|
|
|
329
407
|
*/
|
|
330
408
|
metadata?: MuxMetadata;
|
|
331
409
|
}
|
|
332
|
-
|
|
333
|
-
declare const Player: React__default.ForwardRefExoticComponent<PlayerProps & React__default.RefAttributes<HTMLVideoElement>>;
|
|
334
|
-
|
|
335
|
-
interface VideoData {
|
|
336
|
-
id: string;
|
|
337
|
-
name?: string;
|
|
338
|
-
description?: string;
|
|
339
|
-
playlists?: Array<{
|
|
340
|
-
url: string;
|
|
341
|
-
format: string;
|
|
342
|
-
}>;
|
|
343
|
-
error?: string;
|
|
344
|
-
}
|
|
345
|
-
interface VideoListItem {
|
|
346
|
-
id: string;
|
|
347
|
-
name?: string;
|
|
348
|
-
description?: string;
|
|
349
|
-
playlists?: Array<{
|
|
350
|
-
url: string;
|
|
351
|
-
format: string;
|
|
352
|
-
}>;
|
|
353
|
-
error?: string;
|
|
354
|
-
}
|
|
355
410
|
/**
|
|
356
|
-
*
|
|
357
|
-
* @param videoId - The ID of the video to fetch
|
|
358
|
-
* @param publicKey - The public key for authentication
|
|
359
|
-
* @param mottoToken - Optional motto token for authenticated requests
|
|
360
|
-
* @returns Promise<VideoData> - The video data
|
|
411
|
+
* System73 SDK configuration
|
|
361
412
|
*/
|
|
362
|
-
|
|
413
|
+
interface System73Config {
|
|
414
|
+
/**
|
|
415
|
+
* System73 API key (required for authentication)
|
|
416
|
+
*/
|
|
417
|
+
apiKey: string;
|
|
418
|
+
/**
|
|
419
|
+
* Content steering endpoint URI (optional)
|
|
420
|
+
*/
|
|
421
|
+
contentSteeringEndpoint?: string;
|
|
422
|
+
/**
|
|
423
|
+
* Channel identifier (optional)
|
|
424
|
+
*/
|
|
425
|
+
channelId?: string;
|
|
426
|
+
}
|
|
363
427
|
/**
|
|
364
|
-
*
|
|
365
|
-
* @param publicKey - The public key for authentication
|
|
366
|
-
* @param videoIds - Array of video IDs to fetch
|
|
367
|
-
* @param mottoToken - Optional motto token for authenticated requests
|
|
368
|
-
* @returns Promise<VideoListItem[]> - Array of video data
|
|
428
|
+
* System73 SDK wrapper interface
|
|
369
429
|
*/
|
|
370
|
-
declare
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
videoIds?: string[];
|
|
380
|
-
error?: string;
|
|
381
|
-
}
|
|
382
|
-
declare enum EventsSortDirection {
|
|
383
|
-
ASC = "asc",
|
|
384
|
-
DESC = "desc"
|
|
430
|
+
declare global {
|
|
431
|
+
interface Window {
|
|
432
|
+
S73ShakaPlayerWrapper?: (config: System73Config, shakaInstance: {
|
|
433
|
+
shaka: any;
|
|
434
|
+
}) => {
|
|
435
|
+
wrapPlayerConfig: (config: any) => void;
|
|
436
|
+
wrapPlayer: (player: any) => void;
|
|
437
|
+
};
|
|
438
|
+
}
|
|
385
439
|
}
|
|
386
|
-
declare function fetchEventData(publicKey: string, eventId: string, unused?: any, filter?: string, order?: EventsSortDirection, locale?: string): Promise<EventData>;
|
|
387
440
|
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
error?: string;
|
|
397
|
-
}
|
|
398
|
-
declare enum CreativeWorksSortDirection {
|
|
399
|
-
ASC = "asc",
|
|
400
|
-
DESC = "desc"
|
|
441
|
+
declare global {
|
|
442
|
+
namespace google {
|
|
443
|
+
namespace ima {
|
|
444
|
+
class AdsRequest {
|
|
445
|
+
adTagUrl: string;
|
|
446
|
+
}
|
|
447
|
+
}
|
|
448
|
+
}
|
|
401
449
|
}
|
|
402
|
-
declare
|
|
450
|
+
declare const Player: React.ForwardRefExoticComponent<PlayerProps & React.RefAttributes<HTMLVideoElement>>;
|
|
403
451
|
|
|
404
452
|
interface VideoProps extends Omit<PlayerProps, 'src'> {
|
|
405
453
|
videoId?: string;
|
|
406
454
|
publicKey?: string;
|
|
407
|
-
mottoToken?: string;
|
|
408
455
|
videoData?: VideoData;
|
|
409
456
|
refetchInterval?: number;
|
|
410
457
|
playerName?: string;
|
|
@@ -420,8 +467,15 @@ interface VideoProps extends Omit<PlayerProps, 'src'> {
|
|
|
420
467
|
onCanPlay?: () => void;
|
|
421
468
|
onPlayerReady?: () => void;
|
|
422
469
|
};
|
|
423
|
-
children?:
|
|
470
|
+
children?: React.ReactNode;
|
|
424
471
|
className?: string;
|
|
472
|
+
auth?: {
|
|
473
|
+
mottoToken?: string;
|
|
474
|
+
userId?: string;
|
|
475
|
+
};
|
|
476
|
+
settings?: {
|
|
477
|
+
backgroundImageUrl?: string;
|
|
478
|
+
};
|
|
425
479
|
queryOptions?: {
|
|
426
480
|
enabled?: boolean;
|
|
427
481
|
staleTime?: number;
|
|
@@ -430,9 +484,9 @@ interface VideoProps extends Omit<PlayerProps, 'src'> {
|
|
|
430
484
|
retryDelay?: number;
|
|
431
485
|
};
|
|
432
486
|
}
|
|
433
|
-
declare const Video:
|
|
487
|
+
declare const Video: React.FC<VideoProps>;
|
|
434
488
|
|
|
435
|
-
interface EventProps extends Omit<PlayerProps, 'src'> {
|
|
489
|
+
interface EventProps extends Omit<PlayerProps, 'src' | 'drmConfig'> {
|
|
436
490
|
publicKey: string;
|
|
437
491
|
eventId: string;
|
|
438
492
|
hideTitle?: boolean;
|
|
@@ -441,7 +495,7 @@ interface EventProps extends Omit<PlayerProps, 'src'> {
|
|
|
441
495
|
order?: EventsSortDirection;
|
|
442
496
|
events?: {
|
|
443
497
|
onEventData?: (event: EventData) => void;
|
|
444
|
-
onVideoData?: (video:
|
|
498
|
+
onVideoData?: (video: VideoData) => void;
|
|
445
499
|
onEmptyPlaylists?: () => void;
|
|
446
500
|
onError?: (error: Error) => void;
|
|
447
501
|
onPlay?: () => void;
|
|
@@ -468,7 +522,7 @@ interface EventProps extends Omit<PlayerProps, 'src'> {
|
|
|
468
522
|
retryDelay?: number;
|
|
469
523
|
};
|
|
470
524
|
}
|
|
471
|
-
declare const Event:
|
|
525
|
+
declare const Event: React.FC<EventProps>;
|
|
472
526
|
|
|
473
527
|
interface CreativeWorkProps extends Omit<PlayerProps, 'src'> {
|
|
474
528
|
publicKey: string;
|
|
@@ -479,7 +533,7 @@ interface CreativeWorkProps extends Omit<PlayerProps, 'src'> {
|
|
|
479
533
|
order?: CreativeWorksSortDirection;
|
|
480
534
|
events?: {
|
|
481
535
|
onCreativeWorkData?: (creativeWork: CreativeWorkData) => void;
|
|
482
|
-
onVideoData?: (video:
|
|
536
|
+
onVideoData?: (video: VideoData) => void;
|
|
483
537
|
onEmptyPlaylists?: () => void;
|
|
484
538
|
onError?: (error: Error) => void;
|
|
485
539
|
onPlay?: () => void;
|
|
@@ -506,15 +560,30 @@ interface CreativeWorkProps extends Omit<PlayerProps, 'src'> {
|
|
|
506
560
|
retryDelay?: number;
|
|
507
561
|
};
|
|
508
562
|
}
|
|
509
|
-
declare const CreativeWork:
|
|
563
|
+
declare const CreativeWork: React.FC<CreativeWorkProps>;
|
|
510
564
|
|
|
565
|
+
declare const queryClient: QueryClient;
|
|
511
566
|
interface QueryProviderProps {
|
|
512
|
-
children:
|
|
567
|
+
children: React.ReactNode;
|
|
513
568
|
}
|
|
514
|
-
declare const QueryProvider:
|
|
569
|
+
declare const QueryProvider: React.FC<QueryProviderProps>;
|
|
515
570
|
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
571
|
+
interface SkipBackIconProps {
|
|
572
|
+
size?: number;
|
|
573
|
+
className?: string;
|
|
574
|
+
}
|
|
575
|
+
declare const SkipBackIcon: React.FC<SkipBackIconProps>;
|
|
576
|
+
|
|
577
|
+
interface SkipForwardIconProps {
|
|
578
|
+
size?: number;
|
|
579
|
+
className?: string;
|
|
580
|
+
}
|
|
581
|
+
declare const SkipForwardIcon: React.FC<SkipForwardIconProps>;
|
|
582
|
+
|
|
583
|
+
interface BigPlayIconProps {
|
|
584
|
+
size?: number;
|
|
585
|
+
className?: string;
|
|
586
|
+
}
|
|
587
|
+
declare const BigPlayIcon: React.FC<BigPlayIconProps>;
|
|
519
588
|
|
|
520
|
-
export { CreativeWork, type CreativeWorkData, type CreativeWorkProps, CreativeWorksSortDirection, Event, type EventData, type EventProps, EventsSortDirection, type
|
|
589
|
+
export { BigPlayIcon, CreativeWork, type CreativeWorkData, type CreativeWorkProps, CreativeWorksSortDirection, Event, type EventData, type EventProps, EventsSortDirection, type IconSizes, Player, type PlayerEvents, type PlayerProps, QueryProvider, SkipBackIcon, SkipForwardIcon, Video, type VideoData, type VideoProps, queryClient };
|