Closed hahashigehaha closed 6 years ago
If you set clearBuffer
true while jmuxer instantiation, it clear buffer that has already been played. If you don't need want to clear buffer, you can set clearBuffer
to false.
yeah,it's ok! but i think it's a bug. if i make clearBuffer true , only show frame before first clearBuffer .
Will look into when I get some. Thanks by the way!
I noticed this problem too, and I believe I know the cause. It happens when jmuxer's buffer clear operation deletes the last keyframe. This happens every time if I encode my source stream with an i-frame interval longer than 10 seconds.
By the way, this is a fantastic library. Exactly what I was looking for. Browsers should have this API as a standard, because it is just too useful.
It looks like jmuxer deletes everything older than two seconds (see the "cleanOffset" variable), but it needs to make sure it never deletes the most recent keyframe.
As I mentioned earlier use clearBuffer false
I'm fully aware of that :) I'm a little concerned about what might happen long-term if never clearing the buffers, though, so I just had my code reach in and change the cleanOffset value. Thanks for making so many internal variables public. That really helps.
:)
True, if you don't clear buffer, you will get buffer limit exceeded
exception after some time.
I will look this issue.
I think your fix didn't work. I updated to the latest jmuxer and took out my hack of the cleanOffset variable, and now my streams freeze at the 10 second mark again (with a 20 second keyframe interval). Tested in Chrome and Firefox.
you are right, there was an issue for longer keyframe gap. I have pushed another update. It should fix the issue. thanks
It didn't run before because I didn't call the play method of video element. After the normal operation, I open your debug mode, and when first log prints out (video remove range [0 - 6.097455)), this sentence stops running and doesn't play .