From 91fa3082aeada6e7175e1dfa57790ca56eb5bfdb Mon Sep 17 00:00:00 2001 From: amtins Date: Tue, 20 Sep 2022 19:21:45 +0200 Subject: [PATCH] feat: add an option to support forced subtitles --- README.md | 9 +++ index.html | 5 ++ scripts/index.js | 9 ++- src/media-groups.js | 2 +- src/videojs-http-streaming.js | 2 + test/master-playlist-controller.test.js | 75 +++++++++++++++++++++++++ test/media-groups.test.js | 4 +- 7 files changed, 101 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 832129ceb..e67c9ae67 100644 --- a/README.md +++ b/README.md @@ -59,6 +59,7 @@ Video.js Compatibility: 6.0, 7.0 - [liveRangeSafeTimeDelta](#liverangesafetimedelta) - [useNetworkInformationApi](#usenetworkinformationapi) - [useDtsForTimestampOffset](#usedtsfortimestampoffset) + - [useForcedSubtitles](#useforcedsubtitles) - [captionServices](#captionservices) - [Format](#format) - [Example](#example) @@ -485,6 +486,14 @@ This option defaults to `false`. * Default: `false` * Use [Decode Timestamp](https://www.w3.org/TR/media-source/#decode-timestamp) instead of [Presentation Timestamp](https://www.w3.org/TR/media-source/#presentation-timestamp) for [timestampOffset](https://www.w3.org/TR/media-source/#dom-sourcebuffer-timestampoffset) calculation. This option was introduced to align with DTS-based browsers. This option affects only transmuxed data (eg: transport stream). For more info please check the following [issue](https://github.com/videojs/http-streaming/issues/1247). +##### useForcedSubtitles +* Type: `boolean` +* Default: `false` +* can be used as a source option +* can be used as an initialization option + +If true, this option allows the player to display forced subtitles. When available, forced subtitles allow to translate foreign language dialogues or images containing foreign language characters. + ##### captionServices * Type: `object` * Default: undefined diff --git a/index.html b/index.html index b2e56ffa6..e0b68d244 100644 --- a/index.html +++ b/index.html @@ -186,6 +186,11 @@ +
+ + +
+