@mottosports/motto-video-player 1.0.1-rc.5 → 1.0.1-rc.51

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/dist/index.d.mts CHANGED
@@ -1,5 +1,73 @@
1
- import * as React from 'react';
2
- import React__default, { HTMLAttributes } from 'react';
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: string;
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
@@ -222,20 +301,14 @@ interface PlayerProps extends Omit<HTMLAttributes<HTMLVideoElement>, 'src' | 'on
222
301
  */
223
302
  seekbarConfig?: SeekbarConfig;
224
303
  /**
225
- * Event callbacks
304
+ * Icon size configuration
226
305
  */
227
- events?: PlayerEvents;
306
+ iconSizes?: IconSizes;
228
307
  /**
229
- * CSS class name for the container element
308
+ * Event callbacks
230
309
  */
310
+ events?: PlayerEvents;
231
311
  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
312
  }
240
313
  /**
241
314
  * Mux Analytics type definitions
@@ -329,88 +402,51 @@ interface MuxAnalyticsConfig {
329
402
  */
330
403
  metadata?: MuxMetadata;
331
404
  }
332
-
333
- declare const Player: React__default.ForwardRefExoticComponent<PlayerProps & React__default.RefAttributes<HTMLVideoElement>>;
334
-
335
405
  /**
336
- * Client-only wrapper for the Player component to prevent SSR issues.
337
- * This component only renders the Player on the client side after hydration.
406
+ * System73 SDK configuration
338
407
  */
