@v360-tech/v360-player 1.0.1 → 1.2.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 CHANGED
@@ -1,6 +1,6 @@
1
1
  # V360 Player
2
2
 
3
- A lightweight, customizable HLS video player web component with built-in controls and no external dependencies.
3
+ A lightweight, customizable HLS video player web component with built-in controls. Available for both modern bundlers and direct browser usage.
4
4
 
5
5
  ## Features
6
6
 
@@ -14,17 +14,52 @@ A lightweight, customizable HLS video player web component with built-in control
14
14
  - Fullscreen support
15
15
  - Cross-browser compatibility with native HLS fallback for Safari
16
16
 
17
- ## Usage
17
+ ## Installation & Usage
18
18
 
19
- ### Simple Integration
19
+ ### For Modern Bundlers (Vite, Webpack, etc.)
20
+
21
+ ```bash
22
+ # Install the package and its peer dependencies
23
+ npm install @v360-tech/v360-player hls.js jquery
24
+ ```
25
+
26
+ ```typescript
27
+ // Import in your TypeScript/JavaScript file
28
+ import "@v360-tech/v360-player";
29
+ ```
20
30
 
21
31
  ```html
22
- <!-- Include the player -->
23
- <script src="path/to/v360-player.js"></script>
32
+ <!-- Use in your HTML -->
33
+ <v360-player
34
+ video-src="path/to/video.m3u8"
35
+ poster-src="path/to/poster.jpg"
36
+ show-time-display
37
+ show-speed-control
38
+ >
39
+ </v360-player>
40
+ ```
41
+
42
+ ### For Direct Browser Usage
43
+
44
+ ```html
45
+ <!-- Include from CDN (all dependencies bundled) -->
46
+ <script src="https://unpkg.com/@v360-tech/v360-player@latest/dist/v360-player.browser.js"></script>
47
+ <!-- OR -->
48
+ <script src="https://cdn.jsdelivr.net/npm/@v360-tech/v360-player@latest/dist/v360-player.browser.js"></script>
49
+
50
+ <!-- Use immediately -->
51
+ <v360-player
52
+ video-src="path/to/video.m3u8"
53
+ poster-src="path/to/poster.jpg"
54
+ show-time-display
55
+ show-speed-control
56
+ >
57
+ </v360-player>
58
+ ```
24
59
 
25
- <!-- Basic usage -->
26
- <v360-player video-src="path/to/video.m3u8"></v360-player>
60
+ ### Advanced Usage Example
27
61
 
62
+ ```html
28
63
  <!-- Full-featured player -->
29
64
  <v360-player
30
65
  video-src="path/to/video.m3u8"
@@ -35,7 +70,9 @@ A lightweight, customizable HLS video player web component with built-in control
35
70
  show-speed-control
36
71
  playback-speeds="0.5,1,1.5,2"
37
72
  default-speed="1"
38
- default-quality="-1"
73
+ progress-bar-style="DualLayer"
74
+ background="dark"
75
+ aspect-ratio="16:9"
39
76
  >
40
77
  </v360-player>
41
78
  ```
@@ -57,6 +94,22 @@ A lightweight, customizable HLS video player web component with built-in control
57
94
  | `background` | string | `dark` | Video background | `dark`, `light` |
58
95
  | `aspect-ratio` | string | `"16:9"` | Aspect ratio of the player | Any valid ratio (e.g., `"16:9"`, `"4:3"`, `"1:1"`) |
59
96
 
97
+ ## Build Types
98
+
99
+ This package provides two optimized builds:
100
+
101
+ 1. **ES Module Build** (`v360-player.js`):
102
+
103
+ - For use with modern bundlers (Vite, Webpack, Rollup, etc.)
104
+ - External dependencies (hls.js, jquery) for better tree-shaking
105
+ - Smaller bundle size when used with bundlers
106
+
107
+ 2. **Browser Build** (`v360-player.browser.js`):
108
+ - For direct browser usage via CDN
109
+ - All dependencies bundled in
110
+ - No external dependencies required
111
+ - Ready to use with a simple script tag
112
+
60
113
  ## Examples
61
114
 
62
115
  ### Minimal Player
@@ -67,10 +120,59 @@ A lightweight, customizable HLS video player web component with built-in control
67
120
 
