Video.js: Looking for more extensive HLS error reporting

Created on 12 Sep 2018  路  9Comments  路  Source: videojs/video.js

I am attempting to playback live streams with video.js 7 and the built-in VHS plugin. All works fine, but when the stream ends, the "ended" player event doesn't fire. Eventually, 404 errors start to show on the console because the manifest is deleted, but nothing propagates to the player and the "error" event.

Is there some way to get greater granularity of what is happening in the hls engine? The "hls.js" client, for example, returns significant events like "buffer stalled" and "level load" errors. These message help assess the health of the live stream and can also be used to determine if the stream has ended. It would be great if there was a way to get this level of detail from VHS.

I know I can use video.js 7 with another plugin that loads the hls.js client. But the one that also exposes hls.js events - https://github.com/Peer5/videojs-contrib-hls.js - uses a very old version of hls.js and appears to be currently unmonitored.

Thank you.

needs more info outdated

Most helpful comment

The VHS (videojs-http-streaming) plugin has an undocumented event called "retryplaylist" that seems to correspond to 404/504 responses received once the live stream manifest has been deleted. Attach the event to the HLS tech, as follows:

      player.tech().on('retryplaylist', () => {
        console.log('retryplaylist');
         (and do something)
      });

All 9 comments

馃憢 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.

Your stream may not be appending an endlist tag when the stream ends, do you know if this tag is showing up when you end your live stream? If the tag does appear then perhaps this is related to https://github.com/videojs/videojs-contrib-hls/pull/1425

Thank you for your comment. Indeed, the "Problem encountered with the current HLS playlist. Trying again since it is the final playlist." message does appear on the console along with 404/504 errors after the manifest is deleted. It doesn't appear that our stream has an "endlist" tag, but that is a function of our encoders and CDN and is, I believe, out of our control.

With HLS streaming, there is always an issue in determining if the live stream has stopped or is just stalled (perhaps because of a network error).

Being able to detect occurrences like the deleted manifest would help our application determine what action to take. But unfortunately, I can't seem to find a way to get such event information from VHS.

Thank you.

Hello. Still looking for a way to detect the end of a live HLS stream. I noticed there are VHS "usage events" that could convey the information that the manifest is no longer being updated and eventually disappears (resulting in xhr 404/504 errors). But I can't get any of these events to fire. Is it possible that I'm not using them correctly? Here is a section of my code:

video.ready(function() {
  var player = this;
  player.tech().hls.on('hls-unknown-waiting', function() {
    console.log('hls-unknown-waiting');
  });
  player.tech().hls.on('hls-live-resync', function() {
    console.log('hls-live-resync');
  });
  player.on('hls-error-reload-initialized', function() {
    console.log('hls-error-reload-initialized');
  });
  player.on('hls-error-reload', function() {
    console.log('hls-error-reload');
  });
});

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.

_But I can't get any of these events to fire_

Same here. Someone knows how to catch 404 from HLS ?

The VHS (videojs-http-streaming) plugin has an undocumented event called "retryplaylist" that seems to correspond to 404/504 responses received once the live stream manifest has been deleted. Attach the event to the HLS tech, as follows:

      player.tech().on('retryplaylist', () => {
        console.log('retryplaylist');
         (and do something)
      });

Hello. Still looking for a way to detect the end of a live HLS stream. I noticed there are VHS "usage events" that could convey the information that the manifest is no longer being updated and eventually disappears (resulting in xhr 404/504 errors). But I can't get any of these events to fire. Is it possible that I'm not using them correctly? Here is a section of my code:

video.ready(function() {
  var player = this;
  player.tech().hls.on('hls-unknown-waiting', function() {
    console.log('hls-unknown-waiting');
  });
  player.tech().hls.on('hls-live-resync', function() {
    console.log('hls-live-resync');
  });
  player.on('hls-error-reload-initialized', function() {
    console.log('hls-error-reload-initialized');
  });
  player.on('hls-error-reload', function() {
    console.log('hls-error-reload');
  });
});

"usage event" listener should look like this:

video.ready(function() {
  var player = this;
  player.tech().on('usage', event => {
    if (event.name === 'hls-live-resync') {
      console.log('hls-live-resync');
    }
  });
});

NB: My 3rd-party component was adding its own callbacks after my ready state code so my 'retryplaylist' callback was getting deleted. By adding my callback in the player ready callback I was able to get 'retryplaylist' to work.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

TheKassaK picture TheKassaK  路  3Comments

cshah123 picture cshah123  路  4Comments

zhulduz picture zhulduz  路  3Comments

kocoten1992 picture kocoten1992  路  4Comments

kitsunde picture kitsunde  路  4Comments