@mottosports/motto-video-player 1.0.1-rc.2 → 1.0.1-rc.5
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 +138 -237
- package/dist/index.d.mts +44 -18
- package/dist/index.d.ts +44 -18
- package/dist/index.js +223 -151
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +201 -135
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import
|
|
2
|
-
import {
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import React__default, { HTMLAttributes } from 'react';
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
5
|
* Unified events interface for both Player and Video wrapper
|
|
@@ -330,7 +330,13 @@ interface MuxAnalyticsConfig {
|
|
|
330
330
|
metadata?: MuxMetadata;
|
|
331
331
|
}
|
|
332
332
|
|
|
333
|
-
declare const Player:
|
|
333
|
+
declare const Player: React__default.ForwardRefExoticComponent<PlayerProps & React__default.RefAttributes<HTMLVideoElement>>;
|
|
334
|
+
|
|
335
|
+
/**
|
|
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.
|
|
338
|
+
*/
|
|
339
|
+
declare const ClientOnlyPlayer: React__default.ForwardRefExoticComponent<PlayerProps & React__default.RefAttributes<HTMLVideoElement>>;
|
|
334
340
|
|
|
335
341
|
interface VideoData {
|
|
336
342
|
id: string;
|
|
@@ -352,6 +358,22 @@ interface VideoListItem {
|
|
|
352
358
|
}>;
|
|
353
359
|
error?: string;
|
|
354
360
|
}
|
|
361
|
+
/**
|
|
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
|
|
367
|
+
*/
|
|
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[]>;
|
|
355
377
|
|
|
356
378
|
interface EventData {
|
|
357
379
|
id: string;
|
|
@@ -367,6 +389,7 @@ declare enum EventsSortDirection {
|
|
|
367
389
|
ASC = "asc",
|
|
368
390
|
DESC = "desc"
|
|
369
391
|
}
|
|
392
|
+
declare function fetchEventData(publicKey: string, eventId: string, unused?: any, filter?: string, order?: EventsSortDirection, locale?: string): Promise<EventData>;
|
|
370
393
|
|
|
371
394
|
interface CreativeWorkData {
|
|
372
395
|
id: string;
|
|
@@ -382,6 +405,7 @@ declare enum CreativeWorksSortDirection {
|
|
|
382
405
|
ASC = "asc",
|
|
383
406
|
DESC = "desc"
|
|
384
407
|
}
|
|
408
|
+
declare function fetchCreativeWorkData(publicKey: string, creativeWorkId: string, unused?: any, filter?: string, order?: CreativeWorksSortDirection, locale?: string): Promise<CreativeWorkData>;
|
|
385
409
|
|
|
386
410
|
interface VideoProps extends Omit<PlayerProps, 'src'> {
|
|
387
411
|
videoId?: string;
|
|
@@ -402,7 +426,7 @@ interface VideoProps extends Omit<PlayerProps, 'src'> {
|
|
|
402
426
|
onCanPlay?: () => void;
|
|
403
427
|
onPlayerReady?: () => void;
|
|
404
428
|
};
|
|
405
|
-
children?:
|
|
429
|
+
children?: React__default.ReactNode;
|
|
406
430
|
className?: string;
|
|
407
431
|
queryOptions?: {
|
|
408
432
|
enabled?: boolean;
|
|
@@ -412,7 +436,7 @@ interface VideoProps extends Omit<PlayerProps, 'src'> {
|
|
|
412
436
|
retryDelay?: number;
|
|
413
437
|
};
|
|
414
438
|
}
|
|
415
|
-
declare const Video:
|
|
439
|
+
declare const Video: React__default.FC<VideoProps>;
|
|
416
440
|
|
|
417
441
|
interface EventProps extends Omit<PlayerProps, 'src'> {
|
|
418
442
|
publicKey: string;
|
|
@@ -450,14 +474,7 @@ interface EventProps extends Omit<PlayerProps, 'src'> {
|
|
|
450
474
|
retryDelay?: number;
|
|
451
475
|
};
|
|
452
476
|
}
|
|
453
|
-
declare const Event:
|
|
454
|
-
|
|
455
|
-
/**
|
|
456
|
-
* Client-side wrapper for the Event component that prevents SSR issues.
|
|
457
|
-
* This component only renders the Event component after the client has mounted,
|
|
458
|
-
* preventing any browser API calls during server-side rendering.
|
|
459
|
-
*/
|
|
460
|
-
declare const ClientSideEvent: React.FC<EventProps>;
|
|
477
|
+
declare const Event: React__default.FC<EventProps>;
|
|
461
478
|
|
|
462
479
|
interface CreativeWorkProps extends Omit<PlayerProps, 'src'> {
|
|
463
480
|
publicKey: string;
|
|
@@ -495,12 +512,21 @@ interface CreativeWorkProps extends Omit<PlayerProps, 'src'> {
|
|
|
495
512
|
retryDelay?: number;
|
|
496
513
|
};
|
|
497
514
|
}
|
|
498
|
-
declare const CreativeWork:
|
|
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>;
|
|
499
522
|
|
|
500
|
-
declare const queryClient: QueryClient;
|
|
501
523
|
interface QueryProviderProps {
|
|
502
|
-
children:
|
|
524
|
+
children: React__default.ReactNode;
|
|
503
525
|
}
|
|
504
|
-
declare const QueryProvider:
|
|
526
|
+
declare const QueryProvider: React__default.FC<QueryProviderProps>;
|
|
527
|
+
|
|
528
|
+
declare const _default: {
|
|
529
|
+
Player: React.ForwardRefExoticComponent<PlayerProps & React.RefAttributes<HTMLVideoElement>>;
|
|
530
|
+
};
|
|
505
531
|
|
|
506
|
-
export { ClientSideEvent, CreativeWork, type CreativeWorkData, type CreativeWorkProps, CreativeWorksSortDirection, Event, type EventData, type EventProps, EventsSortDirection, Player, type PlayerEvents, type PlayerProps, QueryProvider, Video, type VideoData, type VideoListItem, type VideoProps,
|
|
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 };
|