@livepeer-frameworks/player-react 0.0.3 → 0.1.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 +80 -0
- package/dist/cjs/index.js +1 -1
- package/dist/cjs/index.js.map +1 -1
- package/dist/esm/index.js +1 -1
- package/dist/esm/index.js.map +1 -1
- package/dist/types/components/PlayerControls.d.ts +2 -0
- package/dist/types/components/StatsPanel.d.ts +2 -14
- package/dist/types/hooks/useMetaTrack.d.ts +1 -1
- package/dist/types/hooks/usePlayerController.d.ts +2 -0
- package/dist/types/hooks/useStreamState.d.ts +1 -1
- package/dist/types/hooks/useTelemetry.d.ts +1 -1
- package/dist/types/hooks/useViewerEndpoints.d.ts +2 -2
- package/dist/types/types.d.ts +1 -1
- package/dist/types/ui/button.d.ts +1 -1
- package/package.json +1 -1
- package/src/components/DevModePanel.tsx +5 -27
- package/src/components/IdleScreen.tsx +0 -14
- package/src/components/LoadingScreen.tsx +2 -2
- package/src/components/Player.tsx +2 -18
- package/src/components/PlayerControls.tsx +2 -7
- package/src/components/SeekBar.tsx +1 -1
- package/src/components/StatsPanel.tsx +42 -20
- package/src/components/SubtitleRenderer.tsx +1 -1
- package/src/hooks/useMetaTrack.ts +2 -2
- package/src/hooks/usePlayerController.ts +3 -5
- package/src/hooks/useStreamState.ts +2 -2
- package/src/hooks/useTelemetry.ts +1 -1
- package/src/hooks/useViewerEndpoints.ts +7 -8
- package/src/types.ts +1 -1
- package/src/ui/slider.tsx +1 -1
package/README.md
ADDED
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
# @livepeer-frameworks/player-react
|
|
2
|
+
|
|
3
|
+
React wrapper for the FrameWorks player. Resolves endpoints via Gateway or Mist and renders the best available player (WebCodecs, HLS, etc).
|
|
4
|
+
|
|
5
|
+
**Docs:** `docs.frameworks.network`
|
|
6
|
+
|
|
7
|
+
## Install
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
pnpm add @livepeer-frameworks/player-react
|
|
11
|
+
# or
|
|
12
|
+
npm i @livepeer-frameworks/player-react
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
## Usage
|
|
16
|
+
|
|
17
|
+
```tsx
|
|
18
|
+
import { Player } from '@livepeer-frameworks/player-react';
|
|
19
|
+
|
|
20
|
+
export default function App() {
|
|
21
|
+
return (
|
|
22
|
+
<div style={{ width: '100%', height: 500 }}>
|
|
23
|
+
<Player
|
|
24
|
+
contentType="live"
|
|
25
|
+
contentId="pk_..." // playbackId
|
|
26
|
+
options={{ gatewayUrl: 'https://your-bridge/graphql' }}
|
|
27
|
+
/>
|
|
28
|
+
</div>
|
|
29
|
+
);
|
|
30
|
+
}
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
Notes:
|
|
34
|
+
- There is **no default gateway**; provide `gatewayUrl` unless you pass `endpoints` or `mistUrl`.
|
|
35
|
+
|
|
36
|
+
### Direct MistServer Node (mistUrl)
|
|
37
|
+
|
|
38
|
+
```tsx
|
|
39
|
+
<Player
|
|
40
|
+
contentType="live"
|
|
41
|
+
contentId="pk_..."
|
|
42
|
+
options={{ mistUrl: 'https://edge.example.com' }}
|
|
43
|
+
/>
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
### Styles
|
|
47
|
+
|
|
48
|
+
```ts
|
|
49
|
+
import '@livepeer-frameworks/player-react/player.css';
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
## Controls & Shortcuts
|
|
53
|
+
|
|
54
|
+
The player ships with keyboard/mouse shortcuts when the player is focused (click/tap once).
|
|
55
|
+
|
|
56
|
+
**Keyboard**
|
|
57
|
+
| Shortcut | Action | Notes |
|
|
58
|
+
|---|---|---|
|
|
59
|
+
| Space | Play/Pause | Hold = 2x speed (when seekable) |
|
|
60
|
+
| K | Play/Pause | YouTube-style |
|
|
61
|
+
| J / Left | Skip back 10s | Disabled on live-only |
|
|
62
|
+
| L / Right | Skip forward 10s | Disabled on live-only |
|
|
63
|
+
| Up / Down | Volume +/-10% | - |
|
|
64
|
+
| M | Mute/Unmute | - |
|
|
65
|
+
| F | Fullscreen toggle | - |
|
|
66
|
+
| C | Captions toggle | - |
|
|
67
|
+
| 0-9 | Seek to 0-90% | Disabled on live-only |
|
|
68
|
+
| , / . | Prev/Next frame (paused) | WebCodecs = true step; others = buffered-only |
|
|
69
|
+
|
|
70
|
+
**Mouse / Touch**
|
|
71
|
+
| Gesture | Action | Notes |
|
|
72
|
+
|---|---|---|
|
|
73
|
+
| Double-click | Fullscreen toggle | Desktop |
|
|
74
|
+
| Double-tap (left/right) | Skip +/-10s | Touch only, disabled on live-only |
|
|
75
|
+
| Click/Tap and hold | 2x speed | Disabled on live-only |
|
|
76
|
+
|
|
77
|
+
**Constraints**
|
|
78
|
+
- Live-only streams disable seeking/skip/2x hold and frame-step.
|
|
79
|
+
- Live with DVR buffer enables the same shortcuts as VOD.
|
|
80
|
+
- Frame stepping only moves within already buffered ranges (no network seek). WebCodecs supports true frame stepping when paused.
|