@v360-tech/v360-player 1.7.0 → 1.7.2
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 +11 -7
- package/dist/types/components/V360Player.d.ts +16 -2
- package/dist/v360-player.browser.js +78 -57
- package/dist/v360-player.js +248 -200
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -6,7 +6,7 @@ A lightweight, customizable HLS video player web component with built-in control
|
|
|
6
6
|
|
|
7
7
|
- HLS (HTTP Live Streaming) video playback
|
|
8
8
|
- Built-in controls with optimized icons
|
|
9
|
-
- Responsive design
|
|
9
|
+
- Responsive design
|
|
10
10
|
- Dynamic controls handling based on video background color (dark or light)
|
|
11
11
|
- Customizable playback speeds
|
|
12
12
|
- Time display options
|
|
@@ -44,9 +44,9 @@ import "@v360-tech/v360-player";
|
|
|
44
44
|
|
|
45
45
|
```html
|
|
46
46
|
<!-- Include from CDN (all dependencies bundled) -->
|
|
47
|
-
<script src="https://unpkg.com/@v360-tech/v360-player@1.
|
|
47
|
+
<script src="https://unpkg.com/@v360-tech/v360-player@1.7.1/dist/v360-player.browser.js"></script>
|
|
48
48
|
<!-- OR -->
|
|
49
|
-
<script src="https://cdn.jsdelivr.net/npm/@v360-tech/v360-player@1.
|
|
49
|
+
<script src="https://cdn.jsdelivr.net/npm/@v360-tech/v360-player@1.7.1/dist/v360-player.browser.js"></script>
|
|
50
50
|
|
|
51
51
|
<!-- Use immediately -->
|
|
52
52
|
<v360-player
|
|
@@ -71,7 +71,7 @@ import "@v360-tech/v360-player";
|
|
|
71
71
|
show-speed-control
|
|
72
72
|
playback-speeds="0.5,1,1.5,2"
|
|
73
73
|
default-speed="1"
|
|
74
|
-
progress-bar-style="
|
|
74
|
+
progress-bar-style="dual-layer"
|
|
75
75
|
background="dark"
|
|
76
76
|
auto-hide-controls
|
|
77
77
|
>
|
|
@@ -89,18 +89,23 @@ import "@v360-tech/v360-player";
|
|
|
89
89
|
| `show-time-display` | boolean | `false` | Show current time and duration | Present to enable (no value) |
|
|
90
90
|
| `show-speed-control` | boolean | `false` | Show playback speed control | Present to enable (no value) |
|
|
91
91
|
| `playback-speeds` | string | `"0.25,0.5,0.75,1,1.25,1.5,2"` | Comma-separated list of speeds | Comma-separated numbers |
|
|
92
|
-
| `default-speed` | string | `"1"` | Default playback speed
|
|
92
|
+
| `default-speed` | string | `"1"` | Default playback speed (see below) | One of the values from `playback-speeds` |
|
|
93
93
|
| `default-quality` | string | `"-1"` | Default HLS quality (-1 for auto) | `-1` or positive integer |
|
|
94
94
|
| `progress-bar-style` | string | `"none"` | Progress bar style variant | `"none"`, `"dual-layer"`, `"segments"`, `"minimal-wave"` |
|
|
95
95
|
| `background` | string | `dark` | Video background | `dark`, `light` |
|
|
96
96
|
| `auto-hide-controls` | boolean | `false` | Auto-hide controls (see below) | Present to enable (no value) |
|
|
97
|
+
| `debug` | boolean | `false` | Log diagnostics (see below) | Present to enable (no value) |
|
|
97
98
|
|
|
98
99
|
Boolean attributes are enabled by being present, for example `<v360-player auto-play>`. Any value, including `"false"`, still enables them; remove the attribute to disable.
|
|
99
100
|
|
|
100
|
-
Each boolean attribute also has a JS property that adds or removes it: `autoPlay`, `showTimeDisplay`, `showSpeedControl` and `
|
|
101
|
+
Each boolean attribute also has a JS property that adds or removes it: `autoPlay`, `showTimeDisplay`, `showSpeedControl`, `autoHideControls` and `debug`, for example `player.autoHideControls = false`. In a framework, bind the property, or pass `null`/`undefined` to leave the attribute out. Binding `false` to the attribute renders `="false"`, which enables it.
|
|
101
102
|
|
|
102
103
|
With `auto-hide-controls`, the controls are hidden until the mouse moves over the player and hide again after 3 seconds without movement or when the mouse leaves. On touch devices, a tap shows them for 3 seconds. They stay visible while the video is paused, while the mouse rests on them, and while a control has keyboard focus.
|
|
103
104
|
|
|
105
|
+
Invalid entries in `playback-speeds` are ignored. If `default-speed` is not one of the listed speeds, the player starts at 1x, or at the first listed speed when 1x is not listed.
|
|
106
|
+
|
|
107
|
+
`debug` is off by default. When on, the player logs its startup, HLS events, recovery attempts and autoplay results with `console.debug`. Without it, the player logs only one `console.error`, when playback finally fails; the player then shows "Video unavailable" over the poster.
|
|
108
|
+
|
|
104
109
|
## Build Types
|
|
105
110
|
|
|
106
111
|
This package provides two optimized builds:
|
|
@@ -286,7 +291,6 @@ The player uses:
|
|
|
286
291
|
- Progress bar with seek functionality
|
|
287
292
|
- Fullscreen mode support
|
|
288
293
|
- Dynamic controls handling based on video background color (dark or light)
|
|
289
|
-
- Dynamic aspect ratio handling
|
|
290
294
|
|
|
291
295
|
## License
|
|
292
296
|
|
|
@@ -9,6 +9,14 @@ export declare class V360Player extends HTMLElement {
|
|
|
9
9
|
private _hideControlsTimer?;
|
|
10
10
|
private _pointerOverControls;
|
|
11
11
|
private readonly controlsHideDelay;
|
|
12
|
+
private static readonly defaultSpeeds;
|
|
13
|
+
private static readonly minSpeed;
|
|
14
|
+
private static readonly maxSpeed;
|
|
15
|
+
private _failed;
|
|
16
|
+
private _manifestParsed;
|
|
17
|
+
private _networkRetried;
|
|
18
|
+
private _mediaRecoveries;
|
|
19
|
+
private _listenersStarted;
|
|
12
20
|
private isValidProgressBarStyle;
|
|
13
21
|
private readonly svgIcons;
|
|
14
22
|
constructor();
|
|
@@ -21,6 +29,10 @@ export declare class V360Player extends HTMLElement {
|
|
|
21
29
|
set showSpeedControl(value: boolean);
|
|
22
30
|
get autoHideControls(): boolean;
|
|
23
31
|
set autoHideControls(value: boolean);
|
|
32
|
+
get debug(): boolean;
|
|
33
|
+
set debug(value: boolean);
|
|
34
|
+
private log;
|
|
35
|
+
private fail;
|
|
24
36
|
private upgradeProperties;
|
|
25
37
|
private setupAutoHide;
|
|
26
38
|
private showControls;
|
|
@@ -29,18 +41,20 @@ export declare class V360Player extends HTMLElement {
|
|
|
29
41
|
static get observedAttributes(): string[];
|
|
30
42
|
attributeChangedCallback(name: string, _oldValue: string, newValue: string): void;
|
|
31
43
|
connectedCallback(): Promise<void>;
|
|
32
|
-
private setupProgressBarInteractions;
|
|
33
44
|
private renderProgressBar;
|
|
34
45
|
private render;
|
|
35
46
|
private initializePlayer;
|
|
36
47
|
private initializeHls;
|
|
48
|
+
private autoplay;
|
|
37
49
|
private startListeners;
|
|
38
50
|
private play;
|
|
39
51
|
private pause;
|
|
40
52
|
private forward;
|
|
41
53
|
private backward;
|
|
42
54
|
private toggleFullscreen;
|
|
43
|
-
private
|
|
55
|
+
private parseSpeeds;
|
|
56
|
+
private updatePlayPauseButton;
|
|
57
|
+
private renderSpeedLabel;
|
|
44
58
|
private formatTime;
|
|
45
59
|
private updateControlsColor;
|
|
46
60
|
disconnectedCallback(): void;
|