@banou/media-player 0.10.25 → 0.10.27
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 +7 -0
- package/dist/engine/index.js +1 -1
- package/dist/engine/playback.d.ts +1 -0
- package/dist/engine/subtitles.d.ts +8 -0
- package/dist/{engine-BdouHadr.js → engine-AjFLuCdA.js} +190 -185
- package/dist/index.js +53 -51
- package/dist/react/video-player.d.ts +2 -0
- package/dist/volume-normalizer-worklet.js +15 -7
- package/package.json +2 -1
- package/src/lib/assets/noto-sans-jp.LICENSE.txt +92 -0
- package/src/lib/assets/noto-sans-jp.otf +0 -0
- package/src/lib/audio/volume-normalizer-worklet.js +15 -7
- package/src/lib/engine/playback.ts +3 -1
- package/src/lib/engine/subtitles.ts +34 -1
- package/src/lib/react/hooks/use-playback.ts +3 -2
- package/src/lib/react/video-player.tsx +2 -0
package/README.md
CHANGED
|
@@ -25,6 +25,7 @@ import MediaPlayer from '@banou/media-player'
|
|
|
25
25
|
jassubWasmUrl={jassubWasmUrl}
|
|
26
26
|
jassubLegacyWasmUrl={jassubLegacyWasmUrl}
|
|
27
27
|
defaultFontUrl={defaultFontUrl}
|
|
28
|
+
cjkFontUrl={cjkFontUrl}
|
|
28
29
|
title="episode.mkv"
|
|
29
30
|
autoplay
|
|
30
31
|
/>
|
|
@@ -93,6 +94,12 @@ reads as a browser bug rather than a missing asset. Serve both.
|
|
|
93
94
|
|
|
94
95
|
`libavWorkerUrl` (`libav-wasm/build/worker.js`) is named individually and still copies fine.
|
|
95
96
|
|
|
97
|
+
`cjkFontUrl` is this package's own `noto-sans-jp.otf` (`import cjkFontUrl from
|
|
98
|
+
'@banou/media-player/noto-sans-jp.otf?no-inline&url'`), Noto Sans JP cut to the JIS X 0208 kanji. jassub's libass has no
|
|
99
|
+
system font fallback, so without it Japanese in a style whose font has no Japanese, which is how releases set song
|
|
100
|
+
lyrics, draws as empty boxes. It is fetched only once the selected track shows CJK text, after `defaultFontUrl`,
|
|
101
|
+
and draws only the glyphs that face lacks.
|
|
102
|
+
|
|
96
103
|
`normalizerWorkletUrl` is this package's own `dist/volume-normalizer-worklet.js`, one plain module with no imports
|
|
97
104
|
that copies fine or imports as a url; see [the volume normalizer](#the-volume-normalizer).
|
|
98
105
|
|
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-AjFLuCdA.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 };
|
|
@@ -61,6 +61,7 @@ export type PlaybackOptions = {
|
|
|
61
61
|
/** jassub's non-SIMD build; without it subtitles fail rather than degrade on Safari before 16.4 */
|
|
62
62
|
jassubLegacyWasmUrl?: string;
|
|
63
63
|
defaultFontUrl?: string;
|
|
64
|
+
cjkFontUrl?: string;
|
|
64
65
|
bufferSize?: number;
|
|
65
66
|
audioStreamIndex?: number;
|
|
66
67
|
onReady?: () => void;
|
|
@@ -38,6 +38,14 @@ export type SubtitleRendererOptions = {
|
|
|
38
38
|
* given on `workerFetched`.
|
|
39
39
|
*/
|
|
40
40
|
defaultFontUrl?: string;
|
|
41
|
+
/**
|
|
42
|
+
* Noto Sans JP, `@banou/media-player/noto-sans-jp.otf`, for Japanese text the file's own fonts cannot draw.
|
|
43
|
+
*
|
|
44
|
+
* Fetched only once a line on the selected track holds CJK text, after `defaultFontUrl`. It draws only the
|
|
45
|
+
* glyphs `liberation sans` lacks, so a url that fails to load leaves those as boxes and changes nothing
|
|
46
|
+
* else. May be relative, as `defaultFontUrl`.
|
|
47
|
+
*/
|
|
48
|
+
cjkFontUrl?: string;
|
|
41
49
|
onStreams?: (streams: SubtitleStream[]) => void;
|
|
42
50
|
};
|
|
43
51
|
export type SubtitleRenderer = ReturnType<typeof createSubtitleRenderer>;
|