hls.js icon indicating copy to clipboard operation
hls.js copied to clipboard

Incorrect docs for NETWORK_ERROR

Open Omar2002 opened this issue 8 years ago • 2 comments

For example playlist-loader.js will trigger this object

{
      type: ErrorTypes.NETWORK_ERROR,
      details,
      fatal,
      url: loader.url,
      loader,
      context,
      networkDetails
}

https://github.com/video-dev/hls.js/blob/741d531f69501f2d7e12fe10d8454245d4ec9161/src/loader/playlist-loader.js#L460

But in docs we have this notations:

// Identifier for a manifest load error - data: { url : faulty URL, response : { code: error code, text: error text }}

https://github.com/video-dev/hls.js/blob/f44dd24dd15a95baea8fa2e8d1f7ef11a09f07f6/src/errors.js#L23

And in https://github.com/video-dev/hls.js/blob/master/docs/API.md#network-errors we have

data: { type : NETWORK_ERROR, details : Hls.ErrorDetails.MANIFEST_LOAD_ERROR, fatal : true, url : manifest URL, response : { code: error code, text: error text }, loader : URL loader }

In real work we have networkDetails instead of response field in ErrorData.

Omar2002 avatar Jun 14 '18 07:06 Omar2002

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

stale[bot] avatar Aug 13 '18 08:08 stale[bot]

This is happening to me too. For all errors, I log in the console, and this is the data:

{
  context: {
    type: "manifest",
    level: 0,
    id: null,
    loader: XhrLoader,
    url: "https://playlist.m3u"
  },
  details: "manifestLoadError",
  fatal: true,
  loader: XhrLoader,
  networkDetails: XMLHttpRequest,
  type: "networkError",
  url: undefined
}

This seems to not be synced with https://github.com/video-dev/hls.js/blob/master/docs/API.md#errors.

brookback avatar Nov 16 '18 10:11 brookback