Skip to content
This repository has been archived by the owner on Jan 12, 2019. It is now read-only.

Closed captions playback issue: Uncaught TypeError: Cannot read property 'length' of null #892

Closed
askaliuk opened this issue Nov 2, 2016 · 6 comments

Comments

@askaliuk
Copy link

askaliuk commented Nov 2, 2016

Description

video-contrib-hls raises an exception during HLS stream playback with closed captions.

Sources

http://playertest.longtailvideo.com/adaptive/captions/playlist.m3u8

Steps to reproduce

Open following URL:
http://www.w3schools.com/code/tryit.asp?filename=F0EFFPUMR91Z

  1. Start playback, click CC button and enable closed captions by clicking on cc1 track
  2. Wait for 1-3 seconds and disable closed captions by clicking on captions off
  3. Open browser console and let playback go. Around 1:15-1:30 browser will raise an exception.

Error output

videojs-contrib-hls.js:14349 Uncaught TypeError: Cannot read property 'length' of null
    at removeCuesFromTrack (https://cdnjs.cloudflare.com/ajax/libs/videojs-contrib-hls/3.6.6/videojs-contrib-hls.js:14349:17)
    at VirtualSourceBuffer.remove (https://cdnjs.cloudflare.com/ajax/libs/videojs-contrib-hls/3.6.6/videojs-contrib-hls.js:15121:44)
    at SourceUpdater.<anonymous> (https://cdnjs.cloudflare.com/ajax/libs/videojs-contrib-hls/3.6.6/videojs-contrib-hls.js:4314:30)
    at SourceUpdater.runCallback_ (https://cdnjs.cloudflare.com/ajax/libs/videojs-contrib-hls/3.6.6/videojs-contrib-hls.js:4369:21)
    at SourceUpdater.queueCallback_ (https://cdnjs.cloudflare.com/ajax/libs/videojs-contrib-hls/3.6.6/videojs-contrib-hls.js:4355:12)
    at SourceUpdater.remove (https://cdnjs.cloudflare.com/ajax/libs/videojs-contrib-hls/3.6.6/videojs-contrib-hls.js:4313:12)
    at SegmentLoader.loadSegment_ (https://cdnjs.cloudflare.com/ajax/libs/videojs-contrib-hls/3.6.6/videojs-contrib-hls.js:3757:29)
    at SegmentLoader.fillBuffer_ (https://cdnjs.cloudflare.com/ajax/libs/videojs-contrib-hls/3.6.6/videojs-contrib-hls.js:3686:12)
    at SegmentLoader.monitorBuffer_ (https://cdnjs.cloudflare.com/ajax/libs/videojs-contrib-hls/3.6.6/videojs-contrib-hls.js:3489:14)

Additional information

Bug is probably here:
https://github.com/videojs/videojs-contrib-media-sources/blob/v4.0.4/src/remove-cues-from-track.js#L21

track.cues can be null

videojs-contrib-hls version

videojs-contrib-hls 3.6.6

videojs version

video.js 5.11.9

Browsers

Chrome 54.0.2840.71, but I'm pretty sure the bug can be repeated in any browser

Platforms

I tested on OSX, but I'm pretty sure a bug can be repeated in any platform

@askaliuk
Copy link
Author

askaliuk commented Nov 4, 2016

Looks like it was fixed in videojs/videojs-contrib-media-sources#113

@dmlap
Copy link
Member

dmlap commented Nov 7, 2016

@askaliuk thanks for noting that fixed the issue. Closing.

@dmlap dmlap closed this as completed Nov 7, 2016
@askaliuk
Copy link
Author

askaliuk commented Nov 7, 2016

@dmlap thank you. May I ask when this change will go into video-contrib-hls release?
I saw this commit:
2165f9d

But videojs-contrib-media-sources was not updated.

@dmlap
Copy link
Member

dmlap commented Nov 7, 2016

@askaliuk the ^ operator in the version should pick up the latest patch version of contrib-media-sources so it's only necessary to rebuild and re-tag to pick up the change. I definitely agree it's a bit confusing.

@askaliuk
Copy link
Author

askaliuk commented Nov 7, 2016

@dmlap just tested. Unfortunately your commit does not fix the issue.

forbesjo pushed a commit to videojs/videojs-contrib-media-sources that referenced this issue Nov 21, 2016
imbcmdth pushed a commit to videojs/videojs-contrib-media-sources that referenced this issue Dec 5, 2016
@anaszgh
Copy link

anaszgh commented Jun 19, 2018

Hello,

I'm facing the same issue on Video-Js version 7.0.2, how can i fix it.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants