@lightbird/ui 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/LICENSE +21 -0
- package/README.md +61 -0
- package/dist/index.cjs +2286 -0
- package/dist/index.d.cts +123 -0
- package/dist/index.d.ts +123 -0
- package/dist/index.js +2247 -0
- package/dist/styles.css +1 -0
- package/package.json +99 -0
package/dist/index.d.cts
ADDED
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
+
import React$1, { RefObject, Component, ReactNode } from 'react';
|
|
3
|
+
import { VideoFilters, Subtitle, AudioTrack, Chapter, PlaylistItem, ParsedMediaError, VideoMetadata, ShortcutBinding } from '@lightbird/core';
|
|
4
|
+
|
|
5
|
+
declare const LightBirdPlayer: () => react_jsx_runtime.JSX.Element;
|
|
6
|
+
|
|
7
|
+
interface PlayerControlsProps {
|
|
8
|
+
isPlaying: boolean;
|
|
9
|
+
progress: number;
|
|
10
|
+
duration: number;
|
|
11
|
+
volume: number;
|
|
12
|
+
isMuted: boolean;
|
|
13
|
+
playbackRate: number;
|
|
14
|
+
loop: boolean;
|
|
15
|
+
isFullScreen: boolean;
|
|
16
|
+
filters: VideoFilters;
|
|
17
|
+
zoom: number;
|
|
18
|
+
subtitles: Subtitle[];
|
|
19
|
+
activeSubtitle: string;
|
|
20
|
+
audioTracks: AudioTrack[];
|
|
21
|
+
activeAudioTrack: string;
|
|
22
|
+
chapters?: Chapter[];
|
|
23
|
+
currentChapter?: Chapter | null;
|
|
24
|
+
onPlayPause: () => void;
|
|
25
|
+
onSeek: (value: number) => void;
|
|
26
|
+
onVolumeChange: (value: number) => void;
|
|
27
|
+
onMuteToggle: () => void;
|
|
28
|
+
onPlaybackRateChange: (rate: number) => void;
|
|
29
|
+
onLoopToggle: () => void;
|
|
30
|
+
onFullScreenToggle: () => void;
|
|
31
|
+
onFrameStep: (direction: 'forward' | 'backward') => void;
|
|
32
|
+
onScreenshot: () => void;
|
|
33
|
+
onNext: () => void;
|
|
34
|
+
onPrevious: () => void;
|
|
35
|
+
onFiltersChange: (filters: VideoFilters) => void;
|
|
36
|
+
onZoomChange: (zoom: number) => void;
|
|
37
|
+
onSubtitleChange: (id: string) => void;
|
|
38
|
+
onAudioTrackChange: (id: string) => void;
|
|
39
|
+
tracksLoading?: boolean;
|
|
40
|
+
onSubtitleUpload?: () => void;
|
|
41
|
+
onSubtitleRemove?: (id: string) => void;
|
|
42
|
+
onShowInfo?: () => void;
|
|
43
|
+
onOpenShortcuts?: () => void;
|
|
44
|
+
onGoToChapter?: (index: number) => void;
|
|
45
|
+
onTogglePiP?: () => void;
|
|
46
|
+
isPiP?: boolean;
|
|
47
|
+
pipSupported?: boolean;
|
|
48
|
+
}
|
|
49
|
+
declare const PlayerControls: React$1.NamedExoticComponent<PlayerControlsProps>;
|
|
50
|
+
|
|
51
|
+
type PlaylistSize = "sm" | "md" | "lg";
|
|
52
|
+
interface PlaylistPanelProps {
|
|
53
|
+
playlist: PlaylistItem[];
|
|
54
|
+
currentVideoIndex: number | null;
|
|
55
|
+
onSelectVideo: (index: number) => void;
|
|
56
|
+
onFilesAdded: (files: FileList) => void;
|
|
57
|
+
onFolderFilesAdded: (files: File[]) => void;
|
|
58
|
+
onAddStream: (url: string, name?: string) => void;
|
|
59
|
+
onRemoveItem: (index: number) => void;
|
|
60
|
+
onReorder: (newPlaylist: PlaylistItem[]) => void;
|
|
61
|
+
onImportM3U: (items: Omit<PlaylistItem, "id">[]) => void;
|
|
62
|
+
isOpen: boolean;
|
|
63
|
+
isPinned: boolean;
|
|
64
|
+
size: PlaylistSize;
|
|
65
|
+
onToggle: () => void;
|
|
66
|
+
onTogglePin: () => void;
|
|
67
|
+
onSizeChange: (size: PlaylistSize) => void;
|
|
68
|
+
}
|
|
69
|
+
declare const PlaylistPanel: React$1.FC<PlaylistPanelProps>;
|
|
70
|
+
|
|
71
|
+
interface VideoOverlayProps {
|
|
72
|
+
isLoading: boolean;
|
|
73
|
+
loadingMessage: string;
|
|
74
|
+
processingProgress?: number;
|
|
75
|
+
eta?: number | null;
|
|
76
|
+
throughputMBs?: number | null;
|
|
77
|
+
onCancel?: () => void;
|
|
78
|
+
}
|
|
79
|
+
declare function VideoOverlay({ isLoading, loadingMessage, processingProgress, eta, throughputMBs, onCancel }: VideoOverlayProps): react_jsx_runtime.JSX.Element | null;
|
|
80
|
+
|
|
81
|
+
interface SubtitleOverlayProps {
|
|
82
|
+
videoRef: RefObject<HTMLVideoElement | null>;
|
|
83
|
+
activeSubtitle: string;
|
|
84
|
+
}
|
|
85
|
+
declare function SubtitleOverlay({ videoRef, activeSubtitle }: SubtitleOverlayProps): react_jsx_runtime.JSX.Element | null;
|
|
86
|
+
|
|
87
|
+
interface Props$1 {
|
|
88
|
+
error: ParsedMediaError;
|
|
89
|
+
onRetry?: () => void;
|
|
90
|
+
onSkip?: () => void;
|
|
91
|
+
onDismiss?: () => void;
|
|
92
|
+
}
|
|
93
|
+
declare function PlayerErrorDisplay({ error, onRetry, onSkip, onDismiss }: Props$1): react_jsx_runtime.JSX.Element;
|
|
94
|
+
|
|
95
|
+
interface Props {
|
|
96
|
+
children: ReactNode;
|
|
97
|
+
}
|
|
98
|
+
interface State {
|
|
99
|
+
hasError: boolean;
|
|
100
|
+
}
|
|
101
|
+
declare class PlayerErrorBoundary extends Component<Props, State> {
|
|
102
|
+
state: State;
|
|
103
|
+
static getDerivedStateFromError(): State;
|
|
104
|
+
componentDidCatch(error: Error, info: React.ErrorInfo): void;
|
|
105
|
+
render(): string | number | boolean | Iterable<ReactNode> | react_jsx_runtime.JSX.Element | null | undefined;
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
interface VideoInfoPanelProps {
|
|
109
|
+
metadata: VideoMetadata | null;
|
|
110
|
+
onClose: () => void;
|
|
111
|
+
}
|
|
112
|
+
declare function VideoInfoPanel({ metadata, onClose }: VideoInfoPanelProps): react_jsx_runtime.JSX.Element | null;
|
|
113
|
+
|
|
114
|
+
interface ShortcutSettingsDialogProps {
|
|
115
|
+
shortcuts: ShortcutBinding[];
|
|
116
|
+
onSave: (bindings: ShortcutBinding[]) => void;
|
|
117
|
+
onClose: () => void;
|
|
118
|
+
}
|
|
119
|
+
declare function ShortcutSettingsDialog({ shortcuts, onSave, onClose, }: ShortcutSettingsDialogProps): react_jsx_runtime.JSX.Element;
|
|
120
|
+
|
|
121
|
+
declare function Toaster(): react_jsx_runtime.JSX.Element;
|
|
122
|
+
|
|
123
|
+
export { LightBirdPlayer, PlayerControls, PlayerErrorBoundary, PlayerErrorDisplay, PlaylistPanel, ShortcutSettingsDialog, SubtitleOverlay, Toaster, VideoInfoPanel, VideoOverlay };
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
+
import React$1, { RefObject, Component, ReactNode } from 'react';
|
|
3
|
+
import { VideoFilters, Subtitle, AudioTrack, Chapter, PlaylistItem, ParsedMediaError, VideoMetadata, ShortcutBinding } from '@lightbird/core';
|
|
4
|
+
|
|
5
|
+
declare const LightBirdPlayer: () => react_jsx_runtime.JSX.Element;
|
|
6
|
+
|
|
7
|
+
interface PlayerControlsProps {
|
|
8
|
+
isPlaying: boolean;
|
|
9
|
+
progress: number;
|
|
10
|
+
duration: number;
|
|
11
|
+
volume: number;
|
|
12
|
+
isMuted: boolean;
|
|
13
|
+
playbackRate: number;
|
|
14
|
+
loop: boolean;
|
|
15
|
+
isFullScreen: boolean;
|
|
16
|
+
filters: VideoFilters;
|
|
17
|
+
zoom: number;
|
|
18
|
+
subtitles: Subtitle[];
|
|
19
|
+
activeSubtitle: string;
|
|
20
|
+
audioTracks: AudioTrack[];
|
|
21
|
+
activeAudioTrack: string;
|
|
22
|
+
chapters?: Chapter[];
|
|
23
|
+
currentChapter?: Chapter | null;
|
|
24
|
+
onPlayPause: () => void;
|
|
25
|
+
onSeek: (value: number) => void;
|
|
26
|
+
onVolumeChange: (value: number) => void;
|
|
27
|
+
onMuteToggle: () => void;
|
|
28
|
+
onPlaybackRateChange: (rate: number) => void;
|
|
29
|
+
onLoopToggle: () => void;
|
|
30
|
+
onFullScreenToggle: () => void;
|
|
31
|
+
onFrameStep: (direction: 'forward' | 'backward') => void;
|
|
32
|
+
onScreenshot: () => void;
|
|
33
|
+
onNext: () => void;
|
|
34
|
+
onPrevious: () => void;
|
|
35
|
+
onFiltersChange: (filters: VideoFilters) => void;
|
|
36
|
+
onZoomChange: (zoom: number) => void;
|
|
37
|
+
onSubtitleChange: (id: string) => void;
|
|
38
|
+
onAudioTrackChange: (id: string) => void;
|
|
39
|
+
tracksLoading?: boolean;
|
|
40
|
+
onSubtitleUpload?: () => void;
|
|
41
|
+
onSubtitleRemove?: (id: string) => void;
|
|
42
|
+
onShowInfo?: () => void;
|
|
43
|
+
onOpenShortcuts?: () => void;
|
|
44
|
+
onGoToChapter?: (index: number) => void;
|
|
45
|
+
onTogglePiP?: () => void;
|
|
46
|
+
isPiP?: boolean;
|
|
47
|
+
pipSupported?: boolean;
|
|
48
|
+
}
|
|
49
|
+
declare const PlayerControls: React$1.NamedExoticComponent<PlayerControlsProps>;
|
|
50
|
+
|
|
51
|
+
type PlaylistSize = "sm" | "md" | "lg";
|
|
52
|
+
interface PlaylistPanelProps {
|
|
53
|
+
playlist: PlaylistItem[];
|
|
54
|
+
currentVideoIndex: number | null;
|
|
55
|
+
onSelectVideo: (index: number) => void;
|
|
56
|
+
onFilesAdded: (files: FileList) => void;
|
|
57
|
+
onFolderFilesAdded: (files: File[]) => void;
|
|
58
|
+
onAddStream: (url: string, name?: string) => void;
|
|
59
|
+
onRemoveItem: (index: number) => void;
|
|
60
|
+
onReorder: (newPlaylist: PlaylistItem[]) => void;
|
|
61
|
+
onImportM3U: (items: Omit<PlaylistItem, "id">[]) => void;
|
|
62
|
+
isOpen: boolean;
|
|
63
|
+
isPinned: boolean;
|
|
64
|
+
size: PlaylistSize;
|
|
65
|
+
onToggle: () => void;
|
|
66
|
+
onTogglePin: () => void;
|
|
67
|
+
onSizeChange: (size: PlaylistSize) => void;
|
|
68
|
+
}
|
|
69
|
+
declare const PlaylistPanel: React$1.FC<PlaylistPanelProps>;
|
|
70
|
+
|
|
71
|
+
interface VideoOverlayProps {
|
|
72
|
+
isLoading: boolean;
|
|
73
|
+
loadingMessage: string;
|
|
74
|
+
processingProgress?: number;
|
|
75
|
+
eta?: number | null;
|
|
76
|
+
throughputMBs?: number | null;
|
|
77
|
+
onCancel?: () => void;
|
|
78
|
+
}
|
|
79
|
+
declare function VideoOverlay({ isLoading, loadingMessage, processingProgress, eta, throughputMBs, onCancel }: VideoOverlayProps): react_jsx_runtime.JSX.Element | null;
|
|
80
|
+
|
|
81
|
+
interface SubtitleOverlayProps {
|
|
82
|
+
videoRef: RefObject<HTMLVideoElement | null>;
|
|
83
|
+
activeSubtitle: string;
|
|
84
|
+
}
|
|
85
|
+
declare function SubtitleOverlay({ videoRef, activeSubtitle }: SubtitleOverlayProps): react_jsx_runtime.JSX.Element | null;
|
|
86
|
+
|
|
87
|
+
interface Props$1 {
|
|
88
|
+
error: ParsedMediaError;
|
|
89
|
+
onRetry?: () => void;
|
|
90
|
+
onSkip?: () => void;
|
|
91
|
+
onDismiss?: () => void;
|
|
92
|
+
}
|
|
93
|
+
declare function PlayerErrorDisplay({ error, onRetry, onSkip, onDismiss }: Props$1): react_jsx_runtime.JSX.Element;
|
|
94
|
+
|
|
95
|
+
interface Props {
|
|
96
|
+
children: ReactNode;
|
|
97
|
+
}
|
|
98
|
+
interface State {
|
|
99
|
+
hasError: boolean;
|
|
100
|
+
}
|
|
101
|
+
declare class PlayerErrorBoundary extends Component<Props, State> {
|
|
102
|
+
state: State;
|
|
103
|
+
static getDerivedStateFromError(): State;
|
|
104
|
+
componentDidCatch(error: Error, info: React.ErrorInfo): void;
|
|
105
|
+
render(): string | number | boolean | Iterable<ReactNode> | react_jsx_runtime.JSX.Element | null | undefined;
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
interface VideoInfoPanelProps {
|
|
109
|
+
metadata: VideoMetadata | null;
|
|
110
|
+
onClose: () => void;
|
|
111
|
+
}
|
|
112
|
+
declare function VideoInfoPanel({ metadata, onClose }: VideoInfoPanelProps): react_jsx_runtime.JSX.Element | null;
|
|
113
|
+
|
|
114
|
+
interface ShortcutSettingsDialogProps {
|
|
115
|
+
shortcuts: ShortcutBinding[];
|
|
116
|
+
onSave: (bindings: ShortcutBinding[]) => void;
|
|
117
|
+
onClose: () => void;
|
|
118
|
+
}
|
|
119
|
+
declare function ShortcutSettingsDialog({ shortcuts, onSave, onClose, }: ShortcutSettingsDialogProps): react_jsx_runtime.JSX.Element;
|
|
120
|
+
|
|
121
|
+
declare function Toaster(): react_jsx_runtime.JSX.Element;
|
|
122
|
+
|
|
123
|
+
export { LightBirdPlayer, PlayerControls, PlayerErrorBoundary, PlayerErrorDisplay, PlaylistPanel, ShortcutSettingsDialog, SubtitleOverlay, Toaster, VideoInfoPanel, VideoOverlay };
|