avbridge 2.12.1 → 2.13.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/CHANGELOG.md +101 -0
- package/README.md +33 -0
- package/dist/{chunk-UM6WCSGL.cjs → chunk-OFJYEITB.cjs} +356 -91
- package/dist/chunk-OFJYEITB.cjs.map +1 -0
- package/dist/{chunk-BN7BRTLY.js → chunk-VOC24LYF.js} +357 -92
- package/dist/chunk-VOC24LYF.js.map +1 -0
- package/dist/element-browser.js +354 -111
- package/dist/element-browser.js.map +1 -1
- package/dist/element.cjs +2 -2
- package/dist/element.js +1 -1
- package/dist/index.cjs +8 -8
- package/dist/index.js +1 -1
- package/dist/player.cjs +457 -135
- package/dist/player.cjs.map +1 -1
- package/dist/player.d.cts +35 -4
- package/dist/player.d.ts +35 -4
- package/dist/player.js +457 -135
- package/dist/player.js.map +1 -1
- package/package.json +1 -1
- package/src/element/avbridge-player.ts +136 -28
- package/src/strategies/fallback/audio-output.ts +164 -35
- package/src/strategies/fallback/decoder.ts +336 -58
- package/src/strategies/fallback/video-renderer.ts +176 -34
- package/src/strategies/hybrid/decoder.ts +22 -19
- package/src/strategies/remux/pipeline.ts +12 -3
- package/dist/chunk-BN7BRTLY.js.map +0 -1
- package/dist/chunk-UM6WCSGL.cjs.map +0 -1
package/dist/player.d.cts
CHANGED
|
@@ -338,6 +338,32 @@ interface SettingsSectionConfig {
|
|
|
338
338
|
|
|
339
339
|
declare class AvbridgePlayerElement extends HTMLElement {
|
|
340
340
|
static readonly observedAttributes: ("src" | "muted" | "autoplay" | "loop" | "preload" | "poster" | "playsinline" | "crossorigin" | "disableremoteplayback" | "preferstrategy" | "fit" | "show-fit")[];
|
|
341
|
+
/**
|
|
342
|
+
* Returns `true` if a DOM event originated from one of the player's
|
|
343
|
+
* **interactive chrome elements** (seek bar, control buttons, settings
|
|
344
|
+
* menu, overlay play button) rather than the bare video surface.
|
|
345
|
+
*
|
|
346
|
+
* This is the escape hatch for host pages that wrap the player in a
|
|
347
|
+
* gesture recognizer (e.g. TikTok-style vertical-swipe pager). For
|
|
348
|
+
* bubble-phase listeners the player's own handlers already call
|
|
349
|
+
* `stopPropagation()` on chrome interactions — but **capture-phase**
|
|
350
|
+
* listeners run *before* the player's handlers, so they need to check
|
|
351
|
+
* the event's path themselves and bail. This helper does that check
|
|
352
|
+
* via `composedPath()`, which traverses shadow boundaries correctly.
|
|
353
|
+
*
|
|
354
|
+
* Returns `false` for events on the bare video surface — host pages
|
|
355
|
+
* remain free to claim those for their own gestures (e.g. swipe-to-pan
|
|
356
|
+
* to the next video). Returns `false` for events that never hit a
|
|
357
|
+
* player at all.
|
|
358
|
+
*
|
|
359
|
+
* @example
|
|
360
|
+
* // TikTok-style vertical swipe on the document, capture phase:
|
|
361
|
+
* document.addEventListener("pointerdown", (e) => {
|
|
362
|
+
* if (AvbridgePlayerElement.isPlayerChromeEvent(e)) return;
|
|
363
|
+
* startSwipeGesture(e);
|
|
364
|
+
* }, { capture: true });
|
|
365
|
+
*/
|
|
366
|
+
static isPlayerChromeEvent(event: Event): boolean;
|
|
341
367
|
private _video;
|
|
342
368
|
private _playBtn;
|
|
343
369
|
private _overlayBtn;
|
|
@@ -363,6 +389,11 @@ declare class AvbridgePlayerElement extends HTMLElement {
|
|
|
363
389
|
private _activeAudioTrackId;
|
|
364
390
|
private _activeSubtitleTrackId;
|
|
365
391
|
private _userSeeking;
|
|
392
|
+
/** Last seek target the user committed. The thumb stays here (and
|
|
393
|
+
* `_updateTime` skips updating from `timeupdate`) until the underlying
|
|
394
|
+
* `currentTime` actually catches up — otherwise the thumb visibly snaps
|
|
395
|
+
* back to the pre-seek position while the remux pipeline rebuilds. */
|
|
396
|
+
private _pendingSeekTarget;
|
|
366
397
|
private _holdTimer;
|
|
367
398
|
private _holdSpeedActive;
|
|
368
399
|
private _savedPlaybackRate;
|
|
@@ -386,13 +417,13 @@ declare class AvbridgePlayerElement extends HTMLElement {
|
|
|
386
417
|
private _onSeekCommit;
|
|
387
418
|
/** Linear click-to-time mapping across the full track width (no edge clamping). */
|
|
388
419
|
private _timeFromSeekPointer;
|
|
389
|
-
/** Seekbar width below which drag-to-scrub seeks in real-time (vs
|
|
390
|
-
* preview-only). On narrow bars precise positioning is hard, so
|
|
391
|
-
* immediate video feedback is more useful than a time tooltip. */
|
|
392
|
-
private static readonly SCRUB_WIDTH_THRESHOLD;
|
|
393
420
|
private _onSeekPointerDown;
|
|
394
421
|
private _onSeekHover;
|
|
395
422
|
private _updateSeekTooltip;
|
|
423
|
+
/** Position the tooltip over a specific time (vs. pointer X). Used by
|
|
424
|
+
* relative-drag scrub on coarse pointers, where the displayed time
|
|
425
|
+
* is decoupled from the finger position. */
|
|
426
|
+
private _updateSeekTooltipAtTime;
|
|
396
427
|
private _updateSeekVisuals;
|
|
397
428
|
private _updateTime;
|
|
398
429
|
/**
|
package/dist/player.d.ts
CHANGED
|
@@ -338,6 +338,32 @@ interface SettingsSectionConfig {
|
|
|
338
338
|
|
|
339
339
|
declare class AvbridgePlayerElement extends HTMLElement {
|
|
340
340
|
static readonly observedAttributes: ("src" | "muted" | "autoplay" | "loop" | "preload" | "poster" | "playsinline" | "crossorigin" | "disableremoteplayback" | "preferstrategy" | "fit" | "show-fit")[];
|
|
341
|
+
/**
|
|
342
|
+
* Returns `true` if a DOM event originated from one of the player's
|
|
343
|
+
* **interactive chrome elements** (seek bar, control buttons, settings
|
|
344
|
+
* menu, overlay play button) rather than the bare video surface.
|
|
345
|
+
*
|
|
346
|
+
* This is the escape hatch for host pages that wrap the player in a
|
|
347
|
+
* gesture recognizer (e.g. TikTok-style vertical-swipe pager). For
|
|
348
|
+
* bubble-phase listeners the player's own handlers already call
|
|
349
|
+
* `stopPropagation()` on chrome interactions — but **capture-phase**
|
|
350
|
+
* listeners run *before* the player's handlers, so they need to check
|
|
351
|
+
* the event's path themselves and bail. This helper does that check
|
|
352
|
+
* via `composedPath()`, which traverses shadow boundaries correctly.
|
|
353
|
+
*
|
|
354
|
+
* Returns `false` for events on the bare video surface — host pages
|
|
355
|
+
* remain free to claim those for their own gestures (e.g. swipe-to-pan
|
|
356
|
+
* to the next video). Returns `false` for events that never hit a
|
|
357
|
+
* player at all.
|
|
358
|
+
*
|
|
359
|
+
* @example
|
|
360
|
+
* // TikTok-style vertical swipe on the document, capture phase:
|
|
361
|
+
* document.addEventListener("pointerdown", (e) => {
|
|
362
|
+
* if (AvbridgePlayerElement.isPlayerChromeEvent(e)) return;
|
|
363
|
+
* startSwipeGesture(e);
|
|
364
|
+
* }, { capture: true });
|
|
365
|
+
*/
|
|
366
|
+
static isPlayerChromeEvent(event: Event): boolean;
|
|
341
367
|
private _video;
|
|
342
368
|
private _playBtn;
|
|
343
369
|
private _overlayBtn;
|
|
@@ -363,6 +389,11 @@ declare class AvbridgePlayerElement extends HTMLElement {
|
|
|
363
389
|
private _activeAudioTrackId;
|
|
364
390
|
private _activeSubtitleTrackId;
|
|
365
391
|
private _userSeeking;
|
|
392
|
+
/** Last seek target the user committed. The thumb stays here (and
|
|
393
|
+
* `_updateTime` skips updating from `timeupdate`) until the underlying
|
|
394
|
+
* `currentTime` actually catches up — otherwise the thumb visibly snaps
|
|
395
|
+
* back to the pre-seek position while the remux pipeline rebuilds. */
|
|
396
|
+
private _pendingSeekTarget;
|
|
366
397
|
private _holdTimer;
|
|
367
398
|
private _holdSpeedActive;
|
|
368
399
|
private _savedPlaybackRate;
|
|
@@ -386,13 +417,13 @@ declare class AvbridgePlayerElement extends HTMLElement {
|
|
|
386
417
|
private _onSeekCommit;
|
|
387
418
|
/** Linear click-to-time mapping across the full track width (no edge clamping). */
|
|
388
419
|
private _timeFromSeekPointer;
|
|
389
|
-
/** Seekbar width below which drag-to-scrub seeks in real-time (vs
|
|
390
|
-
* preview-only). On narrow bars precise positioning is hard, so
|
|
391
|
-
* immediate video feedback is more useful than a time tooltip. */
|
|
392
|
-
private static readonly SCRUB_WIDTH_THRESHOLD;
|
|
393
420
|
private _onSeekPointerDown;
|
|
394
421
|
private _onSeekHover;
|
|
395
422
|
private _updateSeekTooltip;
|
|
423
|
+
/** Position the tooltip over a specific time (vs. pointer X). Used by
|
|
424
|
+
* relative-drag scrub on coarse pointers, where the displayed time
|
|
425
|
+
* is decoupled from the finger position. */
|
|
426
|
+
private _updateSeekTooltipAtTime;
|
|
396
427
|
private _updateSeekVisuals;
|
|
397
428
|
private _updateTime;
|
|
398
429
|
/**
|