Skip to content

Commit 2fd2725

Browse files
jiayuxingemxx
authored andcommitted
fix: check if video track has segments before accessing
1 parent 5c50ca7 commit 2fd2725

File tree

1 file changed

+1
-1
lines changed
  • packages/xgplayer-mp4/src

1 file changed

+1
-1
lines changed

packages/xgplayer-mp4/src/mp4.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -349,7 +349,7 @@ class MP4 extends EventEmitter {
349349
let i = 1
350350
let find = false
351351
this.log('>>>>>getSubRange time,',time, JSON.stringify(range))
352-
if (this.videoTrak) {
352+
if (this.videoTrak && this.videoTrak.length > 0) {
353353
const videoSeg = fragIndex < this.videoTrak.length ? this.videoTrak[fragIndex] : this.videoTrak[this.videoTrak.length - 1]
354354
if (videoSeg.frames.length === 0) {
355355
this.log('>>>>>getSubRange video, no frames')

0 commit comments

Comments
 (0)