libbitsub 1.11.0 → 1.12.0
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 +113 -16
- package/dist/index.d.ts +3 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3 -3
- package/dist/index.js.map +1 -1
- package/dist/integrations/react.d.ts.map +1 -1
- package/dist/integrations/react.js +7 -1
- package/dist/integrations/react.js.map +1 -1
- package/dist/integrations/shared.d.ts +2 -2
- package/dist/integrations/shared.d.ts.map +1 -1
- package/dist/integrations/shared.js.map +1 -1
- package/dist/ts/capabilities.d.ts +8 -0
- package/dist/ts/capabilities.d.ts.map +1 -0
- package/dist/ts/capabilities.js +105 -0
- package/dist/ts/capabilities.js.map +1 -0
- package/dist/ts/parsers.d.ts +39 -2
- package/dist/ts/parsers.d.ts.map +1 -1
- package/dist/ts/parsers.js +229 -1
- package/dist/ts/parsers.js.map +1 -1
- package/dist/ts/renderers.d.ts +128 -10
- package/dist/ts/renderers.d.ts.map +1 -1
- package/dist/ts/renderers.js +1341 -138
- package/dist/ts/renderers.js.map +1 -1
- package/dist/ts/types.d.ts +159 -6
- package/dist/ts/types.d.ts.map +1 -1
- package/dist/ts/utils.d.ts.map +1 -1
- package/dist/ts/utils.js +98 -2
- package/dist/ts/utils.js.map +1 -1
- package/dist/ts/video-frame-scheduler.d.ts +35 -0
- package/dist/ts/video-frame-scheduler.d.ts.map +1 -0
- package/dist/ts/video-frame-scheduler.js +98 -0
- package/dist/ts/video-frame-scheduler.js.map +1 -0
- package/dist/ts/worker.d.ts.map +1 -1
- package/dist/ts/worker.js +394 -0
- package/dist/ts/worker.js.map +1 -1
- package/dist/wrapper.d.ts +4 -3
- package/dist/wrapper.d.ts.map +1 -1
- package/dist/wrapper.js +3 -2
- package/dist/wrapper.js.map +1 -1
- package/package.json +3 -2
- package/pkg/README.md +113 -16
- package/pkg/libbitsub.d.ts +51 -1
- package/pkg/libbitsub.js +178 -3
- package/pkg/libbitsub_bg.wasm +0 -0
- package/pkg/libbitsub_bg.wasm.d.ts +21 -0
- package/pkg/package.json +4 -4
- package/src/integrations/react.tsx +7 -1
- package/src/integrations/shared.ts +2 -1
- package/src/wrapper.ts +22 -2
package/pkg/package.json
CHANGED
|
@@ -4,8 +4,8 @@
|
|
|
4
4
|
"collaborators": [
|
|
5
5
|
"altqx"
|
|
6
6
|
],
|
|
7
|
-
"description": "High-performance WASM renderer for graphical subtitles (PGS and
|
|
8
|
-
"version": "1.
|
|
7
|
+
"description": "High-performance WASM renderer for graphical subtitles (PGS, VobSub, and DVB)",
|
|
8
|
+
"version": "1.12.0",
|
|
9
9
|
"license": "MIT",
|
|
10
10
|
"repository": {
|
|
11
11
|
"type": "git",
|
|
@@ -24,8 +24,8 @@
|
|
|
24
24
|
"keywords": [
|
|
25
25
|
"pgs",
|
|
26
26
|
"vobsub",
|
|
27
|
+
"dvb",
|
|
27
28
|
"subtitle",
|
|
28
|
-
"wasm"
|
|
29
|
-
"rendering"
|
|
29
|
+
"wasm"
|
|
30
30
|
]
|
|
31
31
|
}
|
|
@@ -48,6 +48,10 @@ function sourceKey(source: BitSubReactSource | null | undefined): string {
|
|
|
48
48
|
hasIdxContent: Boolean(source.idxContent),
|
|
49
49
|
cacheLimit: source.cacheLimit ?? null,
|
|
50
50
|
timeOffset: source.timeOffset ?? null,
|
|
51
|
+
frameAwareSync: source.frameAwareSync ?? null,
|
|
52
|
+
backend: source.backend ?? null,
|
|
53
|
+
devicePixelRatioCap: source.devicePixelRatioCap ?? null,
|
|
54
|
+
offscreenRender: source.offscreenRender ?? null,
|
|
51
55
|
streamingLoad: source.streamingLoad ?? null,
|
|
52
56
|
rangeRequests: source.rangeRequests ?? null,
|
|
53
57
|
debug: source.debug ?? null,
|
|
@@ -83,6 +87,8 @@ export function useBitSub(
|
|
|
83
87
|
const enabled = options?.enabled !== false
|
|
84
88
|
const key = sourceKey(options)
|
|
85
89
|
const displaySettings = options?.displaySettings
|
|
90
|
+
const container = options?.container
|
|
91
|
+
const canvas = options?.canvas
|
|
86
92
|
|
|
87
93
|
useEffect(() => {
|
|
88
94
|
setError(null)
|
|
@@ -135,7 +141,7 @@ export function useBitSub(
|
|
|
135
141
|
setController(null)
|
|
136
142
|
}
|
|
137
143
|
// key captures source identity; callback props stay fresh via refs
|
|
138
|
-
}, [videoRef, key, enabled])
|
|
144
|
+
}, [videoRef, key, enabled, container, canvas])
|
|
139
145
|
|
|
140
146
|
useEffect(() => {
|
|
141
147
|
if (displaySettings) {
|
|
@@ -6,6 +6,7 @@
|
|
|
6
6
|
import {
|
|
7
7
|
createAutoSubtitleRenderer,
|
|
8
8
|
type AutoVideoSubtitleOptions,
|
|
9
|
+
type DvbRenderer,
|
|
9
10
|
type PgsRenderer,
|
|
10
11
|
type SubtitleDisplaySettings,
|
|
11
12
|
type SubtitleRendererStats,
|
|
@@ -13,7 +14,7 @@ import {
|
|
|
13
14
|
} from '../wrapper'
|
|
14
15
|
|
|
15
16
|
/** High-level renderer produced by integrations. */
|
|
16
|
-
export type BitSubRenderer = PgsRenderer | VobSubRenderer
|
|
17
|
+
export type BitSubRenderer = PgsRenderer | VobSubRenderer | DvbRenderer
|
|
17
18
|
|
|
18
19
|
/** Subtitle source + renderer options without a bound video element. */
|
|
19
20
|
export type BitSubSourceOptions = Omit<AutoVideoSubtitleOptions, 'video'>
|
package/src/wrapper.ts
CHANGED
|
@@ -8,6 +8,7 @@ export type {
|
|
|
8
8
|
AssetFetchStrategy,
|
|
9
9
|
AutoSubtitleSource,
|
|
10
10
|
AutoVideoSubtitleOptions,
|
|
11
|
+
LiveSubtitleRenderer,
|
|
11
12
|
OpenedSubtitles,
|
|
12
13
|
SubtitleAspectMode,
|
|
13
14
|
SubtitleCacheStats,
|
|
@@ -34,6 +35,10 @@ export type {
|
|
|
34
35
|
SubtitleRendererBackend,
|
|
35
36
|
SubtitleRendererEvent,
|
|
36
37
|
SubtitleRendererStatsSnapshot,
|
|
38
|
+
SubtitleSynchronizationMode,
|
|
39
|
+
SubtitleStreamChunk,
|
|
40
|
+
RuntimeCapabilities,
|
|
41
|
+
SubtitlePresentPath,
|
|
37
42
|
VideoSubtitleOptions,
|
|
38
43
|
VideoVobSubOptions,
|
|
39
44
|
RenderResult,
|
|
@@ -51,14 +56,29 @@ export { warmup, ready, isWorkerAvailable, isWorkerReady } from './ts/worker'
|
|
|
51
56
|
// Re-export WebGPU utilities
|
|
52
57
|
export { isWebGPUSupported } from './ts/webgpu-renderer'
|
|
53
58
|
|
|
59
|
+
export {
|
|
60
|
+
getRuntimeCapabilities,
|
|
61
|
+
canUseWorkerOffscreenRender,
|
|
62
|
+
isOffscreenCanvasSupported,
|
|
63
|
+
isOffscreenCanvas2DSupported,
|
|
64
|
+
isTransferControlToOffscreenSupported,
|
|
65
|
+
isCanvas2DSupported
|
|
66
|
+
} from './ts/capabilities'
|
|
67
|
+
|
|
54
68
|
// Re-export parsers
|
|
55
|
-
export { PgsParser, VobSubParserLowLevel, UnifiedSubtitleParser, openSubtitles } from './ts/parsers'
|
|
69
|
+
export { PgsParser, DvbParser, VobSubParserLowLevel, UnifiedSubtitleParser, openSubtitles } from './ts/parsers'
|
|
56
70
|
|
|
57
71
|
// Re-export frame export helpers
|
|
58
72
|
export { renderFrameData, toBlob, toCanvas, toImageBitmap } from './ts/frame-export'
|
|
59
73
|
|
|
60
74
|
// Re-export renderers
|
|
61
|
-
export {
|
|
75
|
+
export {
|
|
76
|
+
PgsRenderer,
|
|
77
|
+
DvbRenderer,
|
|
78
|
+
VobSubRenderer,
|
|
79
|
+
createAutoSubtitleRenderer,
|
|
80
|
+
type SubtitleRendererStats
|
|
81
|
+
} from './ts/renderers'
|
|
62
82
|
|
|
63
83
|
// Re-export format detection utilities
|
|
64
84
|
export { detectSubtitleFormat } from './ts/utils'
|