diff --git a/README.md b/README.md index 66742f91d..07696d0e9 100644 --- a/README.md +++ b/README.md @@ -42,6 +42,7 @@ Video.js Compatibility: 6.0, 7.0 - [withCredentials](#withcredentials) - [handleManifestRedirects](#handlemanifestredirects) - [useCueTags](#usecuetags) + - [parse708captions](#parse708captions) - [overrideNative](#overridenative) - [blacklistDuration](#blacklistduration) - [bandwidth](#bandwidth) @@ -318,6 +319,13 @@ cuesTrack.addEventListener('cuechange', function() { }); ``` +##### parse708captions +* Type: `boolean` +* Default: `true` +* can be used as an initialization option + +When set to `false`, 708 captions in the stream are not parsed and will not show up in text track lists or the captions menu. + ##### overrideNative * Type: `boolean` * can be used as an initialization option diff --git a/package-lock.json b/package-lock.json index 2228c433e..bd319ce94 100644 --- a/package-lock.json +++ b/package-lock.json @@ -6481,9 +6481,12 @@ "dev": true }, "mux.js": { - "version": "5.8.0", - "resolved": "https://registry.npmjs.org/mux.js/-/mux.js-5.8.0.tgz", - "integrity": "sha512-v56I2YPyCq1bVbXW7vcuvQs8iHrDy7AeXsZyG1kxCxBUqUjZD0Xq/cU1wrd5dy9YTxRpvw37aTQ4ILwi40GXiw==" + "version": "5.9.1", + "resolved": "https://registry.npmjs.org/mux.js/-/mux.js-5.9.1.tgz", + "integrity": "sha512-EWDCIemLUoTriIQpEHEfKO8hldujpiBYIqC6ilsMaNbd+1hhGoh/w1MZIhP5wkq+tkS+HfnrnNtyfamyXWfnPg==", + "requires": { + "@babel/runtime": "^7.11.2" + } }, "natural-compare": { "version": "1.4.0", diff --git a/package.json b/package.json index db55e15f4..8a3128376 100644 --- a/package.json +++ b/package.json @@ -61,7 +61,7 @@ "global": "^4.4.0", "m3u8-parser": "4.5.2", "mpd-parser": "0.15.2", - "mux.js": "5.8.0", + "mux.js": "5.9.1", "video.js": "^6 || ^7" }, "devDependencies": { diff --git a/src/master-playlist-controller.js b/src/master-playlist-controller.js index 971e6454d..58370d740 100644 --- a/src/master-playlist-controller.js +++ b/src/master-playlist-controller.js @@ -209,6 +209,7 @@ export class MasterPlaylistController extends videojs.EventTarget { const segmentLoaderSettings = { vhs: this.vhs_, + parse708captions: options.parse708captions, mediaSource: this.mediaSource, currentTime: this.tech_.currentTime.bind(this.tech_), seekable: () => this.seekable(), diff --git a/src/segment-loader.js b/src/segment-loader.js index ac689dad8..ce06f688c 100644 --- a/src/segment-loader.js +++ b/src/segment-loader.js @@ -475,6 +475,7 @@ export default class SegmentLoader extends videojs.EventTarget { this.handlePartialData_ = settings.handlePartialData; this.timelineChangeController_ = settings.timelineChangeController; this.shouldSaveSegmentTimingInfo_ = true; + this.parse708captions_ = settings.parse708captions; // private instance variables this.checkBufferTimeout_ = null; @@ -595,6 +596,7 @@ export default class SegmentLoader extends videojs.EventTarget { transmuxer.postMessage({ action: 'init', options: { + parse708captions: this.parse708captions_, remux: false, alignGopsAtEnd: this.safeAppend_, keepOriginalTimestamps: true,