diff --git a/package-lock.json b/package-lock.json index cd104e0f34..65e6ed1c8d 100644 --- a/package-lock.json +++ b/package-lock.json @@ -45,7 +45,7 @@ "jquery": "3.7.1", "jstree": "3.3.16", "libarchive.js": "2.0.2", - "libpgs": "0.2.0", + "libpgs": "0.2.1", "lodash-es": "4.17.21", "markdown-it": "14.1.0", "material-design-icons-iconfont": "6.7.0", @@ -141,7 +141,8 @@ }, "../libpgs-js": { "name": "libpgs", - "version": "0.2.0", + "version": "0.2.1", + "extraneous": true, "license": "MIT", "devDependencies": { "@tsconfig/recommended": "^1.0.6", @@ -14989,8 +14990,10 @@ } }, "node_modules/libpgs": { - "resolved": "../libpgs-js", - "link": true + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/libpgs/-/libpgs-0.2.1.tgz", + "integrity": "sha512-4aYbQZ7UavFTFCmr1uqTJpQWjtbt1mefvjYWJl4nq3uPVWKp5L/GeGrVWPinoNd2fAXAzuMmvjgKwuYaGff2BQ==", + "license": "MIT" }, "node_modules/lie": { "version": "3.1.1", @@ -36551,18 +36554,9 @@ } }, "libpgs": { - "version": "file:../libpgs-js", - "requires": { - "@tsconfig/recommended": "^1.0.6", - "@types/jest": "^29.5.12", - "jest": "^29.7.0", - "ts-jest": "^29.1.4", - "ts-loader": "^9.5.1", - "ts-node": "^10.9.2", - "typescript": "^5.4.5", - "webpack": "^5.91.0", - "webpack-cli": "^5.1.4" - } + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/libpgs/-/libpgs-0.2.1.tgz", + "integrity": "sha512-4aYbQZ7UavFTFCmr1uqTJpQWjtbt1mefvjYWJl4nq3uPVWKp5L/GeGrVWPinoNd2fAXAzuMmvjgKwuYaGff2BQ==" }, "lie": { "version": "3.1.1", diff --git a/package.json b/package.json index 15fb8288a8..dfd10fd4fd 100644 --- a/package.json +++ b/package.json @@ -106,6 +106,7 @@ "jquery": "3.7.1", "jstree": "3.3.16", "libarchive.js": "2.0.2", + "libpgs": "0.2.1", "lodash-es": "4.17.21", "markdown-it": "14.1.0", "material-design-icons-iconfont": "6.7.0", @@ -123,8 +124,7 @@ "swiper": "11.1.12", "usehooks-ts": "3.1.0", "webcomponents.js": "0.7.24", - "whatwg-fetch": "3.6.20", - "libpgs": "0.2.0" + "whatwg-fetch": "3.6.20" }, "optionalDependencies": { "sass-embedded": "1.77.8" diff --git a/src/plugins/htmlVideoPlayer/plugin.js b/src/plugins/htmlVideoPlayer/plugin.js index 3aa7873702..be67007dbd 100644 --- a/src/plugins/htmlVideoPlayer/plugin.js +++ b/src/plugins/htmlVideoPlayer/plugin.js @@ -594,6 +594,9 @@ export class HtmlVideoPlayer { if (this.#currentAssRenderer) { this.updateCurrentTrackOffset(offsetValue); this.#currentAssRenderer.timeOffset = (this._currentPlayOptions.transcodingOffsetTicks || 0) / 10000000 + offsetValue; + } else if (this.#currentPgsRenderer) { + this.updateCurrentTrackOffset(offsetValue); + this.#currentPgsRenderer.timeOffset = (this._currentPlayOptions.transcodingOffsetTicks || 0) / 10000000 + offsetValue; } else { const trackElements = this.getTextTracks(); // if .vtt currently rendering @@ -1333,7 +1336,8 @@ export class HtmlVideoPlayer { import('libpgs').then((libpgs) => { const options = { video: videoElement, - subUrl: getTextTrackUrl(track, item) + subUrl: getTextTrackUrl(track, item), + timeOffset: (this._currentPlayOptions.transcodingOffsetTicks || 0) / 10000000 }; this.#currentPgsRenderer = new libpgs.PgsRenderer(options); });