@halibegic/react-video-player 0.0.2 → 0.0.3
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 +43 -2
- package/dist/components/live-player.d.ts +9 -1
- package/dist/components/player/live-player/live-player-event-check.d.ts +8 -0
- package/dist/components/player/live-player/live-player-go-live.d.ts +6 -0
- package/dist/components/player/live-player/live-player-playback-indicator.d.ts +2 -0
- package/dist/components/player/live-player/live-player-playback.d.ts +1 -1
- package/dist/components/player/live-player/live-player-progress.d.ts +2 -0
- package/dist/components/player/live-player/live-player-provider.d.ts +7 -0
- package/dist/components/player/live-player/live-player-remaining-time.d.ts +2 -0
- package/dist/components/player/live-player/live-player-tech.d.ts +5 -0
- package/dist/components/player/player-hls-engine.d.ts +6 -0
- package/dist/components/player/player-tech.d.ts +1 -1
- package/dist/components/player/ui/icons/arrow-right-icon.d.ts +2 -0
- package/dist/components/player/ui/icons/fullscreen-enter-icon.d.ts +2 -0
- package/dist/components/player/ui/icons/fullscreen-exit-icon.d.ts +2 -0
- package/dist/components/player/ui/icons/pause-icon.d.ts +2 -0
- package/dist/components/player/ui/icons/play-icon.d.ts +2 -0
- package/dist/components/player/ui/icons/volume-max-icon.d.ts +2 -0
- package/dist/components/player/ui/icons/volume-min-icon.d.ts +2 -0
- package/dist/components/player/ui/icons/volume-mute-icon.d.ts +2 -0
- package/dist/components/player/ui/player-button.d.ts +5 -2
- package/dist/components/player/ui/player-controls.styles.d.ts +8 -0
- package/dist/components/player/ui/player-fullscreen.d.ts +1 -1
- package/dist/components/player/ui/player-idle-check.d.ts +3 -0
- package/dist/components/player/ui/player-playback-indicator.d.ts +4 -0
- package/dist/components/player/ui/player-progress.styles.d.ts +6 -0
- package/dist/components/player/ui/player-remaining-time.styles.d.ts +6 -0
- package/dist/components/player/ui/player-slider.d.ts +3 -5
- package/dist/components/player/ui/player-spinner.d.ts +3 -0
- package/dist/components/player/ui/player-volume.d.ts +2 -0
- package/dist/components/vod-player/vod-player-playback-indicator.d.ts +2 -0
- package/dist/components/vod-player/vod-player-remaining-time.d.ts +2 -0
- package/dist/components/vod-player/vod-player-watch-history.d.ts +5 -0
- package/dist/components/vod-player.d.ts +5 -1
- package/dist/config/player.d.ts +3 -5
- package/dist/hooks/use-interval.d.ts +2 -0
- package/dist/hooks/use-isomorphic-layout-effect.d.ts +3 -0
- package/dist/hooks/use-state-refresh.d.ts +2 -0
- package/dist/index-DkJtizQx.js +3265 -0
- package/dist/index-DkJtizQx.js.map +1 -0
- package/dist/react-video-player.es.js +1 -1
- package/dist/react-video-player.umd.js +227 -105
- package/dist/react-video-player.umd.js.map +1 -1
- package/dist/stores/live-player-store.d.ts +21 -0
- package/dist/stores/player-store.d.ts +1 -1
- package/dist/utils/dom.d.ts +11 -0
- package/dist/utils/player.d.ts +4 -3
- package/dist/vod-player-watch-history-D3ZHK2x3.js +37 -0
- package/dist/vod-player-watch-history-D3ZHK2x3.js.map +1 -0
- package/package.json +3 -8
- package/dist/components/player/tech/player-dash-tech.d.ts +0 -6
- package/dist/components/player/tech/player-hls-tech.d.ts +0 -6
- package/dist/index-DXKCbM7O.js +0 -2003
- package/dist/index-DXKCbM7O.js.map +0 -1
- package/dist/player-dash-tech-D7KQCWFx.js +0 -50
- package/dist/player-dash-tech-D7KQCWFx.js.map +0 -1
- package/dist/player-hls-tech-sXKjWi4D.js +0 -29
- package/dist/player-hls-tech-sXKjWi4D.js.map +0 -1
- /package/dist/{components/hooks → hooks}/use-debounce.d.ts +0 -0
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# React Video Player
|
|
2
2
|
|
|
3
|
-
A React video player supporting HLS
|
|
3
|
+
A React video player supporting HLS protocol for VOD / live streaming.
|
|
4
4
|
|
|
5
5
|
## Installation
|
|
6
6
|
|
|
@@ -20,16 +20,57 @@ function App() {
|
|
|
20
20
|
}
|
|
21
21
|
```
|
|
22
22
|
|
|
23
|
+
| Prop | Type | Description | Default |
|
|
24
|
+
| -------------- | ------------------------------------------- | ------------------------------------------------------------------------------------------------- | ------- |
|
|
25
|
+
| `url` | `string` | The vod stream URL | - |
|
|
26
|
+
| `watchHistory` | `{ enabled: boolean; storageKey: string; }` | (Optional) Enable watch history and specify a **unique** storage key for each vod player instance | - |
|
|
27
|
+
|
|
28
|
+
**Example with `watchHistory`:**
|
|
29
|
+
|
|
30
|
+
```tsx
|
|
31
|
+
import { VodPlayer } from "@halibegic/react-video-player";
|
|
32
|
+
|
|
33
|
+
function App() {
|
|
34
|
+
return (
|
|
35
|
+
<VodPlayer
|
|
36
|
+
url="https://example.com/vod.m3u8"
|
|
37
|
+
watchHistory={{ enabled: true, storageKey: "video-1" }}
|
|
38
|
+
/>
|
|
39
|
+
);
|
|
40
|
+
}
|
|
41
|
+
```
|
|
42
|
+
|
|
23
43
|
### Live Player
|
|
24
44
|
|
|
25
45
|
```tsx
|
|
26
46
|
import { LivePlayer } from "@halibegic/react-video-player";
|
|
27
47
|
|
|
28
48
|
function App() {
|
|
29
|
-
return
|
|
49
|
+
return (
|
|
50
|
+
<LivePlayer
|
|
51
|
+
url="https://example.com/live.m3u8"
|
|
52
|
+
startDate="2025-09-03T00:00:00Z"
|
|
53
|
+
endDate="2025-10-03T23:59:59Z"
|
|
54
|
+
messages={{
|
|
55
|
+
eventNotStarted: "Live stream još nije počeo. Molimo pričekajte.",
|
|
56
|
+
eventFinished: "Live stream je završen.",
|
|
57
|
+
eventStartingSoon: "Počinje za nekoliko sekundi...",
|
|
58
|
+
live: "Uživo",
|
|
59
|
+
}}
|
|
60
|
+
/>
|
|
61
|
+
);
|
|
30
62
|
}
|
|
31
63
|
```
|
|
32
64
|
|
|
65
|
+
| Prop | Type | Description | Default |
|
|
66
|
+
| ----------- | ------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------ | ---------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
67
|
+
| `url` | `string` | The live stream URL | - |
|
|
68
|
+
| `startDate` | `string` | Start date for the live event in ISO 8601 format | - |
|
|
69
|
+
| `endDate` | `string` | End date for the live event in ISO 8601 format | - |
|
|
70
|
+
| `messages` | `{ eventNotStarted: string; eventFinished: string; eventStartingSoon?: string; live?: string; }` | (Optional) Custom messages for event not started, finished, starting soon, and live states | `{ eventNotStarted: "Event has not started yet.", eventFinished: "Event has finished.", eventStartingSoon: "Starting soon...", live: "Live" }` |
|
|
71
|
+
|
|
72
|
+
**Example with `messages`:**
|
|
73
|
+
|
|
33
74
|
## Development
|
|
34
75
|
|
|
35
76
|
```bash
|
|
@@ -1,6 +1,14 @@
|
|
|
1
1
|
type LivePlayerProps = {
|
|
2
2
|
url: string;
|
|
3
|
+
startDate: Date | string;
|
|
4
|
+
endDate: Date | string;
|
|
5
|
+
messages?: {
|
|
6
|
+
eventFinished: string;
|
|
7
|
+
eventNotStarted: string;
|
|
8
|
+
eventStartingSoon: string;
|
|
9
|
+
live: string;
|
|
10
|
+
};
|
|
3
11
|
};
|
|
4
|
-
declare function LivePlayer(
|
|
12
|
+
declare function LivePlayer({ url, startDate, endDate, messages }: LivePlayerProps): import("react/jsx-runtime").JSX.Element;
|
|
5
13
|
export { LivePlayer };
|
|
6
14
|
export type { LivePlayerProps };
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { PropsWithChildren } from 'react';
|
|
2
|
+
type LivePlayerEventCheckProps = PropsWithChildren & {
|
|
3
|
+
eventFinishedMessage?: string;
|
|
4
|
+
eventNotStartedMessage?: string;
|
|
5
|
+
eventStartingSoonMessage?: string;
|
|
6
|
+
};
|
|
7
|
+
declare function LivePlayerEventCheck({ children, eventFinishedMessage, eventNotStartedMessage, eventStartingSoonMessage, }: LivePlayerEventCheckProps): import("react/jsx-runtime").JSX.Element;
|
|
8
|
+
export default LivePlayerEventCheck;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { PlayerButtonProps } from '../ui/player-button';
|
|
2
|
+
type LivePlayerGoLiveProps = PlayerButtonProps & {
|
|
3
|
+
message?: string;
|
|
4
|
+
};
|
|
5
|
+
declare function LivePlayerGoLive({ message, ...props }: LivePlayerGoLiveProps): import("react/jsx-runtime").JSX.Element | null;
|
|
6
|
+
export { LivePlayerGoLive };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
declare function LivePlayerPlayback(): import("react/jsx-runtime").JSX.Element
|
|
1
|
+
declare function LivePlayerPlayback(): import("react/jsx-runtime").JSX.Element;
|
|
2
2
|
export { LivePlayerPlayback };
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { PropsWithChildren } from 'react';
|
|
2
|
+
type LivePlayerProviderProps = PropsWithChildren & {
|
|
3
|
+
startDate: Date;
|
|
4
|
+
endDate: Date;
|
|
5
|
+
};
|
|
6
|
+
declare function LivePlayerProvider({ children, startDate, endDate, }: LivePlayerProviderProps): import("react/jsx-runtime").JSX.Element;
|
|
7
|
+
export { LivePlayerProvider };
|
|
@@ -3,5 +3,5 @@ type PlayerTechProps = {
|
|
|
3
3
|
isLive: boolean;
|
|
4
4
|
isMuted?: boolean;
|
|
5
5
|
};
|
|
6
|
-
declare function PlayerTech({ url, isLive, isMuted }: PlayerTechProps): import("react/jsx-runtime").JSX.Element
|
|
6
|
+
declare function PlayerTech({ url, isLive, isMuted }: PlayerTechProps): import("react/jsx-runtime").JSX.Element;
|
|
7
7
|
export { PlayerTech };
|
|
@@ -1,4 +1,7 @@
|
|
|
1
1
|
import { HTMLAttributes } from 'react';
|
|
2
|
-
type PlayerButtonProps = HTMLAttributes<HTMLButtonElement
|
|
3
|
-
|
|
2
|
+
type PlayerButtonProps = HTMLAttributes<HTMLButtonElement> & {
|
|
3
|
+
shape?: "square" | "circle";
|
|
4
|
+
};
|
|
5
|
+
declare function PlayerButton({ shape, ...props }: PlayerButtonProps): import("react/jsx-runtime").JSX.Element;
|
|
4
6
|
export { PlayerButton };
|
|
7
|
+
export type { PlayerButtonProps };
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export declare const PlayerContainer: import('styled-components/dist/types').IStyledComponentBase<"web", import('styled-components').FastOmit<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
|
|
2
|
+
export declare const ControlsBottom: import('styled-components/dist/types').IStyledComponentBase<"web", import('styled-components').FastOmit<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
|
|
3
|
+
export declare const ControlsContainer: import('styled-components/dist/types').IStyledComponentBase<"web", import('styled-components').FastOmit<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
|
|
4
|
+
export declare const ControlsRow: import('styled-components/dist/types').IStyledComponentBase<"web", import('styled-components').FastOmit<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
|
|
5
|
+
export declare const ControlsSection: import('styled-components/dist/types').IStyledComponentBase<"web", import('styled-components').FastOmit<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
|
|
6
|
+
export declare const ControlsSectionStart: import('styled-components/dist/types').IStyledComponentBase<"web", import('styled-components').FastOmit<import('styled-components').FastOmit<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>, never>> & string;
|
|
7
|
+
export declare const ControlsSectionCenter: import('styled-components/dist/types').IStyledComponentBase<"web", import('styled-components').FastOmit<import('styled-components').FastOmit<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>, never>> & string;
|
|
8
|
+
export declare const ControlsSectionEnd: import('styled-components/dist/types').IStyledComponentBase<"web", import('styled-components').FastOmit<import('styled-components').FastOmit<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>, never>> & string;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
declare
|
|
1
|
+
declare function PlayerFullscreen(): import("react/jsx-runtime").JSX.Element;
|
|
2
2
|
export { PlayerFullscreen };
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { ButtonHTMLAttributes } from 'react';
|
|
2
|
+
type PlayerPlaybackIndicatorProps = ButtonHTMLAttributes<HTMLButtonElement>;
|
|
3
|
+
declare function PlayerPlaybackIndicator({ className, onClick, ...props }: PlayerPlaybackIndicatorProps): import("react/jsx-runtime").JSX.Element;
|
|
4
|
+
export { PlayerPlaybackIndicator };
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
declare const ProgressSlider: import('styled-components/dist/types').IStyledComponentBase<"web", import('styled-components').FastOmit<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
|
|
2
|
+
declare const TipContainer: import('styled-components/dist/types').IStyledComponentBase<"web", import('styled-components/dist/types').Substitute<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {
|
|
3
|
+
$isVisible: boolean;
|
|
4
|
+
}>> & string;
|
|
5
|
+
declare const TipContent: import('styled-components/dist/types').IStyledComponentBase<"web", import('styled-components').FastOmit<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLParagraphElement>, HTMLParagraphElement>, never>> & string;
|
|
6
|
+
export { ProgressSlider, TipContainer, TipContent };
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
declare const RemainingTime: import('styled-components/dist/types').IStyledComponentBase<"web", import('styled-components').FastOmit<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
|
|
2
|
+
declare const Time: import('styled-components/dist/types').IStyledComponentBase<"web", import('styled-components').FastOmit<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLParagraphElement>, HTMLParagraphElement>, never>> & string;
|
|
3
|
+
declare const CurrentTime: import('styled-components/dist/types').IStyledComponentBase<"web", import('styled-components').FastOmit<import('styled-components').FastOmit<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLParagraphElement>, HTMLParagraphElement>, never>, never>> & string;
|
|
4
|
+
declare const Duration: import('styled-components/dist/types').IStyledComponentBase<"web", import('styled-components').FastOmit<import('styled-components').FastOmit<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLParagraphElement>, HTMLParagraphElement>, never>, never>> & string;
|
|
5
|
+
declare const Separator: import('styled-components/dist/types').IStyledComponentBase<"web", import('styled-components').FastOmit<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLParagraphElement>, HTMLParagraphElement>, never>> & string;
|
|
6
|
+
export { CurrentTime, Duration, RemainingTime, Separator, Time };
|
|
@@ -1,6 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
};
|
|
5
|
-
declare function PlayerSlider(props: PlayerSliderProps): null;
|
|
1
|
+
import { ComponentProps } from 'react';
|
|
2
|
+
import * as Slider from "@radix-ui/react-slider";
|
|
3
|
+
declare function PlayerSlider({ max, min, ...props }: ComponentProps<typeof Slider.Root>): import("react/jsx-runtime").JSX.Element;
|
|
6
4
|
export { PlayerSlider };
|
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
type VodPlayerProps = {
|
|
2
2
|
url: string;
|
|
3
|
+
watchHistory?: {
|
|
4
|
+
enabled: boolean;
|
|
5
|
+
storageKey: string;
|
|
6
|
+
};
|
|
3
7
|
};
|
|
4
|
-
declare function VodPlayer(
|
|
8
|
+
declare function VodPlayer({ url, watchHistory }: VodPlayerProps): import("react/jsx-runtime").JSX.Element;
|
|
5
9
|
export { VodPlayer };
|
|
6
10
|
export type { VodPlayerProps };
|
package/dist/config/player.d.ts
CHANGED