hls: fix infinite loop in web client when reading incompatible codecs (#2956)

when a player received a stream with incompatible codecs, it started
polling the server for index.m3u8 in an infinite loop. This was caused
by #2631
This commit is contained in:
Alessandro Ros 2024-01-29 00:25:42 +01:00 committed by GitHub
parent 0f733bab26
commit 7d0e702f14
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -33,9 +33,7 @@ const create = (video) => {
});
hls.on(Hls.Events.ERROR, (evt, data) => {
if (data.type === Hls.ErrorTypes.MEDIA_ERROR)
hls.recoverMediaError();
else if (data.fatal) {
if (data.fatal) {
hls.destroy();
setTimeout(() => create(video), 2000);
}