http-streaming icon indicating copy to clipboard operation
http-streaming copied to clipboard

VIDEOJS: ERROR: TypeError: Cannot read properties of undefined (reading 'parts' | 'videoTimingInfo' | 'audioTimingInfo' | 'start' | 'end')

Open Aigor79 opened this issue 2 years ago • 12 comments

Description

When I play a HLS video, within a corporate network, sometimes the player stops with these errors:

TypeError: Cannot read properties of undefined (reading 'parts')
..
Uncaught TypeError: Cannot read properties of undefined (reading 'videoTimimngInfo')
..
Uncaught TypeError: Cannot read properties of undefined (reading 'start')
..
Uncaught TypeError: Cannot read properties of undefined (reading 'audioTimingInfo')
..
Uncaught TypeError: Cannot read properties of undefined (reading 'end')
...
TypeError: Cannot read properties of undefined (reading 'dateTimeObject')
...
TypeError: Cannot read properties of undefined (reading 'uri')

These errors are not handled by the player.on('error') event

Steps to reproduce

It's difficult to reproduce, however I suppose it's enough to force to undefined some attributes of the object segmentinfo inside generateSegments.

Results

Expected

When a segment arrives with wrong information the player should ignore it and continue viewing the video. In my case it was enough to catch errors in some functions:

  • updateMediaSecondsLoaded_
  • updateMediaSecondsLoaded_
  • handleSegmentTimingInfo_
  • calculateSegmentTimeMapping_
  • saveSegmentTimingInfo
  • segmentInfoString
  • addSegmentMetadataCue_
  • handleAppendsDone_

I simply added within functions

try {
     ....
 } catch (e) {
      videojs.log.warn(e);
}

and the player has never stopped

Actual

When a wrong segment comes the player blocks the view and you have to restart it

Error output

(line number does not match because of try catches added, however it is version 7.18.1 of videojs)

TypeError: Cannot read properties of undefined (reading 'start')
    at SyncController.calculateSegmentTimeMapping_ (video.min.js:60623:30)
    at SyncController.saveSegmentTimingInfo (video.min.js:60526:59)
    at SegmentLoader.handleAppendsDone_ (video.min.js:58397:42)
    at SegmentLoader.checkAppendsDone_ (video.min.js:58269:22)
    at Object.action (video.min.js:58775:17)
    at shiftQueue (video.min.js:58693:20)
    at SourceBuffer.<anonymous> (video.min.js:58912:13)
TypeError: Cannot read properties of undefined (reading 'dateTimeObject')
    at SyncController.saveSegmentTimingInfo (video.min.js:60541:40)
    at SegmentLoader.handleAppendsDone_ (video.min.js:58397:42)
    at SegmentLoader.checkAppendsDone_ (video.min.js:58269:22)
    at Object.action (video.min.js:58775:17)
    at shiftQueue (video.min.js:58693:20)
    at SourceBuffer.<anonymous> (video.min.js:58912:13)
TypeError: Cannot read properties of undefined (reading 'uri')
    at segmentInfoString (video.min.js:55579:44)
    at SegmentLoader.handleAppendsDone_ (video.min.js:58429:44)
    at SegmentLoader.checkAppendsDone_ (video.min.js:58269:22)
    at Object.action (video.min.js:58775:17)
    at shiftQueue (video.min.js:58693:20)
    at SourceBuffer.<anonymous> (video.min.js:58912:13)
TypeError: Cannot read properties of undefined (reading 'end')
    at SegmentLoader.handleAppendsDone_ (video.min.js:58459:47)
    at SegmentLoader.checkAppendsDone_ (video.min.js:58269:22)
    at Object.action (video.min.js:58775:17)
    at shiftQueue (video.min.js:58693:20)
    at SourceBuffer.<anonymous> (video.min.js:58912:13)

Additional Information

versions

videojs

7.18.1

browsers

Edge Chrome Firefox

OSes

Windows MacOs

plugins

no

Aigor79 avatar Apr 08 '22 18:04 Aigor79

👋 Thanks for opening your first issue here! 👋

If you're reporting a 🐞 bug, please make sure you include steps to reproduce it. We get a lot of issues on this repo, so please be patient and we will get back to you as soon as we can. To help make it easier for us to investigate your issue, please follow the contributing guidelines.

welcome[bot] avatar Apr 08 '22 18:04 welcome[bot]

Thanks for the detailed report!

The team is currently operating at lower capacity, so it may be a while before we get to this one. It seems like something we should investigate, though.

misteroneill avatar Apr 11 '22 14:04 misteroneill

We're also seeing this when switching betweeen quality settings using http-streaming.
image

Refreshing fixes it, and able to switch normally.

tzarebczan avatar Apr 19 '22 19:04 tzarebczan

Is this potentially fixed here for http-streaming? https://github.com/videojs/http-streaming/releases/tag/v2.14.2

Possible to get a release with that bump?

tzarebczan avatar Apr 19 '22 19:04 tzarebczan

Video.js 7.19.2 just released with that VHS version. Please try it out.

gkatsev avatar Apr 20 '22 19:04 gkatsev

👋 Thanks for opening your first issue here! 👋

