HLS.js get video segment info

2k views Asked by At

I am trying to get analytics on hls.js from my video segments. I am looking for the size of the video segments and what time the video segments go over the network.

I am currently using the HLS events with not much luck:

this.hls.on(HLS.Events.BUFFER_APPENDING, (event, data) => {
    console.log(data);
    console.log('segment added to buffer');
});

I've tried BUFFER_APPENDED, BUFFER_APPENDING, FRAG_CHANGED, without much luck getting the info I want.

1

There are 1 answers

0
Dipen Shah On BEST ANSWER

FRAG_BUFFERED or LEVEL_LOADED event should have stat information you need.

Demo folder in repository has good level of stats collection you might be able to use it for collecting stats: https://github.com/video-dev/hls.js/tree/master/demo