@v360-tech/v360-player 1.0.1 → 1.2.1
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 +111 -9
- package/dist/v360-player.browser.js +374 -0
- package/dist/v360-player.js +298 -73
- package/package.json +21 -6
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
|
|
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
|
-
###
|
|
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
|
-
<!--
|
|
23
|
-
<
|
|
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
|
-
|
|
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
|
-
|
|
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
|
|