@zezosoft/react-player 0.0.3 → 0.0.4
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 +124 -23
- package/dist/VideoPlayer/VideoPlayer.d.ts +22 -2
- package/dist/components/ui/FullScreenToggle.d.ts +8 -0
- package/dist/components/ui/PiPictureInPictureToggle.d.ts +7 -0
- package/dist/components/ui/Popover.d.ts +4 -2
- package/dist/components/ui/VideoActionButton.d.ts +10 -0
- package/dist/components/ui/tooltip.d.ts +1 -0
- package/dist/index.js +485 -119
- package/dist/store/VideoState.d.ts +53 -4
- package/package.json +11 -8
|
@@ -1,25 +1,74 @@
|
|
|
1
1
|
import Hls from "hls.js";
|
|
2
|
+
import { Dispatch, SetStateAction } from "react";
|
|
2
3
|
interface VideoState {
|
|
3
4
|
videoRef: HTMLVideoElement | null;
|
|
4
5
|
setVideoRef: (ref: HTMLVideoElement) => void;
|
|
6
|
+
playing: boolean | ((prevState: boolean) => boolean);
|
|
7
|
+
setPlaying: Dispatch<SetStateAction<boolean>>;
|
|
5
8
|
videoWrapperRef: HTMLDivElement | null;
|
|
6
9
|
setVideoWrapperRef: (ref: HTMLDivElement) => void;
|
|
10
|
+
isBuffering?: boolean;
|
|
11
|
+
setIsBuffering: (isBuffering: boolean) => void;
|
|
7
12
|
isPlaying: boolean;
|
|
8
13
|
setIsPlaying: (isPlaying: boolean) => void;
|
|
14
|
+
muted: boolean;
|
|
15
|
+
setMuted: (muted: boolean) => void;
|
|
16
|
+
volume: number;
|
|
17
|
+
setVolume: (volume: number) => void;
|
|
9
18
|
controls: boolean;
|
|
10
19
|
setControls: (controls: boolean) => void;
|
|
11
20
|
currentTime: number;
|
|
12
21
|
setCurrentTime: (currentTime: number) => void;
|
|
22
|
+
duration: number;
|
|
23
|
+
setDuration: (duration: number) => void;
|
|
24
|
+
isFullscreen: boolean;
|
|
25
|
+
setIsFullscreen: (isFullscreen: boolean) => void;
|
|
13
26
|
hlsInstance?: Hls;
|
|
14
27
|
setHlsInstance: (hlsInstance: Hls) => void;
|
|
15
28
|
qualityLevels?: Hls["levels"];
|
|
16
29
|
setQualityLevels: (qualityLevels: Hls["levels"]) => void;
|
|
17
30
|
activeQuality?: string;
|
|
18
31
|
setActiveQuality: (activeQuality: string) => void;
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
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;
|
|
23
72
|
}
|
|
24
73
|
export declare const useVideoStore: import("zustand").UseBoundStore<import("zustand").StoreApi<VideoState>>;
|
|
25
74
|
export {};
|
package/package.json
CHANGED
|
@@ -1,20 +1,15 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zezosoft/react-player",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.4",
|
|
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
|
-
},
|
|
12
7
|
"files": [
|
|
13
8
|
"dist"
|
|
14
9
|
],
|
|
15
10
|
"repository": {
|
|
16
11
|
"type": "git",
|
|
17
|
-
"url": "https://github.com/Zezo-Soft/react-player"
|
|
12
|
+
"url": "git+https://github.com/Zezo-Soft/react-player.git"
|
|
18
13
|
},
|
|
19
14
|
"keywords": [
|
|
20
15
|
"video",
|
|
@@ -37,6 +32,7 @@
|
|
|
37
32
|
"@rollup/plugin-typescript": "^12.1.2",
|
|
38
33
|
"@tailwindcss/postcss": "^4.0.14",
|
|
39
34
|
"@types/react": "^19.0.10",
|
|
35
|
+
"@types/node": "^24.4.0",
|
|
40
36
|
"hls.js": "^1.5.20",
|
|
41
37
|
"lucide-react": "^0.481.0",
|
|
42
38
|
"postcss": "^8.5.3",
|
|
@@ -54,5 +50,12 @@
|
|
|
54
50
|
"react": "^19.0.0",
|
|
55
51
|
"react-dom": "^19.0.0",
|
|
56
52
|
"zustand": "^5.0.3"
|
|
53
|
+
},
|
|
54
|
+
"dependencies": {
|
|
55
|
+
"react-icons": "^5.5.0"
|
|
56
|
+
},
|
|
57
|
+
"scripts": {
|
|
58
|
+
"build": "npx rollup -c",
|
|
59
|
+
"dev": "npx rollup -c -w"
|
|
57
60
|
}
|
|
58
|
-
}
|
|
61
|
+
}
|