diff --git a/web-service/public/js/bundle.js b/web-service/public/js/bundle.js index b1fc70a39750b42b3c0fce9a789e79aea1483015..312f7bc60f8010ff54ee0db73f8afdbbe4d1aba0 100644 --- a/web-service/public/js/bundle.js +++ b/web-service/public/js/bundle.js @@ -70815,7 +70815,12 @@ function FTLStream(peer, uri, element) { this.queue.push(data); } else { //console.log("Direct append: ", data); - this.sourceBuffer.appendBuffer(data); + + try { + this.sourceBuffer.appendBuffer(data); + } catch (e) { + console.error("Failed to append buffer"); + } } } @@ -70926,11 +70931,16 @@ function FTLStream(peer, uri, element) { }); this.sourceBuffer.addEventListener('updateend', () => { - if (this.queue.length > 0) { + if (this.queue.length > 0 && !this.sourceBuffer.updating) { let s = this.queue[0]; this.queue.shift(); //console.log("Append", s); - this.sourceBuffer.appendBuffer(s); + + try { + this.sourceBuffer.appendBuffer(s); + } catch(e) { + console.error("Failed to append buffer"); + } } }); }); diff --git a/web-service/public/js/index.js b/web-service/public/js/index.js index d6242d5d432e594d38b476bc3e04ab2d484574a4..3808bb6307b7d874fa40c611afc0ada1dbf7e300 100644 --- a/web-service/public/js/index.js +++ b/web-service/public/js/index.js @@ -404,7 +404,12 @@ function FTLStream(peer, uri, element) { this.queue.push(data); } else { //console.log("Direct append: ", data); - this.sourceBuffer.appendBuffer(data); + + try { + this.sourceBuffer.appendBuffer(data); + } catch (e) { + console.error("Failed to append buffer"); + } } } @@ -515,11 +520,16 @@ function FTLStream(peer, uri, element) { }); this.sourceBuffer.addEventListener('updateend', () => { - if (this.queue.length > 0) { + if (this.queue.length > 0 && !this.sourceBuffer.updating) { let s = this.queue[0]; this.queue.shift(); //console.log("Append", s); - this.sourceBuffer.appendBuffer(s); + + try { + this.sourceBuffer.appendBuffer(s); + } catch(e) { + console.error("Failed to append buffer"); + } } }); });