refactor: HLS streamer - improve latency (#1268)

Co-authored-by: Eric Hebert <ehebert@demolitionxp.com>
This commit is contained in:
Eric HebertandEric Hebert authored and Stefan Dej committed 2023-02-18 14:27:55 +01:00
1 parent 2a924bcd27
commit 6a2a1baaab
1 file changed
+8 -1
+8 -1
View File
@@ -61,7 +61,14 @@ export default class Hlsstreamer extends Mixins(BaseMixin) {
if (Hls.isSupported()) {
this.hls?.destroy()
this.hls = new Hls()
this.hls = new Hls({
enableWorker: true,
lowLatencyMode: true,
maxLiveSyncPlaybackRate: 2,
liveSyncDuration: 0.5,
liveMaxLatencyDuration: 2,
backBufferLength: 5,
})
this.hls.loadSource(this.url)
this.hls.attachMedia(video)
this.hls.on(Hls.Events.MANIFEST_PARSED, () => {