chore: update JASSUB
fix: error event handling fix: default font
This commit is contained in:
parent
bcc4f87605
commit
71e9b46a81
4 changed files with 31 additions and 15 deletions
26
package-lock.json
generated
26
package-lock.json
generated
|
@ -31,7 +31,7 @@
|
||||||
"history": "5.3.0",
|
"history": "5.3.0",
|
||||||
"hls.js": "0.14.17",
|
"hls.js": "0.14.17",
|
||||||
"intersection-observer": "0.12.2",
|
"intersection-observer": "0.12.2",
|
||||||
"jassub": "1.5.1",
|
"jassub": "1.5.3",
|
||||||
"jellyfin-apiclient": "1.10.0",
|
"jellyfin-apiclient": "1.10.0",
|
||||||
"jquery": "3.6.3",
|
"jquery": "3.6.3",
|
||||||
"jstree": "3.3.15",
|
"jstree": "3.3.15",
|
||||||
|
@ -7293,6 +7293,11 @@
|
||||||
"es5-ext": "~0.10.14"
|
"es5-ext": "~0.10.14"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"node_modules/event-target-polyfill": {
|
||||||
|
"version": "0.0.3",
|
||||||
|
"resolved": "https://registry.npmjs.org/event-target-polyfill/-/event-target-polyfill-0.0.3.tgz",
|
||||||
|
"integrity": "sha512-ZMc6UuvmbinrCk4RzGyVmRyIsAyxMRlp4CqSrcQRO8Dy0A9ldbiRy5kdtBj4OtP7EClGdqGfIqo9JmOClMsGLQ=="
|
||||||
|
},
|
||||||
"node_modules/eventemitter3": {
|
"node_modules/eventemitter3": {
|
||||||
"version": "4.0.7",
|
"version": "4.0.7",
|
||||||
"resolved": "https://registry.npmjs.org/eventemitter3/-/eventemitter3-4.0.7.tgz",
|
"resolved": "https://registry.npmjs.org/eventemitter3/-/eventemitter3-4.0.7.tgz",
|
||||||
|
@ -9650,10 +9655,11 @@
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/jassub": {
|
"node_modules/jassub": {
|
||||||
"version": "1.5.1",
|
"version": "1.5.3",
|
||||||
"resolved": "https://registry.npmjs.org/jassub/-/jassub-1.5.1.tgz",
|
"resolved": "https://registry.npmjs.org/jassub/-/jassub-1.5.3.tgz",
|
||||||
"integrity": "sha512-li8NUMm9JYHELRrsEEd9+8wX/PdN3H7JKE1V3Hwm9S7QmTr1Rx2VRU9AeiwJbZpxp9CcVSTyw0xFykluDGItHg==",
|
"integrity": "sha512-RADNYFjuQgQmA2Jn7/m4X1cn6a24fvvxcxL0A/q4In++SqHsOwIi40oyYLu7T63Abs5dagONTAAb9TGYBZsRKA==",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
|
"event-target-polyfill": "^0.0.3",
|
||||||
"rvfc-polyfill": "^1.0.4"
|
"rvfc-polyfill": "^1.0.4"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
@ -24492,6 +24498,11 @@
|
||||||
"es5-ext": "~0.10.14"
|
"es5-ext": "~0.10.14"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"event-target-polyfill": {
|
||||||
|
"version": "0.0.3",
|
||||||
|
"resolved": "https://registry.npmjs.org/event-target-polyfill/-/event-target-polyfill-0.0.3.tgz",
|
||||||
|
"integrity": "sha512-ZMc6UuvmbinrCk4RzGyVmRyIsAyxMRlp4CqSrcQRO8Dy0A9ldbiRy5kdtBj4OtP7EClGdqGfIqo9JmOClMsGLQ=="
|
||||||
|
},
|
||||||
"eventemitter3": {
|
"eventemitter3": {
|
||||||
"version": "4.0.7",
|
"version": "4.0.7",
|
||||||
"resolved": "https://registry.npmjs.org/eventemitter3/-/eventemitter3-4.0.7.tgz",
|
"resolved": "https://registry.npmjs.org/eventemitter3/-/eventemitter3-4.0.7.tgz",
|
||||||
|
@ -26246,10 +26257,11 @@
|
||||||
"dev": true
|
"dev": true
|
||||||
},
|
},
|
||||||
"jassub": {
|
"jassub": {
|
||||||
"version": "1.5.1",
|
"version": "1.5.3",
|
||||||
"resolved": "https://registry.npmjs.org/jassub/-/jassub-1.5.1.tgz",
|
"resolved": "https://registry.npmjs.org/jassub/-/jassub-1.5.3.tgz",
|
||||||
"integrity": "sha512-li8NUMm9JYHELRrsEEd9+8wX/PdN3H7JKE1V3Hwm9S7QmTr1Rx2VRU9AeiwJbZpxp9CcVSTyw0xFykluDGItHg==",
|
"integrity": "sha512-RADNYFjuQgQmA2Jn7/m4X1cn6a24fvvxcxL0A/q4In++SqHsOwIi40oyYLu7T63Abs5dagONTAAb9TGYBZsRKA==",
|
||||||
"requires": {
|
"requires": {
|
||||||
|
"event-target-polyfill": "^0.0.3",
|
||||||
"rvfc-polyfill": "^1.0.4"
|
"rvfc-polyfill": "^1.0.4"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
|
@ -90,7 +90,7 @@
|
||||||
"history": "5.3.0",
|
"history": "5.3.0",
|
||||||
"hls.js": "0.14.17",
|
"hls.js": "0.14.17",
|
||||||
"intersection-observer": "0.12.2",
|
"intersection-observer": "0.12.2",
|
||||||
"jassub": "1.5.1",
|
"jassub": "1.5.3",
|
||||||
"jellyfin-apiclient": "1.10.0",
|
"jellyfin-apiclient": "1.10.0",
|
||||||
"jquery": "3.6.3",
|
"jquery": "3.6.3",
|
||||||
"jstree": "3.3.15",
|
"jstree": "3.3.15",
|
||||||
|
|
|
@ -1211,10 +1211,11 @@ function tryRemoveElement(elem) {
|
||||||
video: videoElement,
|
video: videoElement,
|
||||||
subUrl: getTextTrackUrl(track, item),
|
subUrl: getTextTrackUrl(track, item),
|
||||||
fonts: avaliableFonts,
|
fonts: avaliableFonts,
|
||||||
|
fallbackFont: 'liberation sans',
|
||||||
|
availableFonts: {'liberation sans': `${appRouter.baseUrl()}/libraries/default.woff2`},
|
||||||
workerUrl: `${appRouter.baseUrl()}/libraries/jassub-worker.js`,
|
workerUrl: `${appRouter.baseUrl()}/libraries/jassub-worker.js`,
|
||||||
legacyWorkerUrl: `${appRouter.baseUrl()}/libraries/jassub-worker-legacy.js`,
|
legacyWorkerUrl: `${appRouter.baseUrl()}/libraries/jassub-worker-legacy.js`,
|
||||||
timeOffset: (this._currentPlayOptions.transcodingOffsetTicks || 0) / 10000000,
|
timeOffset: (this._currentPlayOptions.transcodingOffsetTicks || 0) / 10000000,
|
||||||
|
|
||||||
// new jassub options; override all, even defaults
|
// new jassub options; override all, even defaults
|
||||||
blendMode: 'js',
|
blendMode: 'js',
|
||||||
asyncRender: true,
|
asyncRender: true,
|
||||||
|
@ -1240,6 +1241,12 @@ function tryRemoveElement(elem) {
|
||||||
options.workerUrl = workerUrl;
|
options.workerUrl = workerUrl;
|
||||||
options.legacyWorkerUrl = legacyWorkerUrl;
|
options.legacyWorkerUrl = legacyWorkerUrl;
|
||||||
|
|
||||||
|
const cleanup = () => {
|
||||||
|
this.#currentJASSUB.destroy();
|
||||||
|
this.#currentJASSUB = null;
|
||||||
|
onErrorInternal(this, 'mediadecodeerror');
|
||||||
|
};
|
||||||
|
|
||||||
if (config.EnableFallbackFont) {
|
if (config.EnableFallbackFont) {
|
||||||
apiClient.getJSON(fallbackFontList).then((fontFiles = []) => {
|
apiClient.getJSON(fallbackFontList).then((fontFiles = []) => {
|
||||||
fontFiles.forEach(font => {
|
fontFiles.forEach(font => {
|
||||||
|
@ -1249,16 +1256,12 @@ function tryRemoveElement(elem) {
|
||||||
avaliableFonts.push(fontUrl);
|
avaliableFonts.push(fontUrl);
|
||||||
});
|
});
|
||||||
this.#currentJASSUB = new JASSUB(options);
|
this.#currentJASSUB = new JASSUB(options);
|
||||||
|
this.#currentJASSUB.addEventListener('error', cleanup, { once: true });
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
this.#currentJASSUB = new JASSUB(options);
|
this.#currentJASSUB = new JASSUB(options);
|
||||||
|
this.#currentJASSUB.addEventListener('error', cleanup, { once: true });
|
||||||
}
|
}
|
||||||
|
|
||||||
this.#currentJASSUB.addEventListener('error', ()=>{
|
|
||||||
this.#currentJASSUB.destroy();
|
|
||||||
this.#currentJASSUB = null;
|
|
||||||
onErrorInternal(this, 'mediadecodeerror');
|
|
||||||
}, { once: true });
|
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
|
@ -12,6 +12,7 @@ const Assets = [
|
||||||
'jassub/dist/jassub-worker.wasm',
|
'jassub/dist/jassub-worker.wasm',
|
||||||
'jassub/dist/jassub-worker-legacy.js',
|
'jassub/dist/jassub-worker-legacy.js',
|
||||||
'jassub/dist/jassub-worker-legacy.mem',
|
'jassub/dist/jassub-worker-legacy.mem',
|
||||||
|
'jassub/dist/default.woff2',
|
||||||
'pdfjs-dist/build/pdf.worker.js'
|
'pdfjs-dist/build/pdf.worker.js'
|
||||||
];
|
];
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue