@banou/media-player 0.10.10 → 0.10.11

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.
@@ -1,2 +1,2 @@
1
- import { a as e, c as t, d as n, f as r, i, l as a, n as o, o as s, r as c, s as l, t as u, u as d } from "../engine-C6PdWBah.js";
1
+ import { a as e, c as t, d as n, f as r, i, l as a, n as o, o as s, r as c, s as l, t as u, u as d } from "../engine-_RCEvBvl.js";
2
2
  export { i as DEFAULT_BUFFER_SIZE, e as MediaElementError, a as SUBTITLES_OFF, u as createPictureInPicture, d as createSubtitleRenderer, c as createThumbnailGenerator, n as getTimeRanges, s as isMediaElementError, o as pictureInPictureMode, l as startPlayback, t as terminateRemuxer, r as updateSourceBuffer };
@@ -244,8 +244,9 @@ var i = (e) => Array(e.buffered.length).fill(void 0).map((t, n) => ({
244
244
  t && r || (console.error(e), (!K || n) && (K = !0, ne?.(r ? Error("Reading the video file failed", { cause: e }) : e)));
245
245
  }, fe = async (e = !1) => {
246
246
  if (R > 0 && !e) return;
247
- let t = n.currentTime, r = e ? x : v, a = e ? S : y;
248
- for (let { start: e, end: n } of i(A)) e < t + r && await se(e, t + r), n > t + a && await se(t + a, n);
247
+ let t = n.currentTime, r = e ? x : v, a = e ? S : y, o = i(A);
248
+ o.length && o[0].start < t + r && await se(0, t + r);
249
+ for (let { end: e } of o) e > t + a && await se(t + a, e);
249
250
  }, pe = () => {
250
251
  let e = i(A);
251
252
  if (!e.length) return !0;
package/dist/index.js CHANGED
@@ -1,4 +1,4 @@
1
- import { l as e, n as t, o as n, r, s as i, t as a, u as o } from "./engine-C6PdWBah.js";
1
+ import { l as e, n as t, o as n, r, s as i, t as a, u as o } from "./engine-_RCEvBvl.js";
2
2
  import { Children as s, Fragment as c, isValidElement as l, useCallback as u, useEffect as d, useMemo as f, useRef as p, useState as m, useSyncExternalStore as h } from "react";
3
3
  import { css as g, keyframes as _ } from "@emotion/react";
4
4
  import { createPlayer as v, useContainerAttach as y, useMediaAttach as b } from "@videojs/react";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@banou/media-player",
3
- "version": "0.10.10",
3
+ "version": "0.10.11",
4
4
  "description": "A video player for containers and codecs the browser cannot play natively, remuxed on the fly",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -304,8 +304,12 @@ export const startPlayback = async (options: PlaybackOptions): Promise<PlaybackC
304
304
  const ct = videoElement.currentTime
305
305
  const pre = tight ? PRE_EVICT_TIGHT : PRE_EVICT
306
306
  const post = tight ? POST_EVICT_TIGHT : POST_EVICT
307
- for (const { start, end } of getTimeRanges(sourceBuffer)) {
308
- if (start < ct + pre) await unbufferRange(start, ct + pre)
307
+ const ranges = getTimeRanges(sourceBuffer)
308
+ // From 0, never from the reported start: once a group is removed, Firefox 151 reports the start
309
+ // 1 ms after the keyframe it still holds, so a remove from there keeps that frame for good
310
+ // (measured 2026-10-11).
311
+ if (ranges.length && ranges[0].start < ct + pre) await unbufferRange(0, ct + pre)
312
+ for (const { end } of ranges) {
309
313
  if (end > ct + post) await unbufferRange(ct + post, end)
310
314
  }
311
315
  }