@glitchlab/react-video-player 0.1.1 → 1.0.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 +188 -43
- package/dist/index.cjs +3 -1
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.ts +55 -1
- package/dist/index.mjs +197 -195
- package/dist/index.mjs.map +1 -0
- package/dist/style.css +4 -1
- package/package.json +103 -86
- package/dist/src/HLSPlayer.d.ts +0 -5
- package/dist/src/VideoPlayerWrapper.d.ts +0 -5
- package/dist/src/index.d.ts +0 -3
- package/dist/src/types/index.d.ts +0 -35
- package/dist/src/utils/icons.d.ts +0 -12
- package/dist/tailwind.config.d.ts +0 -8
package/package.json
CHANGED
|
@@ -1,88 +1,105 @@
|
|
|
1
1
|
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
"
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
2
|
+
"name": "@glitchlab/react-video-player",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"description": "React video player with HLS support (hls.js), device-mode toggle, hover-to-play, and zero global CSS side-effects. Works with Next.js App Router and TypeScript.",
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"author": "im-fahad",
|
|
7
|
+
"type": "module",
|
|
8
|
+
"main": "./dist/index.cjs",
|
|
9
|
+
"module": "./dist/index.mjs",
|
|
10
|
+
"types": "./dist/index.d.ts",
|
|
11
|
+
"style": "./dist/style.css",
|
|
12
|
+
"files": [
|
|
13
|
+
"dist",
|
|
14
|
+
"README.md",
|
|
15
|
+
"LICENSE"
|
|
16
|
+
],
|
|
17
|
+
"exports": {
|
|
18
|
+
".": {
|
|
19
|
+
"types": "./dist/index.d.ts",
|
|
20
|
+
"import": "./dist/index.mjs",
|
|
21
|
+
"require": "./dist/index.cjs"
|
|
22
22
|
},
|
|
23
|
-
"
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
"
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
"
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
"
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
"
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
23
|
+
"./style.css": "./dist/style.css",
|
|
24
|
+
"./package.json": "./package.json"
|
|
25
|
+
},
|
|
26
|
+
"sideEffects": [
|
|
27
|
+
"**/*.css"
|
|
28
|
+
],
|
|
29
|
+
"engines": {
|
|
30
|
+
"node": ">=18"
|
|
31
|
+
},
|
|
32
|
+
"peerDependencies": {
|
|
33
|
+
"hls.js": ">=1",
|
|
34
|
+
"react": ">=18",
|
|
35
|
+
"react-dom": ">=18"
|
|
36
|
+
},
|
|
37
|
+
"dependencies": {
|
|
38
|
+
"clsx": "^2.1.1"
|
|
39
|
+
},
|
|
40
|
+
"devDependencies": {
|
|
41
|
+
"@eslint/js": "^10.0.1",
|
|
42
|
+
"@testing-library/jest-dom": "^6.6.3",
|
|
43
|
+
"@testing-library/react": "^16.1.0",
|
|
44
|
+
"@types/react": "^18",
|
|
45
|
+
"@types/react-dom": "^18",
|
|
46
|
+
"@typescript-eslint/eslint-plugin": "^8.56.1",
|
|
47
|
+
"@typescript-eslint/parser": "^8.56.1",
|
|
48
|
+
"@vitejs/plugin-react": "^4",
|
|
49
|
+
"eslint": "^10.0.2",
|
|
50
|
+
"eslint-config-prettier": "^10.1.8",
|
|
51
|
+
"eslint-plugin-import": "^2.32.0",
|
|
52
|
+
"eslint-plugin-react": "^7.37.5",
|
|
53
|
+
"eslint-plugin-react-hooks": "^7.0.1",
|
|
54
|
+
"hls.js": "^1.5.0",
|
|
55
|
+
"jsdom": "^25.0.1",
|
|
56
|
+
"react": "^18",
|
|
57
|
+
"react-dom": "^18",
|
|
58
|
+
"typescript": "^5",
|
|
59
|
+
"typescript-eslint": "^8.56.1",
|
|
60
|
+
"vite": "^5",
|
|
61
|
+
"vite-plugin-dts": "^3",
|
|
62
|
+
"vitest": "^2.1.8"
|
|
63
|
+
},
|
|
64
|
+
"repository": {
|
|
65
|
+
"type": "git",
|
|
66
|
+
"url": "git+https://github.com/im-fahad/react-video-player.git",
|
|
67
|
+
"directory": "packages/react-video-player"
|
|
68
|
+
},
|
|
69
|
+
"homepage": "https://github.com/im-fahad/react-video-player#readme",
|
|
70
|
+
"bugs": {
|
|
71
|
+
"url": "https://github.com/im-fahad/react-video-player/issues"
|
|
72
|
+
},
|
|
73
|
+
"keywords": [
|
|
74
|
+
"react",
|
|
75
|
+
"video",
|
|
76
|
+
"player",
|
|
77
|
+
"hls",
|
|
78
|
+
"hls.js",
|
|
79
|
+
"streaming",
|
|
80
|
+
"m3u8",
|
|
81
|
+
"video-player",
|
|
82
|
+
"react-player",
|
|
83
|
+
"nextjs",
|
|
84
|
+
"next-app-router",
|
|
85
|
+
"use-client",
|
|
86
|
+
"typescript",
|
|
87
|
+
"responsive",
|
|
88
|
+
"mobile",
|
|
89
|
+
"desktop",
|
|
90
|
+
"adaptive",
|
|
91
|
+
"overlay",
|
|
92
|
+
"hover-play",
|
|
93
|
+
"device-toggle",
|
|
94
|
+
"react-video-player",
|
|
95
|
+
"next-video-player",
|
|
96
|
+
"hls-video-player"
|
|
97
|
+
],
|
|
98
|
+
"scripts": {
|
|
99
|
+
"build": "vite build",
|
|
100
|
+
"build:watch": "vite build --watch",
|
|
101
|
+
"test": "vitest run",
|
|
102
|
+
"test:watch": "vitest",
|
|
103
|
+
"lint": "eslint src"
|
|
104
|
+
}
|
|
105
|
+
}
|
package/dist/src/HLSPlayer.d.ts
DELETED
package/dist/src/index.d.ts
DELETED
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
import { HlsConfig } from 'hls.js';
|
|
2
|
-
|
|
3
|
-
export type DeviceMode = "desktop" | "mobile";
|
|
4
|
-
type AspectRatio = `${number}/${number}`;
|
|
5
|
-
export type VideoPlayerWrapperProps = {
|
|
6
|
-
src: string;
|
|
7
|
-
poster?: string;
|
|
8
|
-
showDeviceToggle?: boolean;
|
|
9
|
-
defaultDevice?: DeviceMode;
|
|
10
|
-
hoverPlay?: boolean;
|
|
11
|
-
tooltipText?: string;
|
|
12
|
-
onClose?: () => void;
|
|
13
|
-
className?: string;
|
|
14
|
-
muted?: boolean;
|
|
15
|
-
loop?: boolean;
|
|
16
|
-
controls?: boolean;
|
|
17
|
-
frameMaxWidth?: {
|
|
18
|
-
desktop?: string;
|
|
19
|
-
mobile?: string;
|
|
20
|
-
};
|
|
21
|
-
aspectRatio?: {
|
|
22
|
-
desktop?: AspectRatio;
|
|
23
|
-
mobile?: AspectRatio;
|
|
24
|
-
};
|
|
25
|
-
};
|
|
26
|
-
export interface HLSPlayerProps extends React.VideoHTMLAttributes<HTMLVideoElement> {
|
|
27
|
-
src: string;
|
|
28
|
-
hlsConfig?: HlsConfig;
|
|
29
|
-
isHls?: boolean;
|
|
30
|
-
}
|
|
31
|
-
export interface HLSPlayerRef {
|
|
32
|
-
video: HTMLVideoElement | null;
|
|
33
|
-
cleanup: () => void;
|
|
34
|
-
}
|
|
35
|
-
export {};
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
export declare const IconDesktop: ({ className }: {
|
|
2
|
-
className?: string;
|
|
3
|
-
}) => import("react/jsx-runtime").JSX.Element;
|
|
4
|
-
export declare const IconMobile: ({ className }: {
|
|
5
|
-
className?: string;
|
|
6
|
-
}) => import("react/jsx-runtime").JSX.Element;
|
|
7
|
-
export declare const IconX: ({ className }: {
|
|
8
|
-
className?: string;
|
|
9
|
-
}) => import("react/jsx-runtime").JSX.Element;
|
|
10
|
-
export declare const IconPlay: ({ className }: {
|
|
11
|
-
className?: string;
|
|
12
|
-
}) => import("react/jsx-runtime").JSX.Element;
|