avbridge 2.7.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.
@@ -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 = pickLibavVariant(opts.context);
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}).${hint}`
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-OGYHFY6K.js.map
3362
- //# sourceMappingURL=chunk-OGYHFY6K.js.map
3376
+ //# sourceMappingURL=chunk-JSQOBUQB.js.map
3377
+ //# sourceMappingURL=chunk-JSQOBUQB.js.map