From a3e7d8fc59d911544f924aece6f46e5644e68fd9 Mon Sep 17 00:00:00 2001 From: Ryan McCartney <33418788+ryanmccartney@users.noreply.github.com> Date: Fri, 24 Jan 2025 12:38:48 +0000 Subject: [PATCH 1/8] Use BBC fork of imsc.js --- package-lock.json | 31 ++++++++++++++++--------------- package.json | 2 +- 2 files changed, 17 insertions(+), 16 deletions(-) diff --git a/package-lock.json b/package-lock.json index 48cb38b8d0..63fcb6d601 100644 --- a/package-lock.json +++ b/package-lock.json @@ -17,7 +17,7 @@ "fast-deep-equal": "2.0.1", "foodoc": "^0.0.9", "html-entities": "^1.2.1", - "imsc": "^1.1.4", + "imsc": "github:bbc/imscJS#v1.0.11-2", "localforage": "^1.7.1", "path-browserify": "^1.0.1", "ua-parser-js": "^1.0.2" @@ -9777,11 +9777,12 @@ } }, "node_modules/imsc": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/imsc/-/imsc-1.1.4.tgz", - "integrity": "sha512-s/WbXG6IbeW6X/8sBJWcQD22mwRcnpI55b8Kr3sbcONUaeMLkpHle/PE1xcMN9HJrMc5idrCwNV7wtZ8EBsFnw==", + "name": "@bbc/smp-imsc", + "version": "1.0.11-2", + "resolved": "git+ssh://git@github.com/bbc/imscJS.git#62b83c2ac6793ccea67404dd4fa9649e89054a85", + "license": "BSD-2-Clause", "dependencies": { - "sax": "1.2.1" + "sax": "1.2.4" } }, "node_modules/imurmurhash": { @@ -15081,9 +15082,10 @@ } }, "node_modules/sax": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/sax/-/sax-1.2.1.tgz", - "integrity": "sha512-8I2a3LovHTOpm7NV5yOyO8IHqgVsfK4+UuySrXU8YXkSRX7k6hCV9b3HrkKCr3nMpgj+0bmocaJJWpvp1oc7ZA==" + "version": "1.2.4", + "resolved": "https://registry.npmjs.org/sax/-/sax-1.2.4.tgz", + "integrity": "sha512-NqVDv9TpANUjFm0N8uM5GxL36UgKi9/atZw+x7YFnQ8ckwFGKrl4xX4yWtrey3UJm5nP1kUbnYgLopqWNSRhWw==", + "license": "ISC" }, "node_modules/schema-utils": { "version": "4.0.0", @@ -26427,11 +26429,10 @@ } }, "imsc": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/imsc/-/imsc-1.1.4.tgz", - "integrity": "sha512-s/WbXG6IbeW6X/8sBJWcQD22mwRcnpI55b8Kr3sbcONUaeMLkpHle/PE1xcMN9HJrMc5idrCwNV7wtZ8EBsFnw==", + "version": "git+ssh://git@github.com/bbc/imscJS.git#62b83c2ac6793ccea67404dd4fa9649e89054a85", + "from": "imsc@github:bbc/imscJS#v1.0.11-2", "requires": { - "sax": "1.2.1" + "sax": "1.2.4" } }, "imurmurhash": { @@ -30543,9 +30544,9 @@ } }, "sax": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/sax/-/sax-1.2.1.tgz", - "integrity": "sha512-8I2a3LovHTOpm7NV5yOyO8IHqgVsfK4+UuySrXU8YXkSRX7k6hCV9b3HrkKCr3nMpgj+0bmocaJJWpvp1oc7ZA==" + "version": "1.2.4", + "resolved": "https://registry.npmjs.org/sax/-/sax-1.2.4.tgz", + "integrity": "sha512-NqVDv9TpANUjFm0N8uM5GxL36UgKi9/atZw+x7YFnQ8ckwFGKrl4xX4yWtrey3UJm5nP1kUbnYgLopqWNSRhWw==" }, "schema-utils": { "version": "4.0.0", diff --git a/package.json b/package.json index 4b649e036b..0a75cec6e6 100644 --- a/package.json +++ b/package.json @@ -67,7 +67,7 @@ "fast-deep-equal": "2.0.1", "foodoc": "^0.0.9", "html-entities": "^1.2.1", - "imsc": "^1.1.4", + "imsc": "github:bbc/imscJS#v1.0.11-2", "localforage": "^1.7.1", "path-browserify": "^1.0.1", "ua-parser-js": "^1.0.2" From 10c739dee436c3881bcc938f5092a8b42c204a4e Mon Sep 17 00:00:00 2001 From: Ryan McCartney Date: Tue, 24 Sep 2024 11:37:08 +0100 Subject: [PATCH 2/8] Expose imsc.js styling through Dash.js --- src/core/Settings.js | 22 +++++++++++++++++++++- src/streaming/text/TextTracks.js | 22 ++++++++++++++++------ 2 files changed, 37 insertions(+), 7 deletions(-) diff --git a/src/core/Settings.js b/src/core/Settings.js index 3f13f74376..ea432d9f25 100644 --- a/src/core/Settings.js +++ b/src/core/Settings.js @@ -503,7 +503,18 @@ import Events from './events/Events'; * Enable/disable subtitle rendering by default. * @property {boolean} [extendSegmentedCues=true] * Enable/disable patching of segmented cues in order to merge as a single cue by extending cue end time. - * @property {object} [webvtt={customRenderingEnabled=false}] + * @property {boolean} [imsc.displayForcedOnlyMode=false] + * Enable/disable forced only mode in IMSC captions. + * When true, only those captions where itts:forcedDisplay="true" will be displayed. + * @property {boolean} [imsc.enableRollUp=true] + * Enable/disable rollUp style display of IMSC captions. + * @property {number} [imsc.options.sizeAdjust=1] + * IMSC styling options - adjust text size, scales the text size and line padding + * @property {number} [imsc.options.lineHeightAdjust=1] + * IMSC styling options - scales the line height + * @property {number} [imsc.options.backgroundOpacityScale=1] + * IMSC styling options - scales the backgroundColor opacity + * @property {object} [webvtt.customRenderingEnabled=false] * Enables the custom rendering for WebVTT captions. For details refer to the "Subtitles and Captions" sample section of dash.js. * Custom WebVTT rendering requires the external library vtt.js that can be found in the contrib folder. */ @@ -982,6 +993,15 @@ function Settings() { text: { defaultEnabled: true, extendSegmentedCues: true, + imsc: { + displayForcedOnlyMode: false, + enableRollUp: true, + options: { + sizeAdjust: 1, + lineHeightAdjust: 1, + backgroundOpacityScale: 1 + }, + }, webvtt: { customRenderingEnabled: false } diff --git a/src/streaming/text/TextTracks.js b/src/streaming/text/TextTracks.js index 762407e722..0ade1a80bd 100644 --- a/src/streaming/text/TextTracks.js +++ b/src/streaming/text/TextTracks.js @@ -411,12 +411,22 @@ function TextTracks(config) { if (captionContainer) { const finalCue = document.createElement('div'); captionContainer.appendChild(finalCue); - previousISDState = renderHTML(cue.isd, finalCue, function (src) { - return _resolveImageSrc(cue, src); - }, captionContainer.clientHeight, captionContainer.clientWidth, false/*displayForcedOnlyMode*/, function (err) { - logger.info('renderCaption :', err); - //TODO add ErrorHandler management - }, previousISDState, true /*enableRollUp*/); + previousISDState = renderHTML( + cue.isd, + finalCue, + function (src) { + return _resolveImageSrc(cue, src) + }, + captionContainer.clientHeight, + captionContainer.clientWidth, + settings.get().streaming.text.imsc.displayForcedOnlyMode, + function (err) { + logger.info('renderCaption :', err) /*TODO: add ErrorHandler management*/ + }, + previousISDState, + settings.get().streaming.text.imsc.enableRollUp, + settings.get().streaming.text.imsc.options + ); finalCue.id = cue.cueID; eventBus.trigger(MediaPlayerEvents.CAPTION_RENDERED, { captionDiv: finalCue, currentTrackIdx }); } From bd87d18326bfa73acdcc63b7f4ff79ba09bbb01c Mon Sep 17 00:00:00 2001 From: Ryan McCartney <33418788+ryanmccartney@users.noreply.github.com> Date: Fri, 24 Jan 2025 12:47:56 +0000 Subject: [PATCH 3/8] Add styling example to samples --- samples/captioning/ttml-ebutt-styling.html | 202 +++++++++++++++++++++ samples/samples.json | 14 +- 2 files changed, 215 insertions(+), 1 deletion(-) create mode 100644 samples/captioning/ttml-ebutt-styling.html diff --git a/samples/captioning/ttml-ebutt-styling.html b/samples/captioning/ttml-ebutt-styling.html new file mode 100644 index 0000000000..e94ea76e57 --- /dev/null +++ b/samples/captioning/ttml-ebutt-styling.html @@ -0,0 +1,202 @@ + + + + + TTML Adjusting Text Size + + + + + + + + + + + + + + + +
+
+
+ +
+
+
+
+

