avbridge 2.8.2 → 2.8.3

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/CHANGELOG.md CHANGED
@@ -4,6 +4,18 @@ All notable changes to **avbridge.js** are documented here. The format follows
4
4
  [Keep a Changelog](https://keepachangelog.com/en/1.1.0/) and this project
5
5
  adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
6
6
 
7
+ ## [2.8.3]
8
+
9
+ ### Added
10
+
11
+ - **`showControls(durationMs?)` on `<avbridge-player>`.** Public method
12
+ to reveal the auto-hiding chrome (top toolbar + bottom controls)
13
+ and re-start the auto-hide timer. Intended for app-level "flash the
14
+ UI" moments like a carousel slide change or focus handoff — one call
15
+ instead of reaching into `data-controls-hidden`. Custom duration
16
+ overrides the default 3 s; pointer movement during the flash resets
17
+ the timer so there's no flicker if the user interacts mid-flash.
18
+
7
19
  ## [2.8.2]
8
20
 
9
21
  Small ergonomics release driven by downstream `<avbridge-player>`
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "avbridge",
3
- "version": "2.8.2",
3
+ "version": "2.8.3",
4
4
  "description": "Play and convert arbitrary video files in the browser. Native, remux, hybrid, fallback, and transcode — one API.",
5
5
  "license": "MIT",
6
6
  "author": "Keishi Hattori",
@@ -680,13 +680,29 @@ export class AvbridgePlayerElement extends HTMLElement {
680
680
 
681
681
  // ── Controls: auto-hide ────────────────────────────────────────────────
682
682
 
683
- private _showControls(): void {
683
+ /**
684
+ * Reveal the auto-hiding chrome (top toolbar + bottom controls) and
685
+ * re-start the auto-hide timer. Call this from app-level code to
686
+ * briefly surface the player UI — e.g. to confirm "you just swiped to
687
+ * this video" in a carousel, or to flash the title on focus change.
688
+ *
689
+ * @param durationMs How long the chrome stays visible before fading.
690
+ * Defaults to the player's normal 3 s auto-hide.
691
+ * Pointer movement or any other interaction resets
692
+ * the timer, so a user hovering during the flash
693
+ * sees no flicker.
694
+ */
695
+ showControls(durationMs?: number): void {
684
696
  this.removeAttribute("data-controls-hidden");
685
697
  this._toolbarTop.setAttribute("data-visible", "true");
686
- this._scheduleHide();
698
+ this._scheduleHide(durationMs);
699
+ }
700
+
701
+ private _showControls(): void {
702
+ this.showControls();
687
703
  }
688
704
 
689
- private _scheduleHide(): void {
705
+ private _scheduleHide(durationMs: number = CONTROLS_HIDE_MS): void {
690
706
  if (this._controlsTimer) clearTimeout(this._controlsTimer);
691
707
  if (this._state !== "playing" && this._state !== "buffering") return;
692
708
  if (this._settingsOpen) return;
@@ -695,7 +711,7 @@ export class AvbridgePlayerElement extends HTMLElement {
695
711
  this.setAttribute("data-controls-hidden", "");
696
712
  this._toolbarTop.setAttribute("data-visible", "false");
697
713
  }
698
- }, CONTROLS_HIDE_MS);
714
+ }, durationMs);
699
715
  }
700
716
 
701
717
  // Strategy is visible in Stats for Nerds, no badge in controls bar.