Skip to content

Commit b7865b4

Browse files
authored
fix: Closure compiler removes call to modifyCueCallback in src= mode (#8261)
1 parent cdd69b5 commit b7865b4

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

lib/player.js

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5434,7 +5434,15 @@ shaka.Player = class extends shaka.util.FakeEventTarget {
54345434
for (const nativeCue of nativeCues) {
54355435
const cue = shaka.text.Utils.mapNativeCueToShakaCue(nativeCue);
54365436
if (cue) {
5437-
this.config_.mediaSource.modifyCueCallback(cue, null, time);
5437+
const modifyCueCallback = this.config_.mediaSource.modifyCueCallback;
5438+
// Closure compiler removes the call to modifyCueCallback for reasons
5439+
// unknown to us.
5440+
// See https://github.com/shaka-project/shaka-player/pull/8261
5441+
// We'll want to revisit this condition once we migrated to TS.
5442+
// See https://github.com/shaka-project/shaka-player/issues/8262 for TS.
5443+
if (modifyCueCallback) {
5444+
modifyCueCallback(cue, null, time);
5445+
}
54385446
allCues.push(cue);
54395447
}
54405448
}

0 commit comments

Comments
 (0)