mpegts.js
mpegts.js copied to clipboard
Playing speed
When playing live stream, playing speed is a bit slow. More time is passed, more delay video. Thanks.
Same observation for live video. The delay gap is getting serious when more time is passed. I have tuned the input parameters, but no luck. Here is my code for reference, <video id="videoElement" muted="muted"> <script> if (mpegts.getFeatureList().mseLivePlayback) { var videoElement = document.getElementById('videoElement'); var player = mpegts.createPlayer({ type: 'mse', // could also be mse, mpegts, m2ts, flv isLive: true, cors: true, hasAudio: false, enableWorker: true, enableStashBuffer: false, liveBufferLatencyChasing: true, liveBufferLatencyMaxLatency: 1.5, lazyLoad: false, deferLoadAfterSourceOpen: false, autoCleanupSourceBuffer: true, url: 'http://xx.xx.xx.xx/play/video01' }); player.attachMediaElement(videoElement); player.load(); player.play(); }
FIXED: well, for me at least.... Streaming a live flv, I can confirm that if I let my browser view a live stream over the weekend, it will fall behind nearly an hour! If I minimize it it essentially pauses after about 30 seconds or so. This does NOT occur on Chrome on Linux, but does for Windows. The problem is not as bad if you "unlock" the player by interacting with it and starting audio decode.
The Fix: I added {liveBufferLatencyChasing: true} and now the problem is gone.