@v360-tech/v360-player 1.4.15 → 1.7.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
@@ -12,6 +12,7 @@ A lightweight, customizable HLS video player web component with built-in control
12
12
  - Time display options
13
13
  - Progress bar with seek functionality
14
14
  - Fullscreen support
15
+ - Optional auto-hiding controls that appear on mouse movement or tap, and stay up while paused
15
16
  - Cross-browser compatibility with native HLS fallback for Safari
16
17
 
17
18
  ## Installation & Usage
@@ -20,7 +21,7 @@ A lightweight, customizable HLS video player web component with built-in control
20
21
 
21
22
  ```bash
22
23
  # Install the package and its peer dependencies
23
- npm install @v360-tech/v360-player hls.js jquery
24
+ yarn add @v360-tech/v360-player hls.js jquery
24
25
  ```
25
26
 
26
27
  ```typescript
@@ -72,6 +73,7 @@ import "@v360-tech/v360-player";
72
73
  default-speed="1"
73
74
  progress-bar-style="DualLayer"
74
75
  background="dark"
76
+ auto-hide-controls
75
77
  >
76
78
  </v360-player>
77
79
  ```
@@ -83,14 +85,21 @@ import "@v360-tech/v360-player";
83
85
  | `video-src` | string | required | URL to the HLS (.m3u8) video stream | Any valid URL |
84
86
  | `poster-src` | string | `""` | URL to the poster image | Any valid URL |
85
87
  | `width` | string | `"100%"` | Width of the video player | CSS width value (e.g., `"100%"`, `"800px"`) |
86
- | `auto-play` | boolean | `false` | Enable autoplay | `true`, `false` |
87
- | `show-time-display` | boolean | `false` | Show current time and duration | `true`, `false` |
88
- | `show-speed-control` | boolean | `false` | Show playback speed control | `true`, `false` |
88
+ | `auto-play` | boolean | `false` | Enable autoplay | Present to enable (no value) |
89
+ | `show-time-display` | boolean | `false` | Show current time and duration | Present to enable (no value) |
90
+ | `show-speed-control` | boolean | `false` | Show playback speed control | Present to enable (no value) |
89
91
  | `playback-speeds` | string | `"0.25,0.5,0.75,1,1.25,1.5,2"` | Comma-separated list of speeds | Comma-separated numbers |
90
92
  | `default-speed` | string | `"1"` | Default playback speed | One of the values from `playback-speeds` |
91
93
  | `default-quality` | string | `"-1"` | Default HLS quality (-1 for auto) | `-1` or positive integer |
92
94
  | `progress-bar-style` | string | `"none"` | Progress bar style variant | `"none"`, `"dual-layer"`, `"segments"`, `"minimal-wave"` |
93
95
  | `background` | string | `dark` | Video background | `dark`, `light` |
96
+ | `auto-hide-controls` | boolean | `false` | Auto-hide controls (see below) | Present to enable (no value) |
97
+
98
+ 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
+ Each boolean attribute also has a JS property that adds or removes it: `autoPlay`, `showTimeDisplay`, `showSpeedControl` and `autoHideControls`, 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
+ 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.
94
103
 
95
104
  ## Build Types
96
105
 
@@ -250,19 +259,19 @@ cd v360-player
250
259
  2. Install dependencies
251
260
 
252
261
  ```bash
253
- npm install
262
+ yarn install
254
263
  ```
255
264
 
256
265
  3. Start development server
257
266
 
258
267
  ```bash
259
- npm run dev
268
+ yarn dev
260
269
  ```
261
270
 
262
271
  4. Build for production
263
272
 
264
273
  ```bash
265
- npm run build
274
+ yarn build
266
275
  ```
267
276
 
268
277
  ## Technical Details
@@ -0,0 +1,4 @@
1
+ export declare const customHeaderKey: "X-Jewel-Studio";
2
+ export declare const customHeaderValue: "69d2c1660df6540944e25eb708fb252724ab27fb";
3
+ export type CustomHeaderKey = typeof customHeaderKey;
4
+ export type CustomHeaderValue = typeof customHeaderValue;
@@ -0,0 +1,47 @@
1
+ export declare class V360Player extends HTMLElement {
2
+ private progressBarStyle;
3
+ private _hls?;
4
+ private _videoPlayer?;
5
+ private background;
6
+ private _autoPlay;
7
+ private _streamLoaded;
8
+ private _startLevel;
9
+ private _hideControlsTimer?;
10
+ private _pointerOverControls;
11
+ private readonly controlsHideDelay;
12
+ private isValidProgressBarStyle;
13
+ private readonly svgIcons;
14
+ constructor();
15
+ private static readonly booleanProperties;
16
+ get autoPlay(): boolean;
17
+ set autoPlay(value: boolean);
18
+ get showTimeDisplay(): boolean;
19
+ set showTimeDisplay(value: boolean);
20
+ get showSpeedControl(): boolean;
21
+ set showSpeedControl(value: boolean);
22
+ get autoHideControls(): boolean;
23
+ set autoHideControls(value: boolean);
24
+ private upgradeProperties;
25
+ private setupAutoHide;
26
+ private showControls;
27
+ private scheduleControlsHide;
28
+ private hideControls;
29
+ static get observedAttributes(): string[];
30
+ attributeChangedCallback(name: string, _oldValue: string, newValue: string): void;
31
+ connectedCallback(): Promise<void>;
32
+ private setupProgressBarInteractions;
33
+ private renderProgressBar;
34
+ private render;
35
+ private initializePlayer;
36
+ private initializeHls;
37
+ private startListeners;
38
+ private play;
39
+ private pause;
40
+ private forward;
41
+ private backward;
42
+ private toggleFullscreen;
43
+ private getSpeedIcon;
44
+ private formatTime;
45
+ private updateControlsColor;
46
+ disconnectedCallback(): void;
47
+ }
@@ -0,0 +1,11 @@
1
+ export declare const icons: {
2
+ play: string;
3
+ pause: string;
4
+ forward: string;
5
+ backward: string;
6
+ fullscreen: string;
7
+ 'speed-0.50': string;
8
+ 'speed-1.00': string;
9
+ 'speed-1.50': string;
10
+ 'speed-2.00': string;
11
+ };
@@ -0,0 +1,3 @@
1
+ import './style.css';
2
+ import './components/V360Player';
3
+ export { V360Player } from './components/V360Player';
@@ -0,0 +1,13 @@
1
+ export declare const ProgressBarStyle: {
2
+ readonly None: "none";
3
+ readonly DualLayer: "dual-layer";
4
+ readonly Segments: "segments";
5
+ readonly MinimalWave: "minimal-wave";
6
+ };
7
+ export type ProgressBarStyle = typeof ProgressBarStyle[keyof typeof ProgressBarStyle];
8
+ export declare const progressBarStyles: {
9
+ none: string;
10
+ "dual-layer": string;
11
+ segments: string;
12
+ "minimal-wave": string;
13
+ };