File tree Expand file tree Collapse file tree 1 file changed +12
-1
lines changed Expand file tree Collapse file tree 1 file changed +12
-1
lines changed Original file line number Diff line number Diff line change @@ -1312,6 +1312,7 @@ shaka.media.StreamingEngine = class {
1312
1312
async onUpdate_ ( mediaState ) {
1313
1313
this . destroyer_ . ensureNotDestroyed ( ) ;
1314
1314
1315
+ const ContentType = shaka . util . ManifestParserUtils . ContentType ;
1315
1316
const logPrefix = shaka . media . StreamingEngine . logPrefix_ ( mediaState ) ;
1316
1317
1317
1318
// Sanity check.
@@ -1388,7 +1389,17 @@ shaka.media.StreamingEngine = class {
1388
1389
return ;
1389
1390
}
1390
1391
1391
- const mediaStates = Array . from ( this . mediaStates_ . values ( ) ) ;
1392
+ if ( mediaState . type === ContentType . TEXT ) {
1393
+ // MSE endOfStream() closes MediaSource, not TextEngine, so skip here.
1394
+ return ;
1395
+ }
1396
+ const mediaStates = [ mediaState ] ;
1397
+ const otherType = mediaState . type === ContentType . AUDIO ?
1398
+ ContentType . VIDEO : ContentType . AUDIO ;
1399
+ const otherMediaState = this . mediaStates_ . get ( otherType ) ;
1400
+ if ( otherMediaState ) {
1401
+ mediaStates . push ( otherMediaState ) ;
1402
+ }
1392
1403
1393
1404
// Check if we've buffered to the end of the presentation. We delay adding
1394
1405
// the audio and video media states, so it is possible for the text stream
You can’t perform that action at this time.
0 commit comments