@halibegic/react-video-player 0.0.23 → 0.0.25

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 (21) hide show
  1. package/dist/components/live-player/live-player-provider.d.ts +1 -1
  2. package/dist/components/live-player/{live-player-go-live.d.ts → ui/live-player-go-live.d.ts} +1 -1
  3. package/dist/components/player/player-error-check.d.ts +2 -0
  4. package/dist/components/player/ui/player-button.d.ts +3 -3
  5. package/dist/components/player/ui/player-notice.styles.d.ts +13 -0
  6. package/dist/react-video-player.es.js +1082 -1041
  7. package/dist/react-video-player.es.js.map +1 -1
  8. package/dist/react-video-player.umd.js +12 -12
  9. package/dist/react-video-player.umd.js.map +1 -1
  10. package/dist/stores/live-player-store.d.ts +2 -3
  11. package/dist/stores/player-store.d.ts +11 -4
  12. package/dist/types/player.d.ts +6 -1
  13. package/package.json +1 -1
  14. /package/dist/components/live-player/{live-player-playback-indicator.d.ts → ui/live-player-playback-indicator.d.ts} +0 -0
  15. /package/dist/components/live-player/{live-player-playback.d.ts → ui/live-player-playback.d.ts} +0 -0
  16. /package/dist/components/live-player/{live-player-progress.d.ts → ui/live-player-progress.d.ts} +0 -0
  17. /package/dist/components/live-player/{live-player-start-over.d.ts → ui/live-player-start-over.d.ts} +0 -0
  18. /package/dist/components/vod-player/{vod-player-playback-indicator.d.ts → ui/vod-player-playback-indicator.d.ts} +0 -0
  19. /package/dist/components/vod-player/{vod-player-playback.d.ts → ui/vod-player-playback.d.ts} +0 -0
  20. /package/dist/components/vod-player/{vod-player-progress.d.ts → ui/vod-player-progress.d.ts} +0 -0
  21. /package/dist/components/vod-player/{vod-player-remaining-time.d.ts → ui/vod-player-remaining-time.d.ts} +0 -0
@@ -1,8 +1,7 @@
1
1
  import { PropsWithChildren } from 'react';
2
2
  type State = {
3
3
  delay: number;
4
- startDate: Date;
5
- startTime: number;
4
+ startDate: Date | null;
6
5
  };
7
6
  type Actions = {
8
7
  setDelay: (delay: number) => void;
@@ -10,7 +9,7 @@ type Actions = {
10
9
  };
11
10
  type LivePlayerStore = State & Actions;
12
11
  type LivePlayerStoreProviderProps = PropsWithChildren & {
13
- startDate: Date;
12
+ startDate: Date | null;
14
13
  };
15
14
  declare const LivePlayerStoreProvider: ({ children, startDate, }: LivePlayerStoreProviderProps) => import("react/jsx-runtime").JSX.Element;
16
15
  declare const useLivePlayerStore: <T>(selector: (state: LivePlayerStore) => T) => T;
@@ -1,6 +1,6 @@
1
- import { PlayerLevel } from '../types/player';
1
+ import { PlayerError, PlayerLevel } from '../types/player';
2
2
  import { createPlayerEventEmitter } from '../utils/player-events';
3
- import { PropsWithChildren, RefObject } from 'react';
3
+ import { SyntheticEvent, PropsWithChildren, RefObject } from 'react';
4
4
  type PlaybackState = {
5
5
  currentTime: number;
6
6
  duration: number;
@@ -31,7 +31,7 @@ type PlaybackActions = {
31
31
  handleTimeUpdate: () => void;
32
32
  handleWaiting: () => void;
33
33
  handleVolumeChange: () => void;
34
- handleError: (event: unknown) => void;
34
+ handleError: (event: SyntheticEvent | undefined | null) => void;
35
35
  pause: () => void;
36
36
  play: () => void;
37
37
  seek: (time: number) => void;
@@ -70,6 +70,13 @@ type FullscreenActions = {
70
70
  setIsFullscreenReady: (isFullscreenReady: boolean) => void;
71
71
  };
72
72
  type FullscreenSlice = FullscreenState & FullscreenActions;
73
+ type ErrorState = {
74
+ error: PlayerError | null;
75
+ };
76
+ type ErrorActions = {
77
+ setError: (error: PlayerError | null) => void;
78
+ };
79
+ type ErrorSlice = ErrorState & ErrorActions;
73
80
  type RefState = {
74
81
  techRef: RefObject<HTMLVideoElement | null>;
75
82
  containerRef: RefObject<HTMLDivElement | null>;
@@ -79,7 +86,7 @@ type EventEmitterState = {
79
86
  eventEmitter: ReturnType<typeof createPlayerEventEmitter>;
80
87
  };
81
88
  type EventEmitterSlice = EventEmitterState;
82
- type PlayerStore = PlaybackSlice & IdleLockSlice & QualitySlice & FullscreenSlice & RefSlice & EventEmitterSlice;
89
+ type PlayerStore = PlaybackSlice & IdleLockSlice & QualitySlice & FullscreenSlice & ErrorSlice & RefSlice & EventEmitterSlice;
83
90
  declare function PlayerStoreProvider({ children }: PropsWithChildren): import("react/jsx-runtime").JSX.Element;
84
91
  declare const usePlayerStore: <T>(selector: (state: PlayerStore) => T) => T;
85
92
  export { PlayerStoreProvider, usePlayerStore };
@@ -1,3 +1,8 @@
1
+ type PlayerError = {
2
+ message: string;
3
+ code: string;
4
+ tech: "hls" | "native";
5
+ };
1
6
  type PlayerLevel = {
2
7
  bitrate?: number;
3
8
  height?: number;
@@ -34,4 +39,4 @@ type PlayerEvents = {
34
39
  waiting: void;
35
40
  error: unknown;
36
41
  };
37
- export type { PlayerLevel, PlayerEvents };
42
+ export type { PlayerError, PlayerEvents, PlayerLevel };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@halibegic/react-video-player",
3
3
  "description": "A React video player library with HLS support for VOD and Live streaming",
4
- "version": "0.0.23",
4
+ "version": "0.0.25",
5
5
  "license": "MIT",
6
6
  "keywords": [
7
7
  "react",