File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -1732,6 +1732,7 @@ declare namespace dashjs {
17321732 scheduleWhilePaused ?: boolean
17331733 } ,
17341734 text ?: {
1735+ appendFragmentedCuesWhenTrackModeDisabled ?: boolean ,
17351736 defaultEnabled ?: boolean ,
17361737 dispatchForManualRendering ?: boolean ,
17371738 extendSegmentedCues ?: boolean ,
Original file line number Diff line number Diff line change @@ -599,6 +599,9 @@ import Events from './events/Events.js';
599599
600600/**
601601 * @typedef {Object } Text
602+ * @property {boolean } [appendFragmentedCuesWhenTrackModeDisabled=true]
603+ * Whether fragment cues should be appended to the TextTrack when the track mode is set to disabled.
604+ * Fragment cues are fetched once. This ensures we don't miss them when the track mode is set to disabled.
602605 * @property {boolean } [defaultEnabled=true]
603606 * Enable/disable subtitle rendering by default.
604607 * @property {boolean } [dispatchForManualRendering=false]
@@ -1203,6 +1206,7 @@ function Settings() {
12031206 scheduleWhilePaused : true
12041207 } ,
12051208 text : {
1209+ appendFragmentedCuesWhenTrackModeDisabled : true ,
12061210 defaultEnabled : true ,
12071211 dispatchForManualRendering : false ,
12081212 extendSegmentedCues : true ,
Original file line number Diff line number Diff line change @@ -549,7 +549,12 @@ function TextTracks(config) {
549549 }
550550 }
551551 } else {
552- if ( track . mode !== Constants . TEXT_DISABLED ) {
552+ const isFragmented = this . getCurrentTrackInfo ( ) ?. isFragmented ;
553+ const appendFragmentedCuesWhenTrackModeDisabled = settings . get ( ) . streaming . text . appendFragmentedCuesWhenTrackModeDisabled ;
554+
555+ // If disabled, add fragment cues as they'll be downloaded once.
556+ // If you miss them, they won't be downloaded again.
557+ if ( track . mode !== Constants . TEXT_DISABLED || ( appendFragmentedCuesWhenTrackModeDisabled && isFragmented ) ) {
553558 track . addCue ( cue ) ;
554559 }
555560 }
You can’t perform that action at this time.
0 commit comments