@v360-tech/v360-player 1.0.0 → 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,29 +1,65 @@
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
 
7
7
  - HLS (HTTP Live Streaming) video playback
8
- - Built-in controls with optimized PNG icons
8
+ - Built-in controls with optimized icons
9
9
  - Responsive design with aspect ratio support
10
+ - Dynamic controls handling based on video background color (dark or light)
10
11
  - Customizable playback speeds
11
12
  - Time display options
12
13
  - Progress bar with seek functionality
13
14
  - Fullscreen support
14
15
  - Cross-browser compatibility with native HLS fallback for Safari
15
16
 
16
- ## Usage
17
+ ## Installation & Usage
17
18
 
18
- ### 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
+ ```
19
30
 
20
31
  ```html
21
- <!-- Include the player -->
22
- <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
+ ```
23
59
 
24
- <!-- Basic usage -->
25
- <v360-player video-src="path/to/video.m3u8"></v360-player>
60
+ ### Advanced Usage Example
26
61
 
62
+ ```html
27
63
  <!-- Full-featured player -->
28
64
  <v360-player
29
65
  video-src="path/to/video.m3u8"
@@ -34,7 +70,9 @@ A lightweight, customizable HLS video player web component with built-in control
34
70
  show-speed-control
35
71
  playback-speeds="0.5,1,1.5,2"
36
72
  default-speed="1"
37
- default-quality="-1"
73
+ progress-bar-style="DualLayer"
74
+ background="dark"
75
+ aspect-ratio="16:9"
38
76
  >
39
77
  </v360-player>
40
78
  ```
@@ -56,6 +94,22 @@ A lightweight, customizable HLS video player web component with built-in control
56
94
  | `background` | string | `dark` | Video background | `dark`, `light` |
57
95
  | `aspect-ratio` | string | `"16:9"` | Aspect ratio of the player | Any valid ratio (e.g., `"16:9"`, `"4:3"`, `"1:1"`) |
58
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
+
59
113
  ## Examples
60
114
 
61
115
  ### Minimal Player
@@ -66,10 +120,59 @@ A lightweight, customizable HLS video player web component with built-in control
66
120
 
67
121
  ### Player with Time Display
68
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
+
69
170
  ```html
70
171
  <v360-player video-src="video.m3u8" show-time-display> </v360-player>
71
172
  ```
72
173
 
174
+ ````
175
+
73
176
  ### Full-Featured Player
74
177
 
75
178
  ```html
@@ -85,7 +188,7 @@ A lightweight, customizable HLS video player web component with built-in control
85
188
  progress-bar-style="dual-layer"
86
189
  >
87
190
  </v360-player>
88
- ```
191
+ ````
89
192
 
90
193
  ### Progress Bar Styles
91
194
 
@@ -189,10 +292,11 @@ The player uses:
189
292
  - HLS.js for video streaming in browsers without native HLS support
190
293
  - Web Components with Shadow DOM for style isolation
191
294
  - TypeScript for type safety
192
- - Optimized PNG icons for controls
295
+ - Optimized icons for controls
193
296
  - Custom controls with playback speed adjustment
194
297
  - Progress bar with seek functionality
195
298
  - Fullscreen mode support
299
+ - Dynamic controls handling based on video background color (dark or light)
196
300
  - Dynamic aspect ratio handling
197
301
 
198
302
  ## License
package/package.json CHANGED
@@ -1,11 +1,20 @@
1
1
  {
2
2
  "name": "@v360-tech/v360-player",
3
- "version": "1.0.0",
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
+ }