68
121
  ### Player with Time Display
69
122
 
123
+ ````html
124
+ ### Framework Usage Examples #### React/Next.js ```jsx import { useEffect } from
125
+ 'react'; import '@v360-tech/v360-player'; export default function VideoPlayer()
126
+ { return (
127
+ <v360-player
128
+ video-src="video.m3u8"
129
+ poster-src="poster.jpg"
130
+ show-time-display
131
+ show-speed-control
132
+ />
133
+ ); }
134
+ ````
135
+
136
+ #### Vue.js
137
+
138
+ ```vue
139
+ <template>
140
+ <v360-player
141
+ video-src="video.m3u8"
142
+ poster-src="poster.jpg"
143
+ show-time-display
144
+ show-speed-control
145
+ />
146
+ </template>
147
+
148
+ <script setup>
149
+ import "@v360-tech/v360-player";
150
+ </script>
151
+ ```
152
+
153
+ #### Svelte
154
+
155
+ ```svelte
156
+ <script>
157
+ import '@v360-tech/v360-player';
158
+ </script>
159
+
160
+ <v360-player
161
+ video-src="video.m3u8"
162
+ poster-src="poster.jpg"
163
+ show-time-display
164
+ show-speed-control
165
+ />
166
+ ```
167
+
168
+ ### With Time Display
169
+
70
170
  ```html
71
171
  <v360-player video-src="video.m3u8" show-time-display> </v360-player>
72
172
  ```
73
173
 
174
+ ````
175
+
74
176
  ### Full-Featured Player
75
177
 
76
178
  ```html
@@ -86,7 +188,7 @@ A lightweight, customizable HLS video player web component with built-in control
86
188
  progress-bar-style="dual-layer"
87
189
  >
88
190
  </v360-player>
89
- ```
191
+ ````
90
192
 
91
193
  ### Progress Bar Styles
92
194
 
package/package.json CHANGED
@@ -1,11 +1,20 @@
1
1
  {
2
2
  "name": "@v360-tech/v360-player",
3
- "version": "1.0.1",
3
+ "version": "1.2.0",
4
4
  "description": "A lightweight, customizable HLS video player web component with built-in controls",
5
5
  "type": "module",
6
- "main": "dist/v360-player.umd.js",
7
- "module": "dist/v360-player.es.js",
6
+ "main": "dist/v360-player.browser.js",
7
+ "module": "dist/v360-player.js",
8
8
  "types": "dist/types/main.d.ts",
9
+ "exports": {
10
+ ".": {
11
+ "types": "./dist/types/main.d.ts",
12
+ "browser": "./dist/v360-player.browser.js",
13
+ "import": "./dist/v360-player.js",
14
+ "require": "./dist/v360-player.browser.js",
15
+ "default": "./dist/v360-player.browser.js"
16
+ }
17
+ },
9
18
  "files": [
10
19
  "dist"
11
20
  ],
@@ -30,14 +39,20 @@
30
39
  "homepage": "https://github.com/v360tech/pro-movie-player#readme",
31
40
  "scripts": {
32
41
  "dev": "vite",
33
- "build": "tsc && vite build",
42
+ "build": "npm run build:es && npm run build:umd && tsc --emitDeclarationOnly",
43
+ "build:es": "BUILD_TARGET=es vite build",
44
+ "build:umd": "BUILD_TARGET=umd vite build --mode production",
34
45
  "preview": "vite preview",
35
46
  "prepare": "npm run build",
36
47
  "test": "echo \"No tests yet\"",
37
- "prepublishOnly": "npm run build"
48
+ "prepublishOnly": "npm run build",
49
+ "release:patch": "npm version patch && npm publish --access public",
50
+ "release:minor": "npm version minor && npm publish --access public",
51
+ "release:major": "npm version major && npm publish --access public"
38
52
  },
39
53
  "devDependencies": {
40
54
  "@types/jquery": "^3.5.33",
55
+ "@types/node": "^24.3.1",
41
56
  "typescript": "~5.8.3",
42
57
  "vite": "^7.1.2"
43
58
  },
@@ -45,4 +60,4 @@
45
60
  "hls.js": "^1.6.11",
46
61
  "jquery": "^3.7.1"
47
62
  }
48
- }
63
+ }