videojs / videojs-contrib-hls

HLS library for video.js
http://videojs.github.io/videojs-contrib-hls/
Other
2.84k stars 793 forks source link

Error & Playback stops on empty Live Manifest #952

Closed zshenker closed 7 years ago

zshenker commented 7 years ago

Description

Currently we have a bug in our Live HLS streams, where occasionally/intermittently rendition manifests will return a 200 OK response code, but an empty body (0 bytes). In this case, contrib-hls hits an uncaught error in updateSegments in playlist-loader.js, and playback stops completely.

We are working on fixing the issue in our Live delivery, but it would be great to have contrib-hls be more resilient to this, and be able to ignore this empty manifest, and re-request the manifest.

Sources

No public source currently, will try to get one setup.

Steps to reproduce

  1. Play Live Stream
  2. Have a rendition manifest return a 200 response with 0 byte body
  3. Error occurs, and playback stops .

Results

Uncaught error, and playback completely stops.

Expected

Error should be gracefully handled and requests for manifest re-tried.

Error output

Uncaught TypeError: Cannot read property 'slice' of undefined at updateSegments (playlist-loader.js?8441:50) at updateMaster (playlist-loader.js?8441:98) at haveMetadata (playlist-loader.js?8441:193) at playlist-loader.js?8441:412 at Object.callback (xhr.js?1c98:63) at cbOnce (index.js?bbe1:62) at loadFunc (index.js?bbe1:138) at XMLHttpRequest.readystatechange (index.js?bbe1:68)

Additional Information

Please include any additional information necessary here. Including the following:

videojs-contrib-hls version

videojs-contrib-hls 4.0.2

videojs version

video.js 5.14.1

Browsers

Platforms

Other Plugins

are any other videojs plugins being used on the page? If so, please list them with version below.

Other JavaScript

dmlap commented 7 years ago

I'd suggest the fix for this is to update videojs/m3u8-parser so empty manifests return an empty array, instead of undefined.

dmlap commented 7 years ago

Looks like that issue has already been filed over there: https://github.com/videojs/m3u8-parser/issues/8

zshenker commented 7 years ago

Fix for this was merged into m3u8-parser in https://github.com/videojs/m3u8-parser/pull/12

gesinger commented 7 years ago

Dependency requirement on m3u8-parser 2.0.0 updated and released as part of videojs-contrib-hls 4.1.0. Thanks @zshenker !