TTML ENBUTT Styling

+

Example showing content with TTML captions and the ability to adjust their styling.

+ +
+ +
IMSC Settings
+ +
+
+ + +
+ +
+ + +
+
+ +
+ Size Adjust + +
+ +
+ Line Height Adjust + +
+ +
+ Background Opacity Scale + +
+ + +
+
+
+
+
+
+ +
+
+
+ +
+ 00:00:00 +
+ +
+
+ +
+ +
+ +
+
+ +
+
+ +
+ 00:00:00 +
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Player Config
+
+
+
+
+
+
+ © DASH-IF +
+
+
+ + + + diff --git a/samples/samples.json b/samples/samples.json index 403fe7f30c..551661099f 100644 --- a/samples/samples.json +++ b/samples/samples.json @@ -501,6 +501,18 @@ "Audio" ] }, + { + "title": "TTML EBU caption styling", + "description": "Example showing content with TTML captions and the ability to adjust their style.", + "href": "captioning/ttml-ebutt-styling.html", + "image": "lib/img/elephant-1.jpg", + "labels": [ + "VoD", + "Fragmented text", + "Video", + "Audio" + ] + }, { "title": "WebVTT Custom Rendering", "description": "This example shows how content with VTT captions can be played back by the dash.js player using the external vtt.js library. This enables VTT support on devices that do not provide native VTT support.", @@ -802,4 +814,4 @@ } ] } -] +] \ No newline at end of file From 2b41d8dfeafa18d3fb0df0086107e47bf4879ddc Mon Sep 17 00:00:00 2001 From: Ryan McCartney Date: Mon, 28 Apr 2025 11:40:51 +0100 Subject: [PATCH 4/8] Move imsc.js to peerDependencies --- package-lock.json | 436 +++------------------------------------------- package.json | 4 +- 2 files changed, 25 insertions(+), 415 deletions(-) diff --git a/package-lock.json b/package-lock.json index 63fcb6d601..c9c64d9184 100644 --- a/package-lock.json +++ b/package-lock.json @@ -17,7 +17,6 @@ "fast-deep-equal": "2.0.1", "foodoc": "^0.0.9", "html-entities": "^1.2.1", - "imsc": "github:bbc/imscJS#v1.0.11-2", "localforage": "^1.7.1", "path-browserify": "^1.0.1", "ua-parser-js": "^1.0.2" @@ -60,6 +59,9 @@ "webpack-dev-server": "^4.11.1", "webpack-merge": "^5.7.3", "yargs": "16.0.3" + }, + "peerDependencies": { + "imsc": "^1.1.4" } }, "node_modules/@babel/code-frame": { @@ -3713,18 +3715,6 @@ "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", "dev": true }, - "node_modules/@eslint/eslintrc/node_modules/strip-json-comments": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-3.1.1.tgz", - "integrity": "sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig==", - "dev": true, - "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, "node_modules/@icetee/ftp": { "version": "0.3.15", "resolved": "https://registry.npmjs.org/@icetee/ftp/-/ftp-0.3.15.tgz", @@ -3973,12 +3963,6 @@ "@types/node": "*" } }, - "node_modules/@types/color-name": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/@types/color-name/-/color-name-1.1.1.tgz", - "integrity": "sha512-rr+OQyAjxze7GgWrSaJwydHStIhHq2lvY3BOC2Mj7KnzI7XK0Uw1TOOdI9lDoajEbSWLiYgoo4f1R51erQfhPQ==", - "dev": true - }, "node_modules/@types/connect": { "version": "3.4.34", "resolved": "https://registry.npmjs.org/@types/connect/-/connect-3.4.34.tgz", @@ -5045,15 +5029,6 @@ "node": ">=8" } }, - "node_modules/babel-loader/node_modules/p-try": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/p-try/-/p-try-2.2.0.tgz", - "integrity": "sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ==", - "dev": true, - "engines": { - "node": ">=6" - } - }, "node_modules/babel-loader/node_modules/path-exists": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz", @@ -5548,15 +5523,6 @@ "integrity": "sha512-JvdAWfbXeIGaZ9cILp38HntZSFSo3mWg6xGcJJsd+d4aRMOqauag1C63dJfDw7OaMYwEbHMOxEZ1lqVRYP2OAw==", "dev": true }, - "node_modules/body-parser/node_modules/statuses": { - "version": "1.5.0", - "resolved": "https://registry.npmjs.org/statuses/-/statuses-1.5.0.tgz", - "integrity": "sha1-Fhx9rBd2Wf2YEfQ3cfqZOBR4Yow=", - "dev": true, - "engines": { - "node": ">= 0.6" - } - }, "node_modules/bonjour-service": { "version": "1.0.14", "resolved": "https://registry.npmjs.org/bonjour-service/-/bonjour-service-1.0.14.tgz", @@ -7675,18 +7641,6 @@ "node": ">=8" } }, - "node_modules/eslint/node_modules/strip-json-comments": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-3.1.1.tgz", - "integrity": "sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig==", - "dev": true, - "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, "node_modules/eslint/node_modules/supports-color": { "version": "7.2.0", "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", @@ -7991,24 +7945,6 @@ "node": ">= 0.6" } }, - "node_modules/express/node_modules/finalhandler": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/finalhandler/-/finalhandler-1.1.2.tgz", - "integrity": "sha512-aAWcW57uxVNrQZqFXjITpW3sIUQmHGG3qSb9mUah9MgMC4NeWhNOlNjXEYq3HjRAvL6arUviZGGJsBg6z0zsWA==", - "dev": true, - "dependencies": { - "debug": "2.6.9", - "encodeurl": "~1.0.2", - "escape-html": "~1.0.3", - "on-finished": "~2.3.0", - "parseurl": "~1.3.3", - "statuses": "~1.5.0", - "unpipe": "~1.0.0" - }, - "engines": { - "node": ">= 0.8" - } - }, "node_modules/express/node_modules/http-errors": { "version": "1.7.3", "resolved": "https://registry.npmjs.org/http-errors/-/http-errors-1.7.3.tgz", @@ -8058,15 +7994,6 @@ "node": ">=0.6" } }, - "node_modules/express/node_modules/range-parser": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/range-parser/-/range-parser-1.2.1.tgz", - "integrity": "sha512-Hrgsx+orqoygnmhFbKaHE6c296J+HTAQXoxEF6gNupROmmGJRoyzfG3ccAveqCBrwr/2yxQ5BVd/GTl5agOwSg==", - "dev": true, - "engines": { - "node": ">= 0.6" - } - }, "node_modules/express/node_modules/send": { "version": "0.17.1", "resolved": "https://registry.npmjs.org/send/-/send-0.17.1.tgz", @@ -8112,15 +8039,6 @@ "integrity": "sha512-JvdAWfbXeIGaZ9cILp38HntZSFSo3mWg6xGcJJsd+d4aRMOqauag1C63dJfDw7OaMYwEbHMOxEZ1lqVRYP2OAw==", "dev": true }, - "node_modules/express/node_modules/statuses": { - "version": "1.5.0", - "resolved": "https://registry.npmjs.org/statuses/-/statuses-1.5.0.tgz", - "integrity": "sha1-Fhx9rBd2Wf2YEfQ3cfqZOBR4Yow=", - "dev": true, - "engines": { - "node": ">= 0.6" - } - }, "node_modules/extend": { "version": "3.0.2", "resolved": "https://registry.npmjs.org/extend/-/extend-3.0.2.tgz", @@ -8454,53 +8372,6 @@ "node": "^10.12.0 || >=12.0.0" } }, - "node_modules/flat-cache/node_modules/glob": { - "version": "7.1.6", - "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.6.tgz", - "integrity": "sha512-LwaxwyZ72Lk7vZINtNNrywX0ZuLyStrdDtabefZKAY5ZGJhVtgdznluResxNmPitE0SAO+O26sWTHeKSI2wMBA==", - "dev": true, - "dependencies": { - "fs.realpath": "^1.0.0", - "inflight": "^1.0.4", - "inherits": "2", - "minimatch": "^3.0.4", - "once": "^1.3.0", - "path-is-absolute": "^1.0.0" - }, - "engines": { - "node": "*" - }, - "funding": { - "url": "https://github.com/sponsors/isaacs" - } - }, - "node_modules/flat-cache/node_modules/minimatch": { - "version": "3.0.4", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz", - "integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==", - "dev": true, - "dependencies": { - "brace-expansion": "^1.1.7" - }, - "engines": { - "node": "*" - } - }, - "node_modules/flat-cache/node_modules/rimraf": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-3.0.2.tgz", - "integrity": "sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==", - "dev": true, - "dependencies": { - "glob": "^7.1.3" - }, - "bin": { - "rimraf": "bin.js" - }, - "funding": { - "url": "https://github.com/sponsors/isaacs" - } - }, "node_modules/flatted": { "version": "3.2.7", "resolved": "https://registry.npmjs.org/flatted/-/flatted-3.2.7.tgz", @@ -9572,15 +9443,6 @@ "node": ">= 0.6" } }, - "node_modules/http-errors/node_modules/statuses": { - "version": "1.5.0", - "resolved": "https://registry.npmjs.org/statuses/-/statuses-1.5.0.tgz", - "integrity": "sha1-Fhx9rBd2Wf2YEfQ3cfqZOBR4Yow=", - "dev": true, - "engines": { - "node": ">= 0.6" - } - }, "node_modules/http-parser-js": { "version": "0.5.8", "resolved": "https://registry.npmjs.org/http-parser-js/-/http-parser-js-0.5.8.tgz", @@ -9777,12 +9639,13 @@ } }, "node_modules/imsc": { - "name": "@bbc/smp-imsc", - "version": "1.0.11-2", - "resolved": "git+ssh://git@github.com/bbc/imscJS.git#62b83c2ac6793ccea67404dd4fa9649e89054a85", + "version": "1.1.5", + "resolved": "https://registry.npmjs.org/imsc/-/imsc-1.1.5.tgz", + "integrity": "sha512-V8je+CGkcvGhgl2C1GlhqFFiUOIEdwXbXLiu1Fcubvvbo+g9inauqT3l0pNYXGoLPBj3jxtZz9t+wCopMkwadQ==", "license": "BSD-2-Clause", + "peer": true, "dependencies": { - "sax": "1.2.4" + "sax": "1.2.1" } }, "node_modules/imurmurhash": { @@ -14798,23 +14661,6 @@ "node": ">=8" } }, - "node_modules/replace-in-file/node_modules/wrap-ansi": { - "version": "7.0.0", - "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz", - "integrity": "sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==", - "dev": true, - "dependencies": { - "ansi-styles": "^4.0.0", - "string-width": "^4.1.0", - "strip-ansi": "^6.0.0" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/chalk/wrap-ansi?sponsor=1" - } - }, "node_modules/replace-in-file/node_modules/y18n": { "version": "5.0.7", "resolved": "https://registry.npmjs.org/y18n/-/y18n-5.0.7.tgz", @@ -14842,15 +14688,6 @@ "node": ">=10" } }, - "node_modules/replace-in-file/node_modules/yargs-parser": { - "version": "20.2.7", - "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-20.2.7.tgz", - "integrity": "sha512-FiNkvbeHzB/syOjIUxFDCnhSfzAL8R5vs40MgLFBorXACCOAEaWu0gRZl14vG8MR9AOJIZbmkjhusqBYZ3HTHw==", - "dev": true, - "engines": { - "node": ">=10" - } - }, "node_modules/require-directory": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz", @@ -15082,10 +14919,11 @@ } }, "node_modules/sax": { - "version": "1.2.4", - "resolved": "https://registry.npmjs.org/sax/-/sax-1.2.4.tgz", - "integrity": "sha512-NqVDv9TpANUjFm0N8uM5GxL36UgKi9/atZw+x7YFnQ8ckwFGKrl4xX4yWtrey3UJm5nP1kUbnYgLopqWNSRhWw==", - "license": "ISC" + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/sax/-/sax-1.2.1.tgz", + "integrity": "sha512-8I2a3LovHTOpm7NV5yOyO8IHqgVsfK4+UuySrXU8YXkSRX7k6hCV9b3HrkKCr3nMpgj+0bmocaJJWpvp1oc7ZA==", + "license": "ISC", + "peer": true }, "node_modules/schema-utils": { "version": "4.0.0", @@ -18326,22 +18164,6 @@ "node": ">=8" } }, - "node_modules/yargs/node_modules/ansi-styles": { - "version": "4.2.1", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.2.1.tgz", - "integrity": "sha512-9VGjrMsG1vePxcSweQsN20KY/c4zN0h9fLjqAbwbPfahM3t+NL+M9HC8xeXG2I8pX5NoamTGNuomEUFI7fcUjA==", - "dev": true, - "dependencies": { - "@types/color-name": "^1.1.1", - "color-convert": "^2.0.1" - }, - "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/chalk/ansi-styles?sponsor=1" - } - }, "node_modules/yargs/node_modules/cliui": { "version": "7.0.1", "resolved": "https://registry.npmjs.org/cliui/-/cliui-7.0.1.tgz", @@ -18353,33 +18175,6 @@ "wrap-ansi": "^7.0.0" } }, - "node_modules/yargs/node_modules/color-convert": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", - "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", - "dev": true, - "dependencies": { - "color-name": "~1.1.4" - }, - "engines": { - "node": ">=7.0.0" - } - }, - "node_modules/yargs/node_modules/color-name": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", - "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", - "dev": true - }, - "node_modules/yargs/node_modules/get-caller-file": { - "version": "2.0.5", - "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-2.0.5.tgz", - "integrity": "sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==", - "dev": true, - "engines": { - "node": "6.* || 8.* || >= 10.*" - } - }, "node_modules/yargs/node_modules/is-fullwidth-code-point": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", @@ -18415,23 +18210,6 @@ "node": ">=8" } }, - "node_modules/yargs/node_modules/wrap-ansi": { - "version": "7.0.0", - "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz", - "integrity": "sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==", - "dev": true, - "dependencies": { - "ansi-styles": "^4.0.0", - "string-width": "^4.1.0", - "strip-ansi": "^6.0.0" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/chalk/wrap-ansi?sponsor=1" - } - }, "node_modules/yargs/node_modules/y18n": { "version": "5.0.2", "resolved": "https://registry.npmjs.org/y18n/-/y18n-5.0.2.tgz", @@ -18441,15 +18219,6 @@ "node": ">=10" } }, - "node_modules/yargs/node_modules/yargs-parser": { - "version": "20.2.1", - "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-20.2.1.tgz", - "integrity": "sha512-yYsjuSkjbLMBp16eaOt7/siKTjNVjMm3SoJnIg3sEh/JsvqVVDyjRKmaJV4cl+lNIgq6QEco2i3gDebJl7/vLA==", - "dev": true, - "engines": { - "node": ">=10" - } - }, "node_modules/yauzl": { "version": "2.10.0", "resolved": "https://registry.npmjs.org/yauzl/-/yauzl-2.10.0.tgz", @@ -21597,12 +21366,6 @@ "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", "dev": true - }, - "strip-json-comments": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-3.1.1.tgz", - "integrity": "sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig==", - "dev": true } } }, @@ -21834,12 +21597,6 @@ "@types/node": "*" } }, - "@types/color-name": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/@types/color-name/-/color-name-1.1.1.tgz", - "integrity": "sha512-rr+OQyAjxze7GgWrSaJwydHStIhHq2lvY3BOC2Mj7KnzI7XK0Uw1TOOdI9lDoajEbSWLiYgoo4f1R51erQfhPQ==", - "dev": true - }, "@types/connect": { "version": "3.4.34", "resolved": "https://registry.npmjs.org/@types/connect/-/connect-3.4.34.tgz", @@ -22744,12 +22501,6 @@ "p-limit": "^2.2.0" } }, - "p-try": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/p-try/-/p-try-2.2.0.tgz", - "integrity": "sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ==", - "dev": true - }, "path-exists": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz", @@ -23160,12 +22911,6 @@ "resolved": "https://registry.npmjs.org/setprototypeof/-/setprototypeof-1.1.1.tgz", "integrity": "sha512-JvdAWfbXeIGaZ9cILp38HntZSFSo3mWg6xGcJJsd+d4aRMOqauag1C63dJfDw7OaMYwEbHMOxEZ1lqVRYP2OAw==", "dev": true - }, - "statuses": { - "version": "1.5.0", - "resolved": "https://registry.npmjs.org/statuses/-/statuses-1.5.0.tgz", - "integrity": "sha1-Fhx9rBd2Wf2YEfQ3cfqZOBR4Yow=", - "dev": true } } }, @@ -24696,12 +24441,6 @@ "ansi-regex": "^5.0.0" } }, - "strip-json-comments": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-3.1.1.tgz", - "integrity": "sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig==", - "dev": true - }, "supports-color": { "version": "7.2.0", "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", @@ -25049,21 +24788,6 @@ "integrity": "sha512-+Hp8fLp57wnUSt0tY0tHEXh4voZRDnoIrZPqlo3DPiI4y9lwg/jqx+1Om94/W6ZaPDOUbnjOt/99w66zk+l1Xg==", "dev": true }, - "finalhandler": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/finalhandler/-/finalhandler-1.1.2.tgz", - "integrity": "sha512-aAWcW57uxVNrQZqFXjITpW3sIUQmHGG3qSb9mUah9MgMC4NeWhNOlNjXEYq3HjRAvL6arUviZGGJsBg6z0zsWA==", - "dev": true, - "requires": { - "debug": "2.6.9", - "encodeurl": "~1.0.2", - "escape-html": "~1.0.3", - "on-finished": "~2.3.0", - "parseurl": "~1.3.3", - "statuses": "~1.5.0", - "unpipe": "~1.0.0" - } - }, "http-errors": { "version": "1.7.3", "resolved": "https://registry.npmjs.org/http-errors/-/http-errors-1.7.3.tgz", @@ -25101,12 +24825,6 @@ "integrity": "sha512-VCdBRNFTX1fyE7Nb6FYoURo/SPe62QCaAyzJvUjwRaIsc+NePBEniHlvxFmmX56+HZphIGtV0XeCirBtpDrTyQ==", "dev": true }, - "range-parser": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/range-parser/-/range-parser-1.2.1.tgz", - "integrity": "sha512-Hrgsx+orqoygnmhFbKaHE6c296J+HTAQXoxEF6gNupROmmGJRoyzfG3ccAveqCBrwr/2yxQ5BVd/GTl5agOwSg==", - "dev": true - }, "send": { "version": "0.17.1", "resolved": "https://registry.npmjs.org/send/-/send-0.17.1.tgz", @@ -25145,12 +24863,6 @@ "resolved": "https://registry.npmjs.org/setprototypeof/-/setprototypeof-1.1.1.tgz", "integrity": "sha512-JvdAWfbXeIGaZ9cILp38HntZSFSo3mWg6xGcJJsd+d4aRMOqauag1C63dJfDw7OaMYwEbHMOxEZ1lqVRYP2OAw==", "dev": true - }, - "statuses": { - "version": "1.5.0", - "resolved": "https://registry.npmjs.org/statuses/-/statuses-1.5.0.tgz", - "integrity": "sha1-Fhx9rBd2Wf2YEfQ3cfqZOBR4Yow=", - "dev": true } } }, @@ -25413,40 +25125,6 @@ "requires": { "flatted": "^3.1.0", "rimraf": "^3.0.2" - }, - "dependencies": { - "glob": { - "version": "7.1.6", - "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.6.tgz", - "integrity": "sha512-LwaxwyZ72Lk7vZINtNNrywX0ZuLyStrdDtabefZKAY5ZGJhVtgdznluResxNmPitE0SAO+O26sWTHeKSI2wMBA==", - "dev": true, - "requires": { - "fs.realpath": "^1.0.0", - "inflight": "^1.0.4", - "inherits": "2", - "minimatch": "^3.0.4", - "once": "^1.3.0", - "path-is-absolute": "^1.0.0" - } - }, - "minimatch": { - "version": "3.0.4", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz", - "integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==", - "dev": true, - "requires": { - "brace-expansion": "^1.1.7" - } - }, - "rimraf": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-3.0.2.tgz", - "integrity": "sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==", - "dev": true, - "requires": { - "glob": "^7.1.3" - } - } } }, "flatted": { @@ -26278,14 +25956,6 @@ "inherits": "2.0.3", "setprototypeof": "1.1.0", "statuses": ">= 1.4.0 < 2" - }, - "dependencies": { - "statuses": { - "version": "1.5.0", - "resolved": "https://registry.npmjs.org/statuses/-/statuses-1.5.0.tgz", - "integrity": "sha1-Fhx9rBd2Wf2YEfQ3cfqZOBR4Yow=", - "dev": true - } } }, "http-parser-js": { @@ -26429,10 +26099,12 @@ } }, "imsc": { - "version": "git+ssh://git@github.com/bbc/imscJS.git#62b83c2ac6793ccea67404dd4fa9649e89054a85", - "from": "imsc@github:bbc/imscJS#v1.0.11-2", + "version": "1.1.5", + "resolved": "https://registry.npmjs.org/imsc/-/imsc-1.1.5.tgz", + "integrity": "sha512-V8je+CGkcvGhgl2C1GlhqFFiUOIEdwXbXLiu1Fcubvvbo+g9inauqT3l0pNYXGoLPBj3jxtZz9t+wCopMkwadQ==", + "peer": true, "requires": { - "sax": "1.2.4" + "sax": "1.2.1" } }, "imurmurhash": { @@ -30321,17 +29993,6 @@ "has-flag": "^4.0.0" } }, - "wrap-ansi": { - "version": "7.0.0", - "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz", - "integrity": "sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==", - "dev": true, - "requires": { - "ansi-styles": "^4.0.0", - "string-width": "^4.1.0", - "strip-ansi": "^6.0.0" - } - }, "y18n": { "version": "5.0.7", "resolved": "https://registry.npmjs.org/y18n/-/y18n-5.0.7.tgz", @@ -30352,12 +30013,6 @@ "y18n": "^5.0.5", "yargs-parser": "^20.2.2" } - }, - "yargs-parser": { - "version": "20.2.7", - "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-20.2.7.tgz", - "integrity": "sha512-FiNkvbeHzB/syOjIUxFDCnhSfzAL8R5vs40MgLFBorXACCOAEaWu0gRZl14vG8MR9AOJIZbmkjhusqBYZ3HTHw==", - "dev": true } } }, @@ -30544,9 +30199,10 @@ } }, "sax": { - "version": "1.2.4", - "resolved": "https://registry.npmjs.org/sax/-/sax-1.2.4.tgz", - "integrity": "sha512-NqVDv9TpANUjFm0N8uM5GxL36UgKi9/atZw+x7YFnQ8ckwFGKrl4xX4yWtrey3UJm5nP1kUbnYgLopqWNSRhWw==" + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/sax/-/sax-1.2.1.tgz", + "integrity": "sha512-8I2a3LovHTOpm7NV5yOyO8IHqgVsfK4+UuySrXU8YXkSRX7k6hCV9b3HrkKCr3nMpgj+0bmocaJJWpvp1oc7ZA==", + "peer": true }, "schema-utils": { "version": "4.0.0", @@ -32943,16 +32599,6 @@ "integrity": "sha512-bY6fj56OUQ0hU1KjFNDQuJFezqKdrAyFdIevADiqrWHwSlbmBNMHp5ak2f40Pm8JTFyM2mqxkG6ngkHO11f/lg==", "dev": true }, - "ansi-styles": { - "version": "4.2.1", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.2.1.tgz", - "integrity": "sha512-9VGjrMsG1vePxcSweQsN20KY/c4zN0h9fLjqAbwbPfahM3t+NL+M9HC8xeXG2I8pX5NoamTGNuomEUFI7fcUjA==", - "dev": true, - "requires": { - "@types/color-name": "^1.1.1", - "color-convert": "^2.0.1" - } - }, "cliui": { "version": "7.0.1", "resolved": "https://registry.npmjs.org/cliui/-/cliui-7.0.1.tgz", @@ -32964,27 +32610,6 @@ "wrap-ansi": "^7.0.0" } }, - "color-convert": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", - "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", - "dev": true, - "requires": { - "color-name": "~1.1.4" - } - }, - "color-name": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", - "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", - "dev": true - }, - "get-caller-file": { - "version": "2.0.5", - "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-2.0.5.tgz", - "integrity": "sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==", - "dev": true - }, "is-fullwidth-code-point": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", @@ -33011,28 +32636,11 @@ "ansi-regex": "^5.0.0" } }, - "wrap-ansi": { - "version": "7.0.0", - "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz", - "integrity": "sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==", - "dev": true, - "requires": { - "ansi-styles": "^4.0.0", - "string-width": "^4.1.0", - "strip-ansi": "^6.0.0" - } - }, "y18n": { "version": "5.0.2", "resolved": "https://registry.npmjs.org/y18n/-/y18n-5.0.2.tgz", "integrity": "sha512-CkwaeZw6dQgqgPGeTWKMXCRmMcBgETFlTml1+ZOO+q7kGst8NREJ+eWwFNPVUQ4QGdAaklbqCZHH6Zuep1RjiA==", "dev": true - }, - "yargs-parser": { - "version": "20.2.1", - "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-20.2.1.tgz", - "integrity": "sha512-yYsjuSkjbLMBp16eaOt7/siKTjNVjMm3SoJnIg3sEh/JsvqVVDyjRKmaJV4cl+lNIgq6QEco2i3gDebJl7/vLA==", - "dev": true } } }, diff --git a/package.json b/package.json index 0a75cec6e6..246b35ea6e 100644 --- a/package.json +++ b/package.json @@ -67,11 +67,13 @@ "fast-deep-equal": "2.0.1", "foodoc": "^0.0.9", "html-entities": "^1.2.1", - "imsc": "github:bbc/imscJS#v1.0.11-2", "localforage": "^1.7.1", "path-browserify": "^1.0.1", "ua-parser-js": "^1.0.2" }, + "peerDependencies": { + "imsc": "^1.1.4" + }, "repository": { "type": "git", "url": "https://github.com/Dash-Industry-Forum/dash.js.git" From bb0646d17a0c219ef7d236ffaf21386d50d241f2 Mon Sep 17 00:00:00 2001 From: Ryan McCartney Date: Mon, 28 Apr 2025 11:45:30 +0100 Subject: [PATCH 5/8] Remove changes to imsc package in Dash.js --- package-lock.json | 12 +++--------- package.json | 4 +--- 2 files changed, 4 insertions(+), 12 deletions(-) diff --git a/package-lock.json b/package-lock.json index c9c64d9184..b597b638bf 100644 --- a/package-lock.json +++ b/package-lock.json @@ -17,6 +17,7 @@ "fast-deep-equal": "2.0.1", "foodoc": "^0.0.9", "html-entities": "^1.2.1", + "imsc": "^1.1.4", "localforage": "^1.7.1", "path-browserify": "^1.0.1", "ua-parser-js": "^1.0.2" @@ -59,9 +60,6 @@ "webpack-dev-server": "^4.11.1", "webpack-merge": "^5.7.3", "yargs": "16.0.3" - }, - "peerDependencies": { - "imsc": "^1.1.4" } }, "node_modules/@babel/code-frame": { @@ -9643,7 +9641,6 @@ "resolved": "https://registry.npmjs.org/imsc/-/imsc-1.1.5.tgz", "integrity": "sha512-V8je+CGkcvGhgl2C1GlhqFFiUOIEdwXbXLiu1Fcubvvbo+g9inauqT3l0pNYXGoLPBj3jxtZz9t+wCopMkwadQ==", "license": "BSD-2-Clause", - "peer": true, "dependencies": { "sax": "1.2.1" } @@ -14922,8 +14919,7 @@ "version": "1.2.1", "resolved": "https://registry.npmjs.org/sax/-/sax-1.2.1.tgz", "integrity": "sha512-8I2a3LovHTOpm7NV5yOyO8IHqgVsfK4+UuySrXU8YXkSRX7k6hCV9b3HrkKCr3nMpgj+0bmocaJJWpvp1oc7ZA==", - "license": "ISC", - "peer": true + "license": "ISC" }, "node_modules/schema-utils": { "version": "4.0.0", @@ -26102,7 +26098,6 @@ "version": "1.1.5", "resolved": "https://registry.npmjs.org/imsc/-/imsc-1.1.5.tgz", "integrity": "sha512-V8je+CGkcvGhgl2C1GlhqFFiUOIEdwXbXLiu1Fcubvvbo+g9inauqT3l0pNYXGoLPBj3jxtZz9t+wCopMkwadQ==", - "peer": true, "requires": { "sax": "1.2.1" } @@ -30201,8 +30196,7 @@ "sax": { "version": "1.2.1", "resolved": "https://registry.npmjs.org/sax/-/sax-1.2.1.tgz", - "integrity": "sha512-8I2a3LovHTOpm7NV5yOyO8IHqgVsfK4+UuySrXU8YXkSRX7k6hCV9b3HrkKCr3nMpgj+0bmocaJJWpvp1oc7ZA==", - "peer": true + "integrity": "sha512-8I2a3LovHTOpm7NV5yOyO8IHqgVsfK4+UuySrXU8YXkSRX7k6hCV9b3HrkKCr3nMpgj+0bmocaJJWpvp1oc7ZA==" }, "schema-utils": { "version": "4.0.0", diff --git a/package.json b/package.json index 246b35ea6e..4b649e036b 100644 --- a/package.json +++ b/package.json @@ -67,13 +67,11 @@ "fast-deep-equal": "2.0.1", "foodoc": "^0.0.9", "html-entities": "^1.2.1", + "imsc": "^1.1.4", "localforage": "^1.7.1", "path-browserify": "^1.0.1", "ua-parser-js": "^1.0.2" }, - "peerDependencies": { - "imsc": "^1.1.4" - }, "repository": { "type": "git", "url": "https://github.com/Dash-Industry-Forum/dash.js.git" From a1627382b1b931258892f9b23c6255fda0441539 Mon Sep 17 00:00:00 2001 From: Ryan McCartney Date: Mon, 12 May 2025 13:57:00 +0100 Subject: [PATCH 6/8] Make imscJS style options generic --- src/core/Settings.js | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) diff --git a/src/core/Settings.js b/src/core/Settings.js index bc0a830f6a..bace783002 100644 --- a/src/core/Settings.js +++ b/src/core/Settings.js @@ -513,12 +513,8 @@ import Events from './events/Events'; * When true, only those captions where itts:forcedDisplay="true" will be displayed. * @property {boolean} [imsc.enableRollUp=true] * Enable/disable rollUp style display of IMSC captions. - * @property {number} [imsc.options.sizeAdjust=1] - * IMSC styling options - adjust text size, scales the text size and line padding - * @property {number} [imsc.options.lineHeightAdjust=1] - * IMSC styling options - scales the line height - * @property {number} [imsc.options.backgroundOpacityScale=1] - * IMSC styling options - scales the backgroundColor opacity + * @property {number} [imsc.options] + * IMSC styling options - including; sizeAdjust, lineHeightAdjust, backgroundOpacityScale and fontFamily. See the renderHtml function of imscJS for full details * @property {object} [webvtt.customRenderingEnabled=false] * Enables the custom rendering for WebVTT captions. For details refer to the "Subtitles and Captions" sample section of dash.js. * Custom WebVTT rendering requires the external library vtt.js that can be found in the contrib folder. @@ -1015,11 +1011,7 @@ function Settings() { imsc: { displayForcedOnlyMode: false, enableRollUp: true, - options: { - sizeAdjust: 1, - lineHeightAdjust: 1, - backgroundOpacityScale: 1 - }, + options: null, }, webvtt: { customRenderingEnabled: false From 1d0a07d26c6fa86b121329599524ad4e800c8b50 Mon Sep 17 00:00:00 2001 From: Ryan McCartney Date: Mon, 12 May 2025 14:03:37 +0100 Subject: [PATCH 7/8] Default imscJS options to emtpy object --- src/core/Settings.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/core/Settings.js b/src/core/Settings.js index bace783002..1cc7044078 100644 --- a/src/core/Settings.js +++ b/src/core/Settings.js @@ -1011,7 +1011,7 @@ function Settings() { imsc: { displayForcedOnlyMode: false, enableRollUp: true, - options: null, + options: {}, }, webvtt: { customRenderingEnabled: false From 350c3de6afe6c47940ba86f89785e81a93a4ffd4 Mon Sep 17 00:00:00 2001 From: Ryan McCartney Date: Mon, 12 May 2025 14:25:16 +0100 Subject: [PATCH 8/8] Make imsc settings options less generic --- src/core/Settings.js | 28 +++++++++++++++++++++++++--- 1 file changed, 25 insertions(+), 3 deletions(-) diff --git a/src/core/Settings.js b/src/core/Settings.js index 1cc7044078..95aec9e530 100644 --- a/src/core/Settings.js +++ b/src/core/Settings.js @@ -513,8 +513,22 @@ import Events from './events/Events'; * When true, only those captions where itts:forcedDisplay="true" will be displayed. * @property {boolean} [imsc.enableRollUp=true] * Enable/disable rollUp style display of IMSC captions. - * @property {number} [imsc.options] - * IMSC styling options - including; sizeAdjust, lineHeightAdjust, backgroundOpacityScale and fontFamily. See the renderHtml function of imscJS for full details + * @property {object} [imsc.options] + * IMSC styling options - See the renderHtml function of imscJS for full details + * @property {number} [imsc.options.sizeAdjust] + * IMSC styling option - scales the text size and line padding + * @property {number} [imsc.options.lineHeightAdjust] + * IMSC styling option - scales the line height + * @property {number} [imsc.options.backgroundOpacityScale] + * IMSC styling option - scales the backgroundColor opacity + * @property {string} [imsc.options.fontFamily] + * IMSC styling option - comma-separated list of font family values to use, if present. + * @property {number} [imsc.options.colorOpacityScale] + * IMSC styling option - opacity override on text color + * @property {number} [imsc.options.regionOpacityScale] + * IMSC styling option - scales the region opacity + * @property {string} [imsc.options.textOutline] + * IMSC styling option - textOutline value to use, if present * @property {object} [webvtt.customRenderingEnabled=false] * Enables the custom rendering for WebVTT captions. For details refer to the "Subtitles and Captions" sample section of dash.js. * Custom WebVTT rendering requires the external library vtt.js that can be found in the contrib folder. @@ -1011,7 +1025,15 @@ function Settings() { imsc: { displayForcedOnlyMode: false, enableRollUp: true, - options: {}, + options: { + sizeAdjust: 1, + lineHeightAdjust: 1, + backgroundOpacityScale: null, + fontFamily: null, + colorOpacityScale: 1, + regionOpacityScale: null, + textOutline: null, + }, }, webvtt: { customRenderingEnabled: false