avbridge 2.6.0 → 2.8.1
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 +131 -0
- package/README.md +23 -0
- package/dist/{chunk-6SOFJV44.cjs → chunk-IUSFLVLJ.cjs} +21 -6
- package/dist/chunk-IUSFLVLJ.cjs.map +1 -0
- package/dist/{chunk-OGYHFY6K.js → chunk-JSQOBUQB.js} +21 -6
- package/dist/chunk-JSQOBUQB.js.map +1 -0
- package/dist/element-browser.js +146 -7
- package/dist/element-browser.js.map +1 -1
- package/dist/element.cjs +129 -5
- package/dist/element.cjs.map +1 -1
- package/dist/element.d.cts +52 -3
- package/dist/element.d.ts +52 -3
- package/dist/element.js +128 -4
- package/dist/element.js.map +1 -1
- package/dist/index.cjs +8 -8
- package/dist/index.d.cts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +1 -1
- package/dist/{player-DGXeCNfD.d.cts → player-DXEKOky8.d.cts} +3 -0
- package/dist/{player-DGXeCNfD.d.ts → player-DXEKOky8.d.ts} +3 -0
- package/dist/player.cjs +222 -11
- package/dist/player.cjs.map +1 -1
- package/dist/player.d.cts +61 -3
- package/dist/player.d.ts +61 -3
- package/dist/player.js +222 -11
- package/dist/player.js.map +1 -1
- package/package.json +7 -1
- package/src/classify/rules.ts +23 -0
- package/src/element/avbridge-player.ts +40 -5
- package/src/element/avbridge-video.ts +148 -4
- package/src/element/player-styles.ts +44 -0
- package/src/element.ts +3 -3
- package/src/strategies/fallback/decoder.ts +14 -7
- package/src/strategies/fallback/video-renderer.ts +7 -5
- package/src/types.ts +1 -0
- package/dist/chunk-6SOFJV44.cjs.map +0 -1
- package/dist/chunk-OGYHFY6K.js.map +0 -1
|
@@ -215,6 +215,22 @@ function classifyContext(ctx) {
|
|
|
215
215
|
};
|
|
216
216
|
}
|
|
217
217
|
if (REMUXABLE_CONTAINERS.has(ctx.container)) {
|
|
218
|
+
const mime = mp4MimeFor(video, audio);
|
|
219
|
+
if (mime && typeof MediaSource !== "undefined" && !mseSupports(mime)) {
|
|
220
|
+
if (webCodecsAvailable()) {
|
|
221
|
+
return {
|
|
222
|
+
class: "HYBRID_CANDIDATE",
|
|
223
|
+
strategy: "hybrid",
|
|
224
|
+
reason: `${ctx.container} container with ${video.codec}${audio ? "/" + audio.codec : ""}; MSE rejects the remux target mime \u2014 routing to WebCodecs hardware decode`,
|
|
225
|
+
fallbackChain: ["fallback"]
|
|
226
|
+
};
|
|
227
|
+
}
|
|
228
|
+
return {
|
|
229
|
+
class: "FALLBACK_REQUIRED",
|
|
230
|
+
strategy: "fallback",
|
|
231
|
+
reason: `${ctx.container} container with ${video.codec}${audio ? "/" + audio.codec : ""}; MSE rejects the remux target mime and WebCodecs is unavailable \u2014 falling back to WASM decode`
|
|
232
|
+
};
|
|
233
|
+
}
|
|
218
234
|
return {
|
|
219
235
|
class: "REMUX_CANDIDATE",
|
|
220
236
|
strategy: "remux",
|
|
@@ -1006,7 +1022,7 @@ var VideoRenderer = class {
|
|
|
1006
1022
|
this.resolveFirstFrame = resolve;
|
|
1007
1023
|
});
|
|
1008
1024
|
this.canvas = document.createElement("canvas");
|
|
1009
|
-
this.canvas.style.cssText = "position:absolute;left:0;top:0;width:100%;height:100%;background:black;object-fit:contain;";
|
|
1025
|
+
this.canvas.style.cssText = "position:absolute;left:0;top:0;width:100%;height:100%;background:black;object-fit:var(--avbridge-fit, contain);";
|
|
1010
1026
|
const parent = target.parentElement ?? target.parentNode;
|
|
1011
1027
|
if (parent && parent instanceof HTMLElement) {
|
|
1012
1028
|
if (getComputedStyle(parent).position === "static") {
|
|
@@ -2180,7 +2196,7 @@ async function createHybridSession(ctx, target, transport) {
|
|
|
2180
2196
|
|
|
2181
2197
|
// src/strategies/fallback/decoder.ts
|
|
2182
2198
|
async function startDecoder(opts) {
|
|
2183
|
-
const variant =
|
|
2199
|
+
const variant = "avbridge";
|
|
2184
2200
|
const libav = await loadLibav(variant);
|
|
2185
2201
|
const bridge = await loadBridge2();
|
|
2186
2202
|
const { prepareLibavInput } = await import('./libav-http-reader-WXG3Z7AI.js');
|
|
@@ -2236,9 +2252,8 @@ async function startDecoder(opts) {
|
|
|
2236
2252
|
videoStream ? `video: ${opts.context.videoTracks[0]?.codec ?? "unknown"}` : null,
|
|
2237
2253
|
audioStream ? `audio: ${opts.context.audioTracks[0]?.codec ?? "unknown"}` : null
|
|
2238
2254
|
].filter(Boolean).join(", ");
|
|
2239
|
-
const hint = variant === "webcodecs" ? ` The "${variant}" libav variant does not include software decoders for these codecs. Try the custom "avbridge" variant (scripts/build-libav.sh) for broader codec support, or use a lighter strategy (native, remux, hybrid) instead.` : "";
|
|
2240
2255
|
throw new Error(
|
|
2241
|
-
`fallback decoder: could not initialize any libav decoders (${codecs})
|
|
2256
|
+
`fallback decoder: could not initialize any libav decoders (${codecs}). The "${variant}" libav variant lacks software decoders for these codecs \u2014 rebuild with scripts/build-libav.sh including the missing decoder, or use a lighter strategy (native, remux, hybrid) instead.`
|
|
2242
2257
|
);
|
|
2243
2258
|
}
|
|
2244
2259
|
let bsfCtx = null;
|
|
@@ -3358,5 +3373,5 @@ function defaultFallbackChain(strategy) {
|
|
|
3358
3373
|
}
|
|
3359
3374
|
|
|
3360
3375
|
export { FALLBACK_AUDIO_CODECS, FALLBACK_VIDEO_CODECS, NATIVE_AUDIO_CODECS, NATIVE_VIDEO_CODECS, UnifiedPlayer, classifyContext, createPlayer };
|
|
3361
|
-
//# sourceMappingURL=chunk-
|
|
3362
|
-
//# sourceMappingURL=chunk-
|
|
3376
|
+
//# sourceMappingURL=chunk-JSQOBUQB.js.map
|
|
3377
|
+
//# sourceMappingURL=chunk-JSQOBUQB.js.map
|