@nikelroot/video-player 0.2.9 → 0.3.0

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
@@ -25,9 +25,8 @@ export function Example() {
25
25
 
26
26
  return (
27
27
  <VideoPlayer
28
- videoRef={videoRef}
29
28
  videoSrc="https://example.com/stream.m3u8"
30
- controlsVariant="full"
29
+ videoRef={videoRef}
31
30
  active={true}
32
31
  live={false}
33
32
  autoPlay={false}
@@ -37,6 +36,8 @@ export function Example() {
37
36
  }
38
37
  ```
39
38
 
39
+ Only `videoSrc` is required. `controlsVariant` defaults to `"none"`; set it to `"full"`, `"fullscreen-only"`, or `"tiny"` to render built-in controls.
40
+
40
41
  When `active` is `true`, pressing `F` toggles fullscreen.
41
42
 
42
43
  ## Multiple MP4 players
@@ -79,3 +80,25 @@ Build before publishing:
79
80
  ```bash
80
81
  npm run build
81
82
  ```
83
+
84
+ ## Separate audio and video recordings
85
+
86
+ Provide the HLS master as `videoSrc`, the video media playlist as `videoOnlySrc`,
87
+ and available audio intervals in seconds on the same recording timeline:
88
+
89
+ ```tsx
90
+ <VideoPlayer
91
+ videoSrc="https://cdn.example.com/record/master.m3u8"
92
+ videoOnlySrc="https://cdn.example.com/record/video.m3u8"
93
+ audioRanges={[{ start: 0, end: 120 }, { start: 135, end: 240 }]}
94
+ onAudioFallbackChange={(videoOnly) => console.log({ videoOnly })}
95
+ />
96
+ ```
97
+
98
+ Missing audio switches playback to the video playlist while retaining position,
99
+ playing or paused state, speed, volume, and mute. Playback returns to the master
100
+ when the current position has at least four seconds of available audio. Audio
101
+ request failures impose a 15-second retry cooldown. Update `audioRanges` as a
102
+ live recording grows; callbacks and metadata updates do not reload the source.
103
+ The player displays a nonblocking status while playing without audio.
104
+ Both media playlists and their fragment timestamps must use the same timeline.