diff --git a/src/core/segment_buffers/implementations/text/html/text_track_cues_store.ts b/src/core/segment_buffers/implementations/text/html/text_track_cues_store.ts index 4448c0748b8..0245b4a8e53 100644 --- a/src/core/segment_buffers/implementations/text/html/text_track_cues_store.ts +++ b/src/core/segment_buffers/implementations/text/html/text_track_cues_store.ts @@ -94,10 +94,11 @@ export default class TextTrackCuesStore { // approximation. // Add a tolerance of 1ms to fix this issue if (ret.length === 0 && cues.length) { - if (areNearlyEqual(time, cues[0].start, DELTA_CUES_GROUP)) { - ret.push(cues[0].element); - } else if (areNearlyEqual(time, cues[cues.length - 1].end, DELTA_CUES_GROUP)) { - ret.push(cues[cues.length - 1].element); + for (let j = 0; j < cues.length; j++) { + if (areNearlyEqual(time, cues[j].start, DELTA_CUES_GROUP) + || areNearlyEqual(time, cues[j].end, DELTA_CUES_GROUP) + ) { + ret.push(cues[j].element); } } return ret;