@banou/media-player 0.10.5 → 0.10.6
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
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
# @banou/media-player
|
|
4
4
|
|
|
5
5
|
A React video player for files the browser cannot open on its own. It takes a `read(offset, size)` and
|
|
6
|
-
a byte length, remuxes into fragmented MP4 as it plays through [libav-wasm](https://github.com/
|
|
6
|
+
a byte length, remuxes into fragmented MP4 as it plays through [libav-wasm](https://github.com/banou26/libav-wasm),
|
|
7
7
|
and renders ASS/SSA subtitles with jassub. Nothing is downloaded up front, so it plays a 4 GB MKV over
|
|
8
8
|
HTTP range requests, out of a torrent, off a local disk, or out of anything else that can answer for a
|
|
9
9
|
byte range.
|
package/dist/engine/index.js
CHANGED
|
@@ -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-
|
|
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";
|
|
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 };
|
|
@@ -75,7 +75,7 @@ var i = (e) => Array(e.buffered.length).fill(void 0).map((t, n) => ({
|
|
|
75
75
|
x || (x = !0, queueMicrotask(() => {
|
|
76
76
|
x = !1;
|
|
77
77
|
let e = l;
|
|
78
|
-
|
|
78
|
+
e && t.videoWidth && e.ready.then(() => {
|
|
79
79
|
if (l === e) return e.manualRender({
|
|
80
80
|
expectedDisplayTime: performance.now(),
|
|
81
81
|
width: t.videoWidth,
|
|
@@ -241,7 +241,7 @@ var i = (e) => Array(e.buffered.length).fill(void 0).map((t, n) => ({
|
|
|
241
241
|
await F(e.data), e.subtitles?.length && s.pushFragments(e.subtitles), te?.();
|
|
242
242
|
let I = !1, L = !1, R = 0, z, B = () => z ?? n.currentTime, V = !1, H = 0, U = 0, W = null, G = 0, ue = 0, K = !1, de = 0, q = (e, t, n = !1) => {
|
|
243
243
|
let r = e?.message === "Cancelled";
|
|
244
|
-
t && r || (console.error(e), !
|
|
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
247
|
let t = n.currentTime, r = e ? x : v, a = e ? S : y;
|
|
@@ -521,7 +521,7 @@ var i = (e) => Array(e.buffered.length).fill(void 0).map((t, n) => ({
|
|
|
521
521
|
}, g = "requestVideoFrameCallback" in t, _ = () => {
|
|
522
522
|
h(), v();
|
|
523
523
|
}, v = () => {
|
|
524
|
-
d
|
|
524
|
+
!d && a && (o = g ? t.requestVideoFrameCallback(_) : requestAnimationFrame(_));
|
|
525
525
|
}, y = () => {
|
|
526
526
|
o !== void 0 && (g ? t.cancelVideoFrameCallback(o) : cancelAnimationFrame(o)), s !== void 0 && clearInterval(s), o = void 0, s = void 0;
|
|
527
527
|
}, b = () => {
|