339
- declare const ClientOnlyPlayer: React__default.ForwardRefExoticComponent<PlayerProps & React__default.RefAttributes<HTMLVideoElement>>;
340
-
341
- interface VideoData {
342
- id: string;
343
- name?: string;
344
- description?: string;
345
- playlists?: Array<{
346
- url: string;
347
- format: string;
348
- }>;
349
- error?: string;
350
- }
351
- interface VideoListItem {
352
- id: string;
353
- name?: string;
354
- description?: string;
355
- playlists?: Array<{
356
- url: string;
357
- format: string;
358
- }>;
359
- error?: string;
408
+ interface System73Config {
409
+ /**
410
+ * System73 API key (required for authentication)
411
+ */
412
+ apiKey: string;
413
+ /**
414
+ * Content steering endpoint URI (optional)
415
+ */
416
+ contentSteeringEndpoint?: string;
417
+ /**
418
+ * Channel identifier (optional)
419
+ */
420
+ channelId?: string;
360
421
  }
361
422
  /**
362
- * Fetches video data from the Motto Streaming API
363
- * @param videoId - The ID of the video to fetch
364
- * @param publicKey - The public key for authentication
365
- * @param mottoToken - Optional motto token for authenticated requests
366
- * @returns Promise<VideoData> - The video data
423
+ * System73 SDK wrapper interface
367
424
  */
368
- declare const fetchVideoData: (videoId: string, publicKey: string, mottoToken?: string) => Promise<VideoData>;
369
- /**
370
- * Fetches multiple videos data from the Motto Streaming API
371
- * @param publicKey - The public key for authentication
372
- * @param videoIds - Array of video IDs to fetch
373
- * @param mottoToken - Optional motto token for authenticated requests
374
- * @returns Promise<VideoListItem[]> - Array of video data
375
- */
376
- declare function fetchVideosList(publicKey: string, videoIds: string[], mottoToken?: string, skip?: number, limit?: number): Promise<VideoListItem[]>;
377
-
378
- interface EventData {
379
- id: string;
380
- title: string;
381
- description?: string;
382
- startTime: string;
383
- endTime?: string;
384
- posterUrl?: string;
385
- videoIds?: string[];
386
- error?: string;
387
- }
388
- declare enum EventsSortDirection {
389
- ASC = "asc",
390
- DESC = "desc"
425
+ declare global {
426
+ interface Window {
427
+ S73ShakaPlayerWrapper?: (config: System73Config, shakaInstance: {
428
+ shaka: any;
429
+ }) => {
430
+ wrapPlayerConfig: (config: any) => void;
431
+ wrapPlayer: (player: any) => void;
432
+ };
433
+ }
391
434
  }
392
- declare function fetchEventData(publicKey: string, eventId: string, unused?: any, filter?: string, order?: EventsSortDirection, locale?: string): Promise<EventData>;
393
435
 
394
- interface CreativeWorkData {
395
- id: string;
396
- title: string;
397
- description?: string;
398
- releaseTime: string;
399
- endTime?: string;
400
- posterUrl?: string;
401
- videoIds?: string[];
402
- error?: string;
436
+ declare global {
437
+ namespace google {
438
+ namespace ima {
439
+ class AdsRequest {
440
+ adTagUrl: string;
441
+ }
442
+ }
443
+ }
403
444
  }
404
- declare enum CreativeWorksSortDirection {
405
- ASC = "asc",
406
- DESC = "desc"
407
- }
408
- declare function fetchCreativeWorkData(publicKey: string, creativeWorkId: string, unused?: any, filter?: string, order?: CreativeWorksSortDirection, locale?: string): Promise<CreativeWorkData>;
445
+ declare const Player: React.ForwardRefExoticComponent<PlayerProps & React.RefAttributes<HTMLVideoElement>>;
409
446
 
410
447
  interface VideoProps extends Omit<PlayerProps, 'src'> {
411
448
  videoId?: string;
412
449
  publicKey?: string;
413
- mottoToken?: string;
414
450
  videoData?: VideoData;
415
451
  refetchInterval?: number;
416
452
  playerName?: string;
@@ -426,8 +462,15 @@ interface VideoProps extends Omit<PlayerProps, 'src'> {
426
462
  onCanPlay?: () => void;
427
463
  onPlayerReady?: () => void;
428
464
  };
429
- children?: React__default.ReactNode;
465
+ children?: React.ReactNode;
430
466
  className?: string;
467
+ auth?: {
468
+ mottoToken?: string;
469
+ userId?: string;
470
+ };
471
+ settings?: {
472
+ backgroundImageUrl?: string;
473
+ };
431
474
  queryOptions?: {
432
475
  enabled?: boolean;
433
476
  staleTime?: number;
@@ -436,9 +479,9 @@ interface VideoProps extends Omit<PlayerProps, 'src'> {
436
479
  retryDelay?: number;
437
480
  };
438
481
  }
439
- declare const Video: React__default.FC<VideoProps>;
482
+ declare const Video: React.FC<VideoProps>;
440
483
 
441
- interface EventProps extends Omit<PlayerProps, 'src'> {
484
+ interface EventProps extends Omit<PlayerProps, 'src' | 'drmConfig'> {
442
485
  publicKey: string;
443
486
  eventId: string;
444
487
  hideTitle?: boolean;
@@ -447,7 +490,7 @@ interface EventProps extends Omit<PlayerProps, 'src'> {
447
490
  order?: EventsSortDirection;
448
491
  events?: {
449
492
  onEventData?: (event: EventData) => void;
450
- onVideoData?: (video: VideoListItem) => void;
493
+ onVideoData?: (video: VideoData) => void;
451
494
  onEmptyPlaylists?: () => void;
452
495
  onError?: (error: Error) => void;
453
496
  onPlay?: () => void;
@@ -474,7 +517,7 @@ interface EventProps extends Omit<PlayerProps, 'src'> {
474
517
  retryDelay?: number;
475
518
  };
476
519
  }
477
- declare const Event: React__default.FC<EventProps>;
520
+ declare const Event: React.FC<EventProps>;
478
521
 
479
522
  interface CreativeWorkProps extends Omit<PlayerProps, 'src'> {
480
523
  publicKey: string;
@@ -485,7 +528,7 @@ interface CreativeWorkProps extends Omit<PlayerProps, 'src'> {
485
528
  order?: CreativeWorksSortDirection;
486
529
  events?: {
487
530
  onCreativeWorkData?: (creativeWork: CreativeWorkData) => void;
488
- onVideoData?: (video: VideoListItem) => void;
531
+ onVideoData?: (video: VideoData) => void;
489
532
  onEmptyPlaylists?: () => void;
490
533
  onError?: (error: Error) => void;
491
534
  onPlay?: () => void;
@@ -512,21 +555,30 @@ interface CreativeWorkProps extends Omit<PlayerProps, 'src'> {
512
555
  retryDelay?: number;
513
556
  };
514
557
  }
515
- declare const CreativeWork: React__default.FC<CreativeWorkProps>;
516
-
517
- /**
518
- * Client-side wrapper for the Event component to prevent SSR issues
519
- * This component ensures that Event is only rendered on the client-side
520
- */
521
- declare const ClientSideEvent: React__default.FC<EventProps>;
558
+ declare const CreativeWork: React.FC<CreativeWorkProps>;
522
559
 
560
+ declare const queryClient: QueryClient;
523
561
  interface QueryProviderProps {
524
- children: React__default.ReactNode;
562
+ children: React.ReactNode;
525
563
  }
526
- declare const QueryProvider: React__default.FC<QueryProviderProps>;
564
+ declare const QueryProvider: React.FC<QueryProviderProps>;
527
565
 
528
- declare const _default: {
529
- Player: React.ForwardRefExoticComponent<PlayerProps & React.RefAttributes<HTMLVideoElement>>;
530
- };
566
+ interface SkipBackIconProps {
567
+ size?: number;
568
+ className?: string;
569
+ }
570
+ declare const SkipBackIcon: React.FC<SkipBackIconProps>;
571
+
572
+ interface SkipForwardIconProps {
573
+ size?: number;
574
+ className?: string;
575
+ }
576
+ declare const SkipForwardIcon: React.FC<SkipForwardIconProps>;
577
+
578
+ interface BigPlayIconProps {
579
+ size?: number;
580
+ className?: string;
581
+ }
582
+ declare const BigPlayIcon: React.FC<BigPlayIconProps>;
531
583
 
532
- export { ClientOnlyPlayer, ClientSideEvent, CreativeWork, type CreativeWorkData, type CreativeWorkProps, CreativeWorksSortDirection, Event, type EventData, type EventProps, EventsSortDirection, type MuxAnalyticsConfig, type MuxDataUpdatePayload, type MuxErrorTranslator, type MuxMetadata, Player, type PlayerEvents, type PlayerProps, QueryProvider, type SeekbarConfig, Video, type VideoData, type VideoListItem, type VideoProps, _default as default, fetchCreativeWorkData, fetchEventData, fetchVideoData, fetchVideosList };
584
+ 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 };