@v360-tech/v360-player 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/README.md ADDED
@@ -0,0 +1,200 @@
1
+ # V360 Player
2
+
3
+ A lightweight, customizable HLS video player web component with built-in controls and no external dependencies.
4
+
5
+ ## Features
6
+
7
+ - HLS (HTTP Live Streaming) video playback
8
+ - Built-in controls with optimized PNG icons
9
+ - Responsive design with aspect ratio support
10
+ - Customizable playback speeds
11
+ - Time display options
12
+ - Progress bar with seek functionality
13
+ - Fullscreen support
14
+ - Cross-browser compatibility with native HLS fallback for Safari
15
+
16
+ ## Usage
17
+
18
+ ### Simple Integration
19
+
20
+ ```html
21
+ <!-- Include the player -->
22
+ <script src="path/to/v360-player.js"></script>
23
+
24
+ <!-- Basic usage -->
25
+ <v360-player video-src="path/to/video.m3u8"></v360-player>
26
+
27
+ <!-- Full-featured player -->
28
+ <v360-player
29
+ video-src="path/to/video.m3u8"
30
+ poster-src="path/to/poster.jpg"
31
+ width="720px"
32
+ auto-play
33
+ show-time-display
34
+ show-speed-control
35
+ playback-speeds="0.5,1,1.5,2"
36
+ default-speed="1"
37
+ default-quality="-1"
38
+ >
39
+ </v360-player>
40
+ ```
41
+
42
+ ### Properties
43
+
44
+ | Property | Type | Default | Description | Possible Values |
45
+ | -------------------- | ------- | ------------------------------ | ----------------------------------- | -------------------------------------------------------- |
46
+ | `video-src` | string | required | URL to the HLS (.m3u8) video stream | Any valid URL |
47
+ | `poster-src` | string | `""` | URL to the poster image | Any valid URL |
48
+ | `width` | string | `"100%"` | Width of the video player | CSS width value (e.g., `"100%"`, `"800px"`) |
49
+ | `auto-play` | boolean | `false` | Enable autoplay | `true`, `false` |
50
+ | `show-time-display` | boolean | `false` | Show current time and duration | `true`, `false` |
51
+ | `show-speed-control` | boolean | `false` | Show playback speed control | `true`, `false` |
52
+ | `playback-speeds` | string | `"0.25,0.5,0.75,1,1.25,1.5,2"` | Comma-separated list of speeds | Comma-separated numbers |
53
+ | `default-speed` | string | `"1"` | Default playback speed | One of the values from `playback-speeds` |
54
+ | `default-quality` | string | `"-1"` | Default HLS quality (-1 for auto) | `-1` or positive integer |
55
+ | `progress-bar-style` | string | `"none"` | Progress bar style variant | `"none"`, `"dual-layer"`, `"segments"`, `"minimal-wave"` |
56
+ | `background` | string | `dark` | Video background | `dark`, `light` |
57
+ | `aspect-ratio` | string | `"16:9"` | Aspect ratio of the player | Any valid ratio (e.g., `"16:9"`, `"4:3"`, `"1:1"`) |
58
+
59
+ ## Examples
60
+
61
+ ### Minimal Player
62
+
63
+ ```html
64
+ <v360-player video-src="video.m3u8"></v360-player>
65
+ ```
66
+
67
+ ### Player with Time Display
68
+
69
+ ```html
70
+ <v360-player video-src="video.m3u8" show-time-display> </v360-player>
71
+ ```
72
+
73
+ ### Full-Featured Player
74
+
75
+ ```html
76
+ <v360-player
77
+ video-src="video.m3u8"
78
+ poster-src="poster.jpg"
79
+ width="800px"
80
+ auto-play
81
+ show-time-display
82
+ show-speed-control
83
+ playback-speeds="0.5,1,1.5,2"
84
+ default-speed="1"
85
+ progress-bar-style="dual-layer"
86
+ >
87
+ </v360-player>
88
+ ```
89
+
90
+ ### Progress Bar Styles
91
+
92
+ The player offers different progress bar styles through the `progress-bar-style` property:
93
+
94
+ #### none (default)
95
+
96
+ Basic progress bar with simple fill indicator.
97
+
98
+ ```html
99
+ <v360-player video-src="video.m3u8" progress-bar-style="none"></v360-player>
100
+ ```
101
+
102
+ #### dual-layer
103
+
104
+ Shows buffer progress and includes a draggable handle.
105
+
106
+ ```html
107
+ <v360-player
108
+ video-src="video.m3u8"
109
+ progress-bar-style="dual-layer"
110
+ ></v360-player>
111
+ ```
112
+
113
+ #### segments
114
+
115
+ Divides the progress into clickable segments.
116
+
117
+ ```html
118
+ <v360-player video-src="video.m3u8" progress-bar-style="segments"></v360-player>
119
+ ```
120
+
121
+ #### minimal-wave
122
+
123
+ Clean style with an animated wave indicator.
124
+
125
+ ```html
126
+ <v360-player
127
+ video-src="video.m3u8"
128
+ progress-bar-style="minimal-wave"
129
+ ></v360-player>
130
+ ```
131
+
132
+ #### chapters
133
+
134
+ Includes chapter markers with labels.
135
+
136
+ ```html
137
+ <v360-player video-src="video.m3u8" progress-bar-style="chapters"></v360-player>
138
+ ```
139
+
140
+ #### floating-preview
141
+
142
+ Shows a preview thumbnail on hover.
143
+
144
+ ```html
145
+ <v360-player
146
+ video-src="video.m3u8"
147
+ progress-bar-style="floating-preview"
148
+ ></v360-player>
149
+ ```
150
+
151
+ ## Browser Support
152
+
153
+ - Chrome/Edge (latest)
154
+ - Firefox (latest)
155
+ - Safari 14+ (uses native HLS)
156
+ - Mobile browsers with HLS support
157
+
158
+ ## Development
159
+
160
+ 1. Clone the repository
161
+
162
+ ```bash
163
+ git clone <repository-url>
164
+ cd v360-player
165
+ ```
166
+
167
+ 2. Install dependencies
168
+
169
+ ```bash
170
+ npm install
171
+ ```
172
+
173
+ 3. Start development server
174
+
175
+ ```bash
176
+ npm run dev
177
+ ```
178
+
179
+ 4. Build for production
180
+
181
+ ```bash
182
+ npm run build
183
+ ```
184
+
185
+ ## Technical Details
186
+
187
+ The player uses:
188
+
189
+ - HLS.js for video streaming in browsers without native HLS support
190
+ - Web Components with Shadow DOM for style isolation
191
+ - TypeScript for type safety
192
+ - Optimized PNG icons for controls
193
+ - Custom controls with playback speed adjustment
194
+ - Progress bar with seek functionality
195
+ - Fullscreen mode support
196
+ - Dynamic aspect ratio handling
197
+
198
+ ## License
199
+
200
+ MIT License
File without changes
@@ -0,0 +1 @@
1
+ :root{font-family:system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen,Ubuntu,Cantarell,sans-serif;line-height:1.5;font-weight:400}body{margin:0;display:flex;place-items:center;min-width:320px;min-height:100vh}#app{max-width:1280px;margin:0 auto;padding:2rem;text-align:center}