Loading HTML5 Video before it's Ready

QUESTION:

In the HTML5 sample, it seems if you try to load the video before there is enough data in the m3u8 file, the video player hangs and will not load. Refreshing the page after maybe 10 seconds, there are no issues. Then when the stream ends, the player hangs because the end-of-stream is not detected by the player. So my questions is, is there any way from a web video player to detect when the m3u8 file is ready for consumption and is there a way to detect when the stream has ended (as opposed to buffering or any other kind of stoppage)?

 

ANSWER:

You need to adjust the Property name item length and keyframe rate.  Please find property name item length - set value to 4 or 2. The caveat for this value is that the publisher key frame rate needs to be a multiple of that number.  For example, an item length of two requires a key frame-rate of 1 or 2. Play with item length on the server side, and the broadcaster frame-rate to make the interval smaller (the default is 6).

The item count property specifies how many items are in the list.  You can reduce it to 4, and the hls player to 3 for start up.

You can find the item length property in the server config file in red5/conf/hlsconfig.xml.

Have more questions? Submit a request

0 Comments

Please sign in to leave a comment.