@banou/media-player 0.10.22 → 0.10.24

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/README.md CHANGED
@@ -162,8 +162,10 @@ an offer to skip an opening or ending, volume on a log curve, mute, playback spe
162
162
  selection, subtitle track selection, picture in picture, fullscreen, and keyboard shortcuts. Nothing
163
163
  is persisted: volume, speed and track choices start at their defaults every load.
164
164
 
165
- The shortcuts (Space or `k`, `f`, `m`, the arrow keys) listen on the whole page. Pass `shortcuts="player"` for a
166
- player among other content: a key then acts only from inside the player (a click on the picture puts the focus
165
+ The shortcuts (Space or `k`, `f`, `m`, the arrow keys, and `<` and `>` to pause and step one frame back or forward)
166
+ listen on the whole page, and leave Ctrl, Cmd and Alt combinations to the browser. The frame steps need a media
167
+ with `requestVideoFrameCallback`, which a `media` playing in another document does not have. Pass `shortcuts="player"`
168
+ for a player among other content: a key then acts only from inside the player (a click on the picture puts the focus
167
169
  there) or while it is fullscreen, and Space and the arrows keep scrolling the page everywhere else.
168
170
 
169
171
  ### Chapters
@@ -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-Cr_7OImR.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-BdouHadr.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 };
@@ -50,7 +50,6 @@ var i = (e) => Array(e.buffered.length).fill(void 0).map((t, n) => ({
50
50
  return {
51
51
  type: "dialogue",
52
52
  streamIndex: t.streamIndex,
53
- index: a,
54
53
  assEvent: {
55
54
  Name: s.Name ?? "",
56
55
  Effect: s.Effect?.name ?? "",
@@ -136,9 +135,10 @@ var i = (e) => Array(e.buffered.length).fill(void 0).map((t, n) => ({
136
135
  if (!e) continue;
137
136
  let r = h.get(n.streamIndex);
138
137
  r || (r = /* @__PURE__ */ new Map(), h.set(n.streamIndex, r));
139
- let i = m(e, n);
140
- if (r.has(i.index)) continue;
141
- r.set(i.index, i), g === n.streamIndex && t.push(i.assEvent);
138
+ let i = `${n.start},${n.end},${n.content.slice(n.content.indexOf(",") + 1)}`;
139
+ if (r.has(i)) continue;
140
+ let a = m(e, n);
141
+ r.set(i, a), g === n.streamIndex && t.push(a.assEvent);
142
142
  }
143
143
  t.length && (b((e) => Promise.all(t.map((t) => e.createEvent(t)))), S());
144
144
  },
@@ -320,12 +320,12 @@ var i = (e) => Array(e.buffered.length).fill(void 0).map((t, n) => ({
320
320
  } finally {
321
321
  e === V && (I = !1);
322
322
  }
323
- }, Ce = (e) => e >= pe && we(e) && Te(e), we = (e) => i(A).some((t) => t.start <= e && e < t.end), X = (e) => {
323
+ }, Ce = (e) => i(A).some((t) => t.start <= e && e < t.end && t.end >= pe) && Te(e), we = (e) => i(A).some((t) => t.start <= e && e < t.end), X = (e) => {
324
324
  let t = ge(e);
325
325
  return t ? t.end - e : 0;
326
326
  }, Te = (e) => X(e) >= E || be() && ve(e), Ee = async (e) => {
327
327
  if (!P && !(we(e) && Te(e))) {
328
- B = !1, R++, z = e;
328
+ $ && clearTimeout($), $ = void 0, B = !1, R++, z = e;
329
329
  try {
330
330
  await Y(e);
331
331
  let t = H;