@mottosports/motto-video-player 1.0.1-rc.15 → 1.0.1-rc.17

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 CHANGED
@@ -8,6 +8,7 @@ React video player component for the Motto platform, powered by Shaka Player wit
8
8
  - 🔄 **TanStack Query Integration**: Advanced caching, background refetching, and error handling
9
9
  - 📱 **Responsive Design**: Automatic aspect ratio handling and mobile-friendly controls
10
10
  - 🎮 **Skip Controls**: Built-in skip back/forward buttons with customizable durations
11
+ - ⌨️ **Keyboard Controls**: Desktop keyboard shortcuts (arrows for skip, spacebar for play/pause)
11
12
  - 🎯 **Quality Control**: Automatic quality selection and manual quality switching
12
13
  - 📊 **Analytics**: Built-in Mux analytics support
13
14
  - 🖥️ **Chromecast Support**: Cast videos to compatible devices
@@ -126,6 +127,16 @@ function MyPlayer() {
126
127
  />
127
128
  ```
128
129
 
130
+ ### Keyboard Controls
131
+
132
+ Desktop users can control the player using keyboard shortcuts:
133
+
134
+ - **←** Left Arrow: Skip back 15 seconds
135
+ - **→** Right Arrow: Skip forward 15 seconds
136
+ - **Space**: Play/Pause toggle
137
+
138
+ Keyboard controls are automatically enabled on desktop devices (disabled on mobile) and work when the player is focused or when no input fields are active.
139
+
129
140
  ### Responsive Sizing
130
141
 
131
142
  ```jsx
package/dist/index.d.mts CHANGED
@@ -94,6 +94,19 @@ interface SeekbarConfig {
94
94
  */
95
95
  played?: string;
96
96
  }
97
+ /**
98
+ * Icon size configuration
99
+ */
100
+ interface IconSizes {
101
+ /**
102
+ * Size for skip back/forward buttons (in pixels)
103
+ */
104
+ skipButtons?: number;
105
+ /**
106
+ * Size for the big play button (in pixels)
107
+ */
108
+ bigPlayButton?: number;
109
+ }
97
110
  interface PlayerProps extends Omit<HTMLAttributes<HTMLVideoElement>, 'src' | 'onError'> {
98
111
  /**
99
112
  * The source URL of the video (DASH, HLS, or regular MP4)
@@ -221,6 +234,10 @@ interface PlayerProps extends Omit<HTMLAttributes<HTMLVideoElement>, 'src' | 'on
221
234
  * Seekbar color configuration
222
235
  */
223
236
  seekbarConfig?: SeekbarConfig;
237
+ /**
238
+ * Icon size configuration
239
+ */
240
+ iconSizes?: IconSizes;
224
241
  /**
225
242
  * Event callbacks
226
243
  */
@@ -486,4 +503,22 @@ interface QueryProviderProps {
486
503
  }
487
504
  declare const QueryProvider: React.FC<QueryProviderProps>;
488
505
 
489
- export { 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, queryClient };
506
+ interface SkipBackIconProps {
507
+ size?: number;
508
+ className?: string;
509
+ }
510
+ declare const SkipBackIcon: React.FC<SkipBackIconProps>;
511
+
512
+ interface SkipForwardIconProps {
513
+ size?: number;
514
+ className?: string;
515
+ }
516
+ declare const SkipForwardIcon: React.FC<SkipForwardIconProps>;
517
+
518
+ interface BigPlayIconProps {
519
+ size?: number;
520
+ className?: string;
521
+ }
522
+ declare const BigPlayIcon: React.FC<BigPlayIconProps>;
523
+
524
+ 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 VideoListItem, type VideoProps, queryClient };
package/dist/index.d.ts CHANGED
@@ -94,6 +94,19 @@ interface SeekbarConfig {
94
94
  */
95
95
  played?: string;
96
96
  }
97
+ /**
98
+ * Icon size configuration
99
+ */
100
+ interface IconSizes {
101
+ /**
102
+ * Size for skip back/forward buttons (in pixels)
103
+ */
104
+ skipButtons?: number;
105
+ /**
106
+ * Size for the big play button (in pixels)
107
+ */
108
+ bigPlayButton?: number;
109
+ }
97
110
  interface PlayerProps extends Omit<HTMLAttributes<HTMLVideoElement>, 'src' | 'onError'> {
98
111
  /**
99
112
  * The source URL of the video (DASH, HLS, or regular MP4)
@@ -221,6 +234,10 @@ interface PlayerProps extends Omit<HTMLAttributes<HTMLVideoElement>, 'src' | 'on
221
234
  * Seekbar color configuration
222
235
  */
223
236
  seekbarConfig?: SeekbarConfig;
237
+ /**
238
+ * Icon size configuration
239
+ */
240
+ iconSizes?: IconSizes;
224
241
  /**
225
242
  * Event callbacks
226
243
  */
@@ -486,4 +503,22 @@ interface QueryProviderProps {
486
503
  }
487
504
  declare const QueryProvider: React.FC<QueryProviderProps>;
488
505
 
489
- export { 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, queryClient };
506
+ interface SkipBackIconProps {
507
+ size?: number;
508
+ className?: string;
509
+ }
510
+ declare const SkipBackIcon: React.FC<SkipBackIconProps>;
511
+
512
+ interface SkipForwardIconProps {
513
+ size?: number;
514
+ className?: string;
515
+ }
516
+ declare const SkipForwardIcon: React.FC<SkipForwardIconProps>;
517
+
518
+ interface BigPlayIconProps {
519
+ size?: number;
520
+ className?: string;
521
+ }
522
+ declare const BigPlayIcon: React.FC<BigPlayIconProps>;
523
+
524
+ 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 VideoListItem, type VideoProps, queryClient };