avbridge 2.3.0 → 2.5.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 +73 -0
- package/dist/{chunk-6UUT4BEA.cjs → chunk-2IJ66NTD.cjs} +13 -20
- package/dist/chunk-2IJ66NTD.cjs.map +1 -0
- package/dist/{chunk-XKPSTC34.cjs → chunk-2XW2O3YI.cjs} +5 -20
- package/dist/chunk-2XW2O3YI.cjs.map +1 -0
- package/dist/chunk-5KVLE6YI.js +167 -0
- package/dist/chunk-5KVLE6YI.js.map +1 -0
- package/dist/{chunk-2PGRFCWB.js → chunk-CPJLFFCC.js} +8 -18
- package/dist/chunk-CPJLFFCC.js.map +1 -0
- package/dist/chunk-CPZ7PXAM.cjs +240 -0
- package/dist/chunk-CPZ7PXAM.cjs.map +1 -0
- package/dist/{chunk-QQXBPW72.js → chunk-E76AMWI4.js} +4 -18
- package/dist/chunk-E76AMWI4.js.map +1 -0
- package/dist/{chunk-NV7ILLWH.js → chunk-KY2GPCT7.js} +347 -665
- package/dist/chunk-KY2GPCT7.js.map +1 -0
- package/dist/chunk-LUFA47FP.js +19 -0
- package/dist/chunk-LUFA47FP.js.map +1 -0
- package/dist/chunk-Q2VUO52Z.cjs +374 -0
- package/dist/chunk-Q2VUO52Z.cjs.map +1 -0
- package/dist/chunk-QDJLQR53.cjs +22 -0
- package/dist/chunk-QDJLQR53.cjs.map +1 -0
- package/dist/chunk-S4WAZC2T.cjs +173 -0
- package/dist/chunk-S4WAZC2T.cjs.map +1 -0
- package/dist/chunk-SMH6IOP2.js +368 -0
- package/dist/chunk-SMH6IOP2.js.map +1 -0
- package/dist/chunk-SR3MPV4D.js +237 -0
- package/dist/chunk-SR3MPV4D.js.map +1 -0
- package/dist/{chunk-7RGG6ME7.cjs → chunk-TBW26OPP.cjs} +365 -688
- package/dist/chunk-TBW26OPP.cjs.map +1 -0
- package/dist/chunk-X2K3GIWE.js +235 -0
- package/dist/chunk-X2K3GIWE.js.map +1 -0
- package/dist/chunk-ZCUXHW55.cjs +242 -0
- package/dist/chunk-ZCUXHW55.cjs.map +1 -0
- package/dist/element-browser.js +799 -493
- package/dist/element-browser.js.map +1 -1
- package/dist/element.cjs +58 -4
- package/dist/element.cjs.map +1 -1
- package/dist/element.d.cts +38 -0
- package/dist/element.d.ts +38 -0
- package/dist/element.js +57 -3
- package/dist/element.js.map +1 -1
- package/dist/index.cjs +523 -393
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +494 -366
- package/dist/index.js.map +1 -1
- package/dist/libav-demux-H2GS46GH.cjs +27 -0
- package/dist/libav-demux-H2GS46GH.cjs.map +1 -0
- package/dist/libav-demux-OWZ4T2YW.js +6 -0
- package/dist/libav-demux-OWZ4T2YW.js.map +1 -0
- package/dist/{libav-import-GST2AMPL.cjs → libav-import-2ZVKV2E7.cjs} +2 -2
- package/dist/{libav-import-GST2AMPL.cjs.map → libav-import-2ZVKV2E7.cjs.map} +1 -1
- package/dist/{libav-import-2JURFHEW.js → libav-import-6MGLCXVQ.js} +2 -2
- package/dist/{libav-import-2JURFHEW.js.map → libav-import-6MGLCXVQ.js.map} +1 -1
- package/dist/player.cjs +601 -470
- package/dist/player.cjs.map +1 -1
- package/dist/player.d.cts +50 -0
- package/dist/player.d.ts +50 -0
- package/dist/player.js +580 -449
- package/dist/player.js.map +1 -1
- package/dist/remux-OBSMIENG.cjs +35 -0
- package/dist/remux-OBSMIENG.cjs.map +1 -0
- package/dist/remux-WBYIZBBX.js +10 -0
- package/dist/remux-WBYIZBBX.js.map +1 -0
- package/dist/source-4TZ6KMNV.js +4 -0
- package/dist/{source-F656KYYV.js.map → source-4TZ6KMNV.js.map} +1 -1
- package/dist/source-7YLO6E7X.cjs +29 -0
- package/dist/{source-73CAH6HW.cjs.map → source-7YLO6E7X.cjs.map} +1 -1
- package/dist/source-MTX5ELUZ.js +4 -0
- package/dist/{source-QJR3OHTW.js.map → source-MTX5ELUZ.js.map} +1 -1
- package/dist/source-VFLXLOCN.cjs +29 -0
- package/dist/{source-VB74JQ7Z.cjs.map → source-VFLXLOCN.cjs.map} +1 -1
- package/dist/subtitles-4T74JRGT.js +4 -0
- package/dist/subtitles-4T74JRGT.js.map +1 -0
- package/dist/subtitles-QUH4LPI4.cjs +29 -0
- package/dist/subtitles-QUH4LPI4.cjs.map +1 -0
- package/package.json +1 -1
- package/src/convert/remux.ts +1 -35
- package/src/convert/transcode-libav.ts +691 -0
- package/src/convert/transcode.ts +12 -4
- package/src/element/avbridge-player.ts +16 -0
- package/src/element/avbridge-video.ts +54 -0
- package/src/errors.ts +6 -0
- package/src/player.ts +15 -16
- package/src/strategies/fallback/decoder.ts +96 -173
- package/src/strategies/fallback/index.ts +19 -2
- package/src/strategies/fallback/libav-import.ts +9 -1
- package/src/strategies/fallback/video-renderer.ts +107 -0
- package/src/strategies/hybrid/decoder.ts +88 -180
- package/src/strategies/hybrid/index.ts +17 -2
- package/src/strategies/native.ts +6 -3
- package/src/strategies/remux/index.ts +14 -2
- package/src/strategies/remux/pipeline.ts +72 -12
- package/src/subtitles/render.ts +8 -0
- package/src/util/libav-demux.ts +405 -0
- package/dist/chunk-2PGRFCWB.js.map +0 -1
- package/dist/chunk-6UUT4BEA.cjs.map +0 -1
- package/dist/chunk-7RGG6ME7.cjs.map +0 -1
- package/dist/chunk-NV7ILLWH.js.map +0 -1
- package/dist/chunk-QQXBPW72.js.map +0 -1
- package/dist/chunk-XKPSTC34.cjs.map +0 -1
- package/dist/source-73CAH6HW.cjs +0 -28
- package/dist/source-F656KYYV.js +0 -3
- package/dist/source-QJR3OHTW.js +0 -3
- package/dist/source-VB74JQ7Z.cjs +0 -28
package/dist/player.d.cts
CHANGED
|
@@ -106,6 +106,18 @@ declare class AvbridgePlayerElement extends HTMLElement {
|
|
|
106
106
|
get strategyClass(): string | undefined;
|
|
107
107
|
get audioTracks(): unknown[];
|
|
108
108
|
get subtitleTracks(): unknown[];
|
|
109
|
+
/**
|
|
110
|
+
* External subtitle files to attach when the source loads. Forwarded
|
|
111
|
+
* to the inner <avbridge-video>. Takes effect on next bootstrap.
|
|
112
|
+
*/
|
|
113
|
+
get subtitles(): unknown;
|
|
114
|
+
set subtitles(value: unknown);
|
|
115
|
+
/** Attach a subtitle track to the current playback without a reload. */
|
|
116
|
+
addSubtitle(subtitle: {
|
|
117
|
+
url: string;
|
|
118
|
+
language?: string;
|
|
119
|
+
format?: "vtt" | "srt";
|
|
120
|
+
}): Promise<void>;
|
|
109
121
|
get player(): unknown;
|
|
110
122
|
get videoElement(): HTMLVideoElement;
|
|
111
123
|
play(): Promise<void>;
|
|
@@ -505,6 +517,13 @@ declare class AvbridgeVideoElement extends HTMLElementCtor {
|
|
|
505
517
|
private _strategyClass;
|
|
506
518
|
private _audioTracks;
|
|
507
519
|
private _subtitleTracks;
|
|
520
|
+
/**
|
|
521
|
+
* External subtitle list forwarded to `createPlayer()` on the next
|
|
522
|
+
* bootstrap. Setting this after bootstrap queues it for the next
|
|
523
|
+
* source change; consumers that need to swap subtitles mid-playback
|
|
524
|
+
* should set `source` to reload.
|
|
525
|
+
*/
|
|
526
|
+
private _subtitles;
|
|
508
527
|
/**
|
|
509
528
|
* Initial strategy preference. `"auto"` means "let the classifier decide";
|
|
510
529
|
* any other value is passed to `createPlayer({ initialStrategy })` and
|
|
@@ -621,6 +640,37 @@ declare class AvbridgeVideoElement extends HTMLElementCtor {
|
|
|
621
640
|
get player(): UnifiedPlayer | null;
|
|
622
641
|
get audioTracks(): AudioTrackInfo[];
|
|
623
642
|
get subtitleTracks(): SubtitleTrackInfo[];
|
|
643
|
+
/**
|
|
644
|
+
* External subtitle files to attach when the source loads. Takes effect
|
|
645
|
+
* on the next bootstrap — set before assigning `source`, or reload via
|
|
646
|
+
* `load()` after changing. For dynamic post-bootstrap addition, use
|
|
647
|
+
* `addSubtitle()` instead.
|
|
648
|
+
*
|
|
649
|
+
* @example
|
|
650
|
+
* el.subtitles = [{ url: "/en.srt", format: "srt", language: "en" }];
|
|
651
|
+
* el.src = "/movie.mp4";
|
|
652
|
+
*/
|
|
653
|
+
get subtitles(): Array<{
|
|
654
|
+
url: string;
|
|
655
|
+
language?: string;
|
|
656
|
+
format?: "vtt" | "srt";
|
|
657
|
+
}> | null;
|
|
658
|
+
set subtitles(value: Array<{
|
|
659
|
+
url: string;
|
|
660
|
+
language?: string;
|
|
661
|
+
format?: "vtt" | "srt";
|
|
662
|
+
}> | null);
|
|
663
|
+
/**
|
|
664
|
+
* Attach a subtitle track to the current playback without rebuilding
|
|
665
|
+
* the player. Works while the element is playing — converts SRT to
|
|
666
|
+
* VTT if needed, adds a `<track>` to the inner `<video>`. Canvas
|
|
667
|
+
* strategies pick up the new track via their textTracks watcher.
|
|
668
|
+
*/
|
|
669
|
+
addSubtitle(subtitle: {
|
|
670
|
+
url: string;
|
|
671
|
+
language?: string;
|
|
672
|
+
format?: "vtt" | "srt";
|
|
673
|
+
}): Promise<void>;
|
|
624
674
|
/** Force a (re-)bootstrap if a source is currently set. */
|
|
625
675
|
load(): Promise<void>;
|
|
626
676
|
/**
|
package/dist/player.d.ts
CHANGED
|
@@ -106,6 +106,18 @@ declare class AvbridgePlayerElement extends HTMLElement {
|
|
|
106
106
|
get strategyClass(): string | undefined;
|
|
107
107
|
get audioTracks(): unknown[];
|
|
108
108
|
get subtitleTracks(): unknown[];
|
|
109
|
+
/**
|
|
110
|
+
* External subtitle files to attach when the source loads. Forwarded
|
|
111
|
+
* to the inner <avbridge-video>. Takes effect on next bootstrap.
|
|
112
|
+
*/
|
|
113
|
+
get subtitles(): unknown;
|
|
114
|
+
set subtitles(value: unknown);
|
|
115
|
+
/** Attach a subtitle track to the current playback without a reload. */
|
|
116
|
+
addSubtitle(subtitle: {
|
|
117
|
+
url: string;
|
|
118
|
+
language?: string;
|
|
119
|
+
format?: "vtt" | "srt";
|
|
120
|
+
}): Promise<void>;
|
|
109
121
|
get player(): unknown;
|
|
110
122
|
get videoElement(): HTMLVideoElement;
|
|
111
123
|
play(): Promise<void>;
|
|
@@ -505,6 +517,13 @@ declare class AvbridgeVideoElement extends HTMLElementCtor {
|
|
|
505
517
|
private _strategyClass;
|
|
506
518
|
private _audioTracks;
|
|
507
519
|
private _subtitleTracks;
|
|
520
|
+
/**
|
|
521
|
+
* External subtitle list forwarded to `createPlayer()` on the next
|
|
522
|
+
* bootstrap. Setting this after bootstrap queues it for the next
|
|
523
|
+
* source change; consumers that need to swap subtitles mid-playback
|
|
524
|
+
* should set `source` to reload.
|
|
525
|
+
*/
|
|
526
|
+
private _subtitles;
|
|
508
527
|
/**
|
|
509
528
|
* Initial strategy preference. `"auto"` means "let the classifier decide";
|
|
510
529
|
* any other value is passed to `createPlayer({ initialStrategy })` and
|
|
@@ -621,6 +640,37 @@ declare class AvbridgeVideoElement extends HTMLElementCtor {
|
|
|
621
640
|
get player(): UnifiedPlayer | null;
|
|
622
641
|
get audioTracks(): AudioTrackInfo[];
|
|
623
642
|
get subtitleTracks(): SubtitleTrackInfo[];
|
|
643
|
+
/**
|
|
644
|
+
* External subtitle files to attach when the source loads. Takes effect
|
|
645
|
+
* on the next bootstrap — set before assigning `source`, or reload via
|
|
646
|
+
* `load()` after changing. For dynamic post-bootstrap addition, use
|
|
647
|
+
* `addSubtitle()` instead.
|
|
648
|
+
*
|
|
649
|
+
* @example
|
|
650
|
+
* el.subtitles = [{ url: "/en.srt", format: "srt", language: "en" }];
|
|
651
|
+
* el.src = "/movie.mp4";
|
|
652
|
+
*/
|
|
653
|
+
get subtitles(): Array<{
|
|
654
|
+
url: string;
|
|
655
|
+
language?: string;
|
|
656
|
+
format?: "vtt" | "srt";
|
|
657
|
+
}> | null;
|
|
658
|
+
set subtitles(value: Array<{
|
|
659
|
+
url: string;
|
|
660
|
+
language?: string;
|
|
661
|
+
format?: "vtt" | "srt";
|
|
662
|
+
}> | null);
|
|
663
|
+
/**
|
|
664
|
+
* Attach a subtitle track to the current playback without rebuilding
|
|
665
|
+
* the player. Works while the element is playing — converts SRT to
|
|
666
|
+
* VTT if needed, adds a `<track>` to the inner `<video>`. Canvas
|
|
667
|
+
* strategies pick up the new track via their textTracks watcher.
|
|
668
|
+
*/
|
|
669
|
+
addSubtitle(subtitle: {
|
|
670
|
+
url: string;
|
|
671
|
+
language?: string;
|
|
672
|
+
format?: "vtt" | "srt";
|
|
673
|
+
}): Promise<void>;
|
|
624
674
|
/** Force a (re-)bootstrap if a source is currently set. */
|
|
625
675
|
load(): Promise<void>;
|
|
626
676
|
/**
|