@halibegic/react-video-player 0.0.35 → 0.0.37

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
@@ -41,6 +41,7 @@ function App() {
41
41
  | ----------- | ---------------------------------------- | ------------------------------------------------------- | ------- |
42
42
  | `url` | `string` | The vod stream URL | - |
43
43
  | `startTime` | `number` | (Optional) Start time in seconds to begin playback from | - |
44
+ | `messages` | `{ unableToPlay?: string }` | (Optional) Custom message for unable to play errors | - |
44
45
  | `onEvent` | `(event: string, data: unknown) => void` | (Optional) Event handler callback for player events | - |
45
46
 
46
47
  **Example with `startTime`:**
@@ -54,6 +55,24 @@ function App() {
54
55
  }
55
56
  ```
56
57
 
58
+ **Example with custom `unableToPlay` message:**
59
+
60
+ ```tsx
61
+ import "@halibegic/react-video-player/style.css";
62
+ import { VodPlayer } from "@halibegic/react-video-player";
63
+
64
+ function App() {
65
+ return (
66
+ <VodPlayer
67
+ url="https://example.com/vod.m3u8"
68
+ messages={{
69
+ unableToPlay: "Video cannot be played. Please try again later.",
70
+ }}
71
+ />
72
+ );
73
+ }
74
+ ```
75
+
57
76
  ### Live Player
58
77
 
59
78
  ```tsx
@@ -69,6 +88,7 @@ function App() {
69
88
  eventFinished: "Live stream je završen.",
70
89
  eventStartingSoon: "Počinje za nekoliko sekundi...",
71
90
  live: "Uživo",
91
+ unableToPlay: "Stream ne može biti reprodukovan. Molimo pokušajte kasnije.",
72
92
  }}
73
93
  />
74
94
  );
@@ -79,7 +99,7 @@ function App() {
79
99
  | ---------- | ------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------ | ---------------------------------------------------------------------------------------------------------------------------------------------- |
80
100
  | `url` | `string` | The live stream URL | - |
81
101
  | `onEvent` | `(event: string, data: unknown) => void` | (Optional) Event handler callback for player events | - |
82
- | `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" }` |
102
+ | `messages` | `{ eventNotStarted: string; eventFinished: string; eventStartingSoon?: string; live?: string; unableToPlay?: string; }` | (Optional) Custom messages for event not started, finished, starting soon, live states, and unable to play errors | `{ eventNotStarted: "Event has not started yet.", eventFinished: "Event has finished.", eventStartingSoon: "Starting soon...", live: "Live" }` |
83
103
 
84
104
  ## Keyboard Shortcuts
85
105
 
@@ -2,6 +2,7 @@ type LivePlayerTechProps = {
2
2
  url: string;
3
3
  messages?: {
4
4
  eventFinished?: string;
5
+ unableToPlay?: string;
5
6
  };
6
7
  };
7
8
  declare function LivePlayerTech({ url, messages }: LivePlayerTechProps): import("react/jsx-runtime").JSX.Element | null;
@@ -5,6 +5,7 @@ type LivePlayerProps = {
5
5
  eventNotStarted: string;
6
6
  eventStartingSoon: string;
7
7
  live: string;
8
+ unableToPlay: string;
8
9
  };
9
10
  onEvent?: (event: string, data: unknown) => void;
10
11
  };
@@ -3,6 +3,7 @@ type PlayerHlsEngineProps = {
3
3
  isLive: boolean;
4
4
  messages?: {
5
5
  eventFinished?: string;
6
+ unableToPlay?: string;
6
7
  };
7
8
  };
8
9
  declare function PlayerHlsEngine({ url, isLive, messages }: PlayerHlsEngineProps): null;
@@ -4,6 +4,7 @@ type PlayerTechProps = {
4
4
  isMuted?: boolean;
5
5
  messages?: {
6
6
  eventFinished?: string;
7
+ unableToPlay?: string;
7
8
  };
8
9
  };
9
10
  declare function PlayerTech({ url, isLive, isMuted, messages, }: PlayerTechProps): import("react/jsx-runtime").JSX.Element;
@@ -1,6 +1,9 @@
1
1
  type VodPlayerProps = {
2
2
  url: string;
3
3
  startTime?: number;
4
+ messages?: {
5
+ unableToPlay: string;
6
+ };
4
7
  onEvent?: (event: string, data: unknown) => void;
5
8
  };
6
9
  declare function VodPlayer(props: VodPlayerProps): import("react/jsx-runtime").JSX.Element;