@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 +21 -1
- package/dist/components/live-player/live-player-tech.d.ts +1 -0
- package/dist/components/live-player.d.ts +1 -0
- package/dist/components/player/player-hls-engine.d.ts +1 -0
- package/dist/components/player/player-tech.d.ts +1 -0
- package/dist/components/vod-player.d.ts +3 -0
- package/dist/react-video-player.es.js +448 -433
- package/dist/react-video-player.es.js.map +1 -1
- package/dist/react-video-player.umd.js +8 -8
- package/dist/react-video-player.umd.js.map +1 -1
- package/dist/style.css +1 -1
- package/package.json +1 -1
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,
|
|
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
|
|