From 6778ca11c94a81d51b75d07bde3dea68ada49948 Mon Sep 17 00:00:00 2001 From: Sungmin Chris Yang Date: Thu, 18 Feb 2021 02:08:14 +0900 Subject: [PATCH] fix: sometimes subtitlesTrack_.cues is null (#1073) --- src/vtt-segment-loader.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/vtt-segment-loader.js b/src/vtt-segment-loader.js index 5097999bd..d1db6c440 100644 --- a/src/vtt-segment-loader.js +++ b/src/vtt-segment-loader.js @@ -54,7 +54,7 @@ export default class VTTSegmentLoader extends SegmentLoader { * TimeRange object representing the current buffered ranges */ buffered_() { - if (!this.subtitlesTrack_ || !this.subtitlesTrack_.cues.length) { + if (!this.subtitlesTrack_ || !this.subtitlesTrack_.cues || !this.subtitlesTrack_.cues.length) { return videojs.createTimeRanges(); }