File tree Expand file tree Collapse file tree 2 files changed +7
-4
lines changed Expand file tree Collapse file tree 2 files changed +7
-4
lines changed Original file line number Diff line number Diff line change @@ -1383,7 +1383,7 @@ shaka.media.MediaSourceEngine = class {
1383
1383
// Get actual TextEngine buffer start, as it's not the same as video
1384
1384
// buffer and TextEngine does not support multiple buffered ranges.
1385
1385
const textStart = this . textEngine_ . bufferStart ( ) || 0 ;
1386
- this . textEngine_ . remove ( textStart , endTime ) ;
1386
+ this . textEngine_ . remove ( textStart , endTime , /* removeCC= */ true ) ;
1387
1387
}
1388
1388
if ( contentType == ContentType . TEXT ) {
1389
1389
await this . textEngine_ . remove ( startTime , endTime ) ;
@@ -1418,7 +1418,7 @@ shaka.media.MediaSourceEngine = class {
1418
1418
// if we have CEA captions, we should clear those too.
1419
1419
if ( contentType === ContentType . VIDEO && this . captionParser_ &&
1420
1420
this . textEngine_ ) {
1421
- await this . textEngine_ . remove ( 0 , Infinity ) ;
1421
+ await this . textEngine_ . remove ( 0 , Infinity , /* removeCC= */ true ) ;
1422
1422
}
1423
1423
// Note that not all platforms allow clearing to Infinity.
1424
1424
await this . enqueueOperation_ (
Original file line number Diff line number Diff line change @@ -242,15 +242,18 @@ shaka.text.TextEngine = class {
242
242
/**
243
243
* @param {number } startTime relative to the start of the presentation
244
244
* @param {number } endTime relative to the start of the presentation
245
+ * @param {boolean= } removeClosedCaptions
245
246
* @return {!Promise }
246
247
*/
247
- async remove ( startTime , endTime ) {
248
+ async remove ( startTime , endTime , removeClosedCaptions = false ) {
248
249
// Start the operation asynchronously to avoid blocking the caller.
249
250
await Promise . resolve ( ) ;
250
251
if ( startTime >= endTime ) {
251
252
return ;
252
253
}
253
- this . removeClosedCaptions_ ( startTime , endTime ) ;
254
+ if ( removeClosedCaptions ) {
255
+ this . removeClosedCaptions_ ( startTime , endTime ) ;
256
+ }
254
257
if ( this . displayer_ && this . displayer_ . remove ( startTime , endTime ) ) {
255
258
if ( this . bufferStart_ == null ) {
256
259
goog . asserts . assert (
You can’t perform that action at this time.
0 commit comments