If you're reporting a 🐞 bug, please make sure you include steps to reproduce it. We get a lot of issues on this repo, so please be patient and we will get back to you as soon as we can. To help make it easier for us to investigate your issue, please follow the contributing guidelines.

welcome[bot] avatar Apr 25 '22 14:04 welcome[bot]

Great, i actually overwrote it on our site, launched earlier today. Haven't seen it creep up yet, thank you!

tzarebczan avatar Apr 21 '22 02:04 tzarebczan

Unfortunately, the problem still exists using Video.js 7.19.2

video.min.js?version=7.19.2:12 VIDEOJS: ERROR: TypeError: Cannot read properties of undefined (reading 'parts')
    at e.t.playlist (video.min.js?version=7.19.2:21:219529)
    at e.t.handleUpdatedMediaPlaylist (video.min.js?version=7.19.2:25:14605)
    at e.<anonymous> (video.min.js?version=7.19.2:25:13193)
    at e.Be.o.dispatcher.o.dispatcher (video.min.js?version=7.19.2:12:13641)
    at je (video.min.js?version=7.19.2:12:14425)
    at e.ze.dispatchEvent.ze.trigger (video.min.js?version=7.19.2:12:16260)
    at e.t.haveMetadata (video.min.js?version=7.19.2:21:116508)
    at video.min.js?version=7.19.2:21:114053
    at gu (video.min.js?version=7.19.2:21:84131)
    at Object.callback (video.min.js?version=7.19.2:21:84496)
video.min.js?version=7.19.2:21 Uncaught TypeError: Cannot read properties of undefined (reading 'videoTimingInfo')
    at e.t.handleSegmentTimingInfo_ (video.min.js?version=7.19.2:21:236971)
    at onVideoSegmentTimingInfo (video.min.js?version=7.19.2:21:96772)
    at Worker.Du.n.onmessage (video.min.js?version=7.19.2:21:91898)
Uncaught TypeError: Cannot read properties of undefined (reading 'start')
    at e.t.updateMediaSecondsLoaded_ (video.min.js?version=7.19.2:21:242034)
    at e.t.handleData_ (video.min.js?version=7.19.2:21:232747)
    at onData (video.min.js?version=7.19.2:21:96428)
    at video.min.js?version=7.19.2:21:91618
    at Worker.Du.n.onmessage (video.min.js?version=7.19.2:21:91623)
video.min.js?version=7.19.2:21 Uncaught TypeError: Cannot read properties of undefined (reading 'audioTimingInfo')
    at e.t.handleSegmentTimingInfo_ (video.min.js?version=7.19.2:21:236971)
    at onAudioSegmentTimingInfo (video.min.js?version=7.19.2:21:96815)
    at Worker.Du.n.onmessage (video.min.js?version=7.19.2:21:91973)
video.min.js?version=7.19.2:21 Uncaught TypeError: Cannot read properties of undefined (reading 'start')
    at e.t.updateMediaSecondsLoaded_ (video.min.js?version=7.19.2:21:242034)
    at e.t.handleData_ (video.min.js?version=7.19.2:21:232747)
    at onData (video.min.js?version=7.19.2:21:96428)
    at video.min.js?version=7.19.2:21:91618
    at Worker.Du.n.onmessage (video.min.js?version=7.19.2:21:91623)
Uncaught TypeError: Cannot read properties of undefined (reading 'start')
    at e.t.calculateSegmentTimeMapping_ (video.min.js?version=7.19.2:21:272748)
    at e.t.saveSegmentTimingInfo (video.min.js?version=7.19.2:21:271711)
    at e.t.handleAppendsDone_ (video.min.js?version=7.19.2:21:245973)
    at e.t.checkAppendsDone_ (video.min.js?version=7.19.2:21:243683)
    at e.t.waitForAppendsToComplete_ (video.min.js?version=7.19.2:21:243338)
    at e.t.segmentRequestFinished_ (video.min.js?version=7.19.2:21:241836)
    at onDone (video.min.js?version=7.19.2:21:97017)
    at Worker.Du.n.onmessage (video.min.js?version=7.19.2:21:92336)

Aigor79 avatar Apr 26 '22 15:04 Aigor79

We haven't been able to reproduce the issue yet ourselves. Does anyone have a reproducible test case that demonstrates the issue, or a segment that specifically triggers the errors? Thank you.

gesinger avatar May 25 '22 15:05 gesinger

I think the problem occurs when network performance degrades. I often have experience of this problem while playing within a large private network (spread across the nation, in my case): video fragments sometimes get deteriorated and this causes error

Aigor79 avatar May 25 '22 16:05 Aigor79

Uncaught TypeError: Cannot read properties of undefined (reading 'parts') at SegmentLoader.chooseNextRequest_ (video.es.js:41474:1) at SegmentLoader.fillBuffer_ (video.es.js:41419:1) at SegmentLoader.monitorBufferTick_ (video.es.js:41391:1)

When the live stop and restart, the error occurs.The version is 8.3.0

IndexLibrary avatar Nov 23 '23 08:11 IndexLibrary

image I have the same problems. It stopped streaming when this happened

duongthaison98 avatar May 15 '24 08:05 duongthaison98