From 559bce53c35a5dfc5f094b0d8099bffed2cc85b6 Mon Sep 17 00:00:00 2001 From: Gary Katsevman Date: Fri, 15 Jan 2021 15:57:07 -0500 Subject: [PATCH 1/5] feat: add flag to turn off 708 captions Add cc708 as a VHS option to turn off 708 captions. This PR depends on https://github.com/videojs/mux.js/pull/365 --- src/master-playlist-controller.js | 1 + src/segment-loader.js | 2 ++ 2 files changed, 3 insertions(+) diff --git a/src/master-playlist-controller.js b/src/master-playlist-controller.js index 971e6454d..e5a0c9e63 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_, + cc708: options.cc708, 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..2659ab6e9 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.cc708_ = settings.cc708; // private instance variables this.checkBufferTimeout_ = null; @@ -595,6 +596,7 @@ export default class SegmentLoader extends videojs.EventTarget { transmuxer.postMessage({ action: 'init', options: { + cc708: this.cc708_, remux: false, alignGopsAtEnd: this.safeAppend_, keepOriginalTimestamps: true, From 7ed3c6769793cfaa9c42b7a8c3d8d574e39e86e5 Mon Sep 17 00:00:00 2001 From: Gary Katsevman Date: Tue, 19 Jan 2021 16:36:02 -0500 Subject: [PATCH 2/5] rename flag to parse708captions --- src/master-playlist-controller.js | 2 +- src/segment-loader.js | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/master-playlist-controller.js b/src/master-playlist-controller.js index e5a0c9e63..58370d740 100644 --- a/src/master-playlist-controller.js +++ b/src/master-playlist-controller.js @@ -209,7 +209,7 @@ export class MasterPlaylistController extends videojs.EventTarget { const segmentLoaderSettings = { vhs: this.vhs_, - cc708: options.cc708, + 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 2659ab6e9..ce06f688c 100644 --- a/src/segment-loader.js +++ b/src/segment-loader.js @@ -475,7 +475,7 @@ export default class SegmentLoader extends videojs.EventTarget { this.handlePartialData_ = settings.handlePartialData; this.timelineChangeController_ = settings.timelineChangeController; this.shouldSaveSegmentTimingInfo_ = true; - this.cc708_ = settings.cc708; + this.parse708captions_ = settings.parse708captions; // private instance variables this.checkBufferTimeout_ = null; @@ -596,7 +596,7 @@ export default class SegmentLoader extends videojs.EventTarget { transmuxer.postMessage({ action: 'init', options: { - cc708: this.cc708_, + parse708captions: this.parse708captions_, remux: false, alignGopsAtEnd: this.safeAppend_, keepOriginalTimestamps: true, From 36a881ec95ea443ab379038c80dd81fe5894b1ef Mon Sep 17 00:00:00 2001 From: Gary Katsevman Date: Tue, 19 Jan 2021 17:21:57 -0500 Subject: [PATCH 3/5] add parse708captions option to README --- README.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/README.md b/README.md index 66742f91d..648ce201c 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 provided, 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 From 9b3a416ead90a6beea7ef6eddc4b72977793a312 Mon Sep 17 00:00:00 2001 From: Gary Katsevman Date: Wed, 20 Jan 2021 11:47:23 -0500 Subject: [PATCH 4/5] Update README.md Co-authored-by: Garrett Singer --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 648ce201c..07696d0e9 100644 --- a/README.md +++ b/README.md @@ -324,7 +324,7 @@ cuesTrack.addEventListener('cuechange', function() { * Default: `true` * can be used as an initialization option -When provided, 708 captions in the stream are not parsed and will not show up in text track lists or the captions menu. +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` From 2eadcff537fa4a0820019c6f9c5daf581de96022 Mon Sep 17 00:00:00 2001 From: Gary Katsevman Date: Wed, 20 Jan 2021 12:16:56 -0500 Subject: [PATCH 5/5] update to mux.js@5.9.1 which brings in the flag on its side --- package-lock.json | 9 ++++++--- package.json | 2 +- 2 files changed, 7 insertions(+), 4 deletions(-) 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": {