@zezosoft/react-player 0.0.5 → 0.0.7
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/dist/VideoPlayer/VideoPlayer.d.ts +4 -40
- package/dist/VideoPlayer/_components/SubtitleOverlay.d.ts +7 -0
- package/dist/VideoPlayer/hooks/index.d.ts +7 -0
- package/dist/VideoPlayer/hooks/useEpisodes.d.ts +3 -0
- package/dist/VideoPlayer/hooks/useIntroSkip.d.ts +5 -0
- package/dist/VideoPlayer/hooks/useSubtitleStyling.d.ts +10 -0
- package/dist/VideoPlayer/hooks/useSubtitles.d.ts +2 -0
- package/dist/VideoPlayer/hooks/useVideoEvents.d.ts +10 -0
- package/dist/VideoPlayer/hooks/useVideoSource.d.ts +1 -0
- package/dist/VideoPlayer/hooks/useVideoTracking.d.ts +2 -0
- package/dist/VideoPlayer/types/VideoPlayerTypes.d.ts +49 -0
- package/dist/VideoPlayer/utils/index.d.ts +6 -6
- package/dist/components/ui/Popover.d.ts +2 -0
- package/dist/components/ui/Settings.d.ts +6 -0
- package/dist/components/ui/tooltip.d.ts +1 -1
- package/dist/index.d.ts +3 -0
- package/dist/index.js +660 -252
- package/dist/store/VideoState.d.ts +1 -73
- package/dist/store/index.d.ts +3 -0
- package/dist/store/slices/episodesSlice.d.ts +5 -0
- package/dist/store/slices/index.d.ts +9 -0
- package/dist/store/slices/introSlice.d.ts +5 -0
- package/dist/store/slices/resetSlice.d.ts +5 -0
- package/dist/store/slices/subtitlesSlice.d.ts +5 -0
- package/dist/store/slices/videoControlsSlice.d.ts +5 -0
- package/dist/store/slices/videoPlaybackSlice.d.ts +5 -0
- package/dist/store/slices/videoQualitySlice.d.ts +5 -0
- package/dist/store/slices/videoRefsSlice.d.ts +5 -0
- package/dist/store/slices/videoTimingSlice.d.ts +5 -0
- package/dist/store/types/StoreTypes.d.ts +78 -0
- package/package.json +10 -8
|
@@ -1,74 +1,2 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { Dispatch, SetStateAction } from "react";
|
|
3
|
-
interface VideoState {
|
|
4
|
-
videoRef: HTMLVideoElement | null;
|
|
5
|
-
setVideoRef: (ref: HTMLVideoElement) => void;
|
|
6
|
-
playing: boolean | ((prevState: boolean) => boolean);
|
|
7
|
-
setPlaying: Dispatch<SetStateAction<boolean>>;
|
|
8
|
-
videoWrapperRef: HTMLDivElement | null;
|
|
9
|
-
setVideoWrapperRef: (ref: HTMLDivElement) => void;
|
|
10
|
-
isBuffering?: boolean;
|
|
11
|
-
setIsBuffering: (isBuffering: boolean) => void;
|
|
12
|
-
isPlaying: boolean;
|
|
13
|
-
setIsPlaying: (isPlaying: boolean) => void;
|
|
14
|
-
muted: boolean;
|
|
15
|
-
setMuted: (muted: boolean) => void;
|
|
16
|
-
volume: number;
|
|
17
|
-
setVolume: (volume: number) => void;
|
|
18
|
-
controls: boolean;
|
|
19
|
-
setControls: (controls: boolean) => void;
|
|
20
|
-
currentTime: number;
|
|
21
|
-
setCurrentTime: (currentTime: number) => void;
|
|
22
|
-
duration: number;
|
|
23
|
-
setDuration: (duration: number) => void;
|
|
24
|
-
isFullscreen: boolean;
|
|
25
|
-
setIsFullscreen: (isFullscreen: boolean) => void;
|
|
26
|
-
hlsInstance?: Hls;
|
|
27
|
-
setHlsInstance: (hlsInstance: Hls) => void;
|
|
28
|
-
qualityLevels?: Hls["levels"];
|
|
29
|
-
setQualityLevels: (qualityLevels: Hls["levels"]) => void;
|
|
30
|
-
activeQuality?: string;
|
|
31
|
-
setActiveQuality: (activeQuality: string) => void;
|
|
32
|
-
activeSubtitle?: {
|
|
33
|
-
lang: string;
|
|
34
|
-
label: string;
|
|
35
|
-
url: string;
|
|
36
|
-
} | null;
|
|
37
|
-
setActiveSubtitle: (subtitle: {
|
|
38
|
-
lang: string;
|
|
39
|
-
label: string;
|
|
40
|
-
url: string;
|
|
41
|
-
} | null) => void;
|
|
42
|
-
subtitles: {
|
|
43
|
-
lang: string;
|
|
44
|
-
label: string;
|
|
45
|
-
url: string;
|
|
46
|
-
}[];
|
|
47
|
-
setSubtitles: (subtitles: {
|
|
48
|
-
lang: string;
|
|
49
|
-
label: string;
|
|
50
|
-
url: string;
|
|
51
|
-
}[]) => void;
|
|
52
|
-
showIntroSkip: boolean;
|
|
53
|
-
setShowIntroSkip: (show: boolean) => void;
|
|
54
|
-
autoPlayNext: boolean;
|
|
55
|
-
setAutoPlayNext: (value: boolean) => void;
|
|
56
|
-
episodeList: {
|
|
57
|
-
id: number;
|
|
58
|
-
title: string;
|
|
59
|
-
url: string;
|
|
60
|
-
}[];
|
|
61
|
-
setEpisodeList: (list: {
|
|
62
|
-
id: number;
|
|
63
|
-
title: string;
|
|
64
|
-
url: string;
|
|
65
|
-
}[]) => void;
|
|
66
|
-
currentEpisodeIndex: number;
|
|
67
|
-
setCurrentEpisodeIndex: (index: number) => void;
|
|
68
|
-
showCountdown: boolean;
|
|
69
|
-
setShowCountdown: (show: boolean) => void;
|
|
70
|
-
countdownTime: number;
|
|
71
|
-
setCountdownTime: (time: number) => void;
|
|
72
|
-
}
|
|
1
|
+
import { VideoState } from "./types/StoreTypes";
|
|
73
2
|
export declare const useVideoStore: import("zustand").UseBoundStore<import("zustand").StoreApi<VideoState>>;
|
|
74
|
-
export {};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export { createVideoRefsSlice } from "./videoRefsSlice";
|
|
2
|
+
export { createVideoPlaybackSlice } from "./videoPlaybackSlice";
|
|
3
|
+
export { createVideoTimingSlice } from "./videoTimingSlice";
|
|
4
|
+
export { createVideoControlsSlice } from "./videoControlsSlice";
|
|
5
|
+
export { createVideoQualitySlice } from "./videoQualitySlice";
|
|
6
|
+
export { createSubtitlesSlice } from "./subtitlesSlice";
|
|
7
|
+
export { createEpisodesSlice } from "./episodesSlice";
|
|
8
|
+
export { createIntroSlice } from "./introSlice";
|
|
9
|
+
export { createResetSlice } from "./resetSlice";
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
import Hls from "hls.js";
|
|
2
|
+
export interface VideoRefsState {
|
|
3
|
+
videoRef: HTMLVideoElement | null;
|
|
4
|
+
setVideoRef: (ref: HTMLVideoElement) => void;
|
|
5
|
+
videoWrapperRef: HTMLDivElement | null;
|
|
6
|
+
setVideoWrapperRef: (ref: HTMLDivElement) => void;
|
|
7
|
+
}
|
|
8
|
+
export interface VideoPlaybackState {
|
|
9
|
+
playing: boolean;
|
|
10
|
+
setPlaying: (playing: boolean) => void;
|
|
11
|
+
isBuffering: boolean;
|
|
12
|
+
setIsBuffering: (isBuffering: boolean) => void;
|
|
13
|
+
isPlaying: boolean;
|
|
14
|
+
setIsPlaying: (isPlaying: boolean) => void;
|
|
15
|
+
muted: boolean;
|
|
16
|
+
setMuted: (muted: boolean) => void;
|
|
17
|
+
volume: number;
|
|
18
|
+
setVolume: (volume: number) => void;
|
|
19
|
+
}
|
|
20
|
+
export interface VideoTimingState {
|
|
21
|
+
currentTime: number;
|
|
22
|
+
setCurrentTime: (currentTime: number) => void;
|
|
23
|
+
duration: number;
|
|
24
|
+
setDuration: (duration: number) => void;
|
|
25
|
+
bufferedProgress: number;
|
|
26
|
+
setBufferedProgress: (progress: number) => void;
|
|
27
|
+
}
|
|
28
|
+
export interface VideoControlsState {
|
|
29
|
+
controls: boolean;
|
|
30
|
+
setControls: (controls: boolean) => void;
|
|
31
|
+
isFullscreen: boolean;
|
|
32
|
+
setIsFullscreen: (isFullscreen: boolean) => void;
|
|
33
|
+
}
|
|
34
|
+
export interface VideoQualityState {
|
|
35
|
+
hlsInstance?: Hls;
|
|
36
|
+
setHlsInstance: (hlsInstance: Hls) => void;
|
|
37
|
+
qualityLevels?: Hls["levels"];
|
|
38
|
+
setQualityLevels: (qualityLevels: Hls["levels"]) => void;
|
|
39
|
+
activeQuality: string;
|
|
40
|
+
setActiveQuality: (activeQuality: string) => void;
|
|
41
|
+
}
|
|
42
|
+
export interface SubtitleTrack {
|
|
43
|
+
lang: string;
|
|
44
|
+
label: string;
|
|
45
|
+
url: string;
|
|
46
|
+
}
|
|
47
|
+
export interface SubtitlesState {
|
|
48
|
+
activeSubtitle: SubtitleTrack | null;
|
|
49
|
+
setActiveSubtitle: (subtitle: SubtitleTrack | null) => void;
|
|
50
|
+
subtitles: SubtitleTrack[];
|
|
51
|
+
setSubtitles: (subtitles: SubtitleTrack[]) => void;
|
|
52
|
+
}
|
|
53
|
+
export interface Episode {
|
|
54
|
+
id: number;
|
|
55
|
+
title: string;
|
|
56
|
+
url: string;
|
|
57
|
+
}
|
|
58
|
+
export interface EpisodesState {
|
|
59
|
+
episodeList: Episode[];
|
|
60
|
+
setEpisodeList: (list: Episode[]) => void;
|
|
61
|
+
currentEpisodeIndex: number;
|
|
62
|
+
setCurrentEpisodeIndex: (index: number) => void;
|
|
63
|
+
showCountdown: boolean;
|
|
64
|
+
setShowCountdown: (show: boolean) => void;
|
|
65
|
+
countdownTime: number;
|
|
66
|
+
setCountdownTime: (time: number) => void;
|
|
67
|
+
autoPlayNext: boolean;
|
|
68
|
+
setAutoPlayNext: (value: boolean) => void;
|
|
69
|
+
}
|
|
70
|
+
export interface IntroState {
|
|
71
|
+
showIntroSkip: boolean;
|
|
72
|
+
setShowIntroSkip: (show: boolean) => void;
|
|
73
|
+
}
|
|
74
|
+
export interface StoreResetState {
|
|
75
|
+
resetStore: () => void;
|
|
76
|
+
}
|
|
77
|
+
export interface VideoState extends VideoRefsState, VideoPlaybackState, VideoTimingState, VideoControlsState, VideoQualityState, SubtitlesState, EpisodesState, IntroState, StoreResetState {
|
|
78
|
+
}
|
package/package.json
CHANGED
|
@@ -1,9 +1,14 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zezosoft/react-player",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.7",
|
|
4
4
|
"main": "dist/index.js",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
7
|
+
"scripts": {
|
|
8
|
+
"build": "npx rollup -c",
|
|
9
|
+
"dev": "npx rollup -c -w",
|
|
10
|
+
"prepare": "npm run build"
|
|
11
|
+
},
|
|
7
12
|
"files": [
|
|
8
13
|
"dist"
|
|
9
14
|
],
|
|
@@ -31,8 +36,8 @@
|
|
|
31
36
|
"devDependencies": {
|
|
32
37
|
"@rollup/plugin-typescript": "^12.1.2",
|
|
33
38
|
"@tailwindcss/postcss": "^4.0.14",
|
|
34
|
-
"@types/react": "^19.0.10",
|
|
35
39
|
"@types/node": "^24.4.0",
|
|
40
|
+
"@types/react": "^19.0.10",
|
|
36
41
|
"hls.js": "^1.5.20",
|
|
37
42
|
"lucide-react": "^0.481.0",
|
|
38
43
|
"postcss": "^8.5.3",
|
|
@@ -52,10 +57,7 @@
|
|
|
52
57
|
"zustand": "^5.0.3"
|
|
53
58
|
},
|
|
54
59
|
"dependencies": {
|
|
55
|
-
"react-icons": "^5.5.0"
|
|
56
|
-
|
|
57
|
-
"scripts": {
|
|
58
|
-
"build": "npx rollup -c",
|
|
59
|
-
"dev": "npx rollup -c -w"
|
|
60
|
+
"react-icons": "^5.5.0",
|
|
61
|
+
"screenfull": "^6.0.2"
|
|
60
62
|
}
|
|
61
|
-
}
|
|
63
|
+
}
|