fix: update JASSUB

This commit is contained in:
ThaUnknown 2023-05-17 20:12:38 +02:00 committed by Bill Thornton (Rebase PR Action)
parent 2e6f5c6dbf
commit a737bbb523
4 changed files with 44 additions and 37 deletions

14
package-lock.json generated
View File

@ -36,7 +36,7 @@
"history": "5.3.0",
"hls.js": "1.4.3",
"intersection-observer": "0.12.2",
"jassub": "1.5.13",
"jassub": "1.7.0",
"jellyfin-apiclient": "1.10.0",
"jquery": "3.7.0",
"jstree": "3.3.15",
@ -10431,9 +10431,9 @@
}
},
"node_modules/jassub": {
"version": "1.5.13",
"resolved": "https://registry.npmjs.org/jassub/-/jassub-1.5.13.tgz",
"integrity": "sha512-mQM88BcYgppvpPG6VE+DPQm7r6QS65EBedbm13RE4lRIhdrnQ+ihWhBOZXYZe3SlGhg+ROIDRK8uY4dm9ER2XQ==",
"version": "1.7.0",
"resolved": "https://registry.npmjs.org/jassub/-/jassub-1.7.0.tgz",
"integrity": "sha512-ILno/cvF36lEbBIqdO2rbX8RC0H249nr0FyS1VPOhm6jfeJZODXdH0tOJSgKnKB50sxtLl44IeA0ge72LdZVPw==",
"dependencies": {
"rvfc-polyfill": "^1.0.4"
}
@ -27838,9 +27838,9 @@
"dev": true
},
"jassub": {
"version": "1.5.13",
"resolved": "https://registry.npmjs.org/jassub/-/jassub-1.5.13.tgz",
"integrity": "sha512-mQM88BcYgppvpPG6VE+DPQm7r6QS65EBedbm13RE4lRIhdrnQ+ihWhBOZXYZe3SlGhg+ROIDRK8uY4dm9ER2XQ==",
"version": "1.7.0",
"resolved": "https://registry.npmjs.org/jassub/-/jassub-1.7.0.tgz",
"integrity": "sha512-ILno/cvF36lEbBIqdO2rbX8RC0H249nr0FyS1VPOhm6jfeJZODXdH0tOJSgKnKB50sxtLl44IeA0ge72LdZVPw==",
"requires": {
"rvfc-polyfill": "^1.0.4"
}

View File

@ -92,7 +92,7 @@
"history": "5.3.0",
"hls.js": "1.4.3",
"intersection-observer": "0.12.2",
"jassub": "1.5.13",
"jassub": "1.7.0",
"jellyfin-apiclient": "1.10.0",
"jquery": "3.7.0",
"jstree": "3.3.15",

View File

@ -1252,37 +1252,45 @@ export class HtmlVideoPlayer {
const fallbackFontList = apiClient.getUrl('/FallbackFont/Fonts', {
api_key: apiClient.accessToken()
});
const options = {
video: videoElement,
subUrl: getTextTrackUrl(track, item),
fonts: avaliableFonts,
fallbackFont: 'liberation sans',
availableFonts: { 'liberation sans': `${appRouter.baseUrl()}/default.woff2` },
// Disabled eslint compat, but is safe as corejs3 polyfills URL
// eslint-disable-next-line compat/compat
workerUrl: new URL('jassub/dist/jassub-worker.js', import.meta.url),
// eslint-disable-next-line compat/compat
legacyWorkerUrl: new URL('jassub/dist/jassub-worker-legacy.js', import.meta.url),
timeOffset: (this._currentPlayOptions.transcodingOffsetTicks || 0) / 10000000,
// new jassub options; override all, even defaults
blendMode: 'js',
asyncRender: true,
// firefox implements offscreen canvas, but not according to spec which causes errors
offscreenRender: !browser.firefox,
// RVFC is polyfilled everywhere, but webOS 2 reports polyfill API's as functional even tho they aren't
onDemandRender: browser.web0sVersion !== 2,
useLocalFonts: true,
dropAllAnimations: false,
libassMemoryLimit: 40,
libassGlyphLimit: 40,
targetFps: 24,
prescaleFactor: 0.8,
prescaleHeightLimit: 1080,
maxRenderHeight: 2160
};
// TODO: replace with `event-target-polyfill` once https://github.com/benlesh/event-target-polyfill/pull/12 or 11 is merged
import('event-target-polyfill').then(() => {
import('jassub').then(({ default: JASSUB }) => {
// test SIMD support
JASSUB._test();
const options = {
video: videoElement,
subUrl: getTextTrackUrl(track, item),
fonts: avaliableFonts,
fallbackFont: 'liberation sans',
availableFonts: { 'liberation sans': `${appRouter.baseUrl()}/default.woff2` },
// Disabled eslint compat, but is safe as corejs3 polyfills URL
// eslint-disable-next-line compat/compat
workerUrl: new URL('jassub/dist/jassub-worker.js', import.meta.url),
// eslint-disable-next-line compat/compat
wasmUrl: new URL('jassub/dist/jassub-worker.wasm', import.meta.url),
// eslint-disable-next-line compat/compat
legacyWasmUrl: new URL('jassub/dist/jassub-worker.wasm.js', import.meta.url),
// eslint-disable-next-line compat/compat
modernWasmUrl : new URL('jassub/dist/jassub-worker-modern.wasm', import.meta.url),
timeOffset: (this._currentPlayOptions.transcodingOffsetTicks || 0) / 10000000,
// new jassub options; override all, even defaults
blendMode: 'js',
asyncRender: true,
offscreenRender: true,
// RVFC is polyfilled everywhere, but webOS 2 reports polyfill API's as functional even tho they aren't
onDemandRender: browser.web0sVersion !== 2,
useLocalFonts: true,
dropAllAnimations: false,
dropAllBlur: !JASSUB._supportsSIMD,
libassMemoryLimit: 40,
libassGlyphLimit: 40,
targetFps: 24,
prescaleFactor: 0.8,
prescaleHeightLimit: 1080,
maxRenderHeight: 2160
};
Promise.all([
apiClient.getNamedConfiguration('encoding'),
// Worker in Tizen 5 doesn't resolve relative path with async request

View File

@ -12,7 +12,6 @@ const Assets = [
];
const JassubWasm = [
'jassub/dist/jassub-worker.wasm',
'jassub/dist/default.woff2'
];