From 9d71e8abab4a1256683831831b0907c15f6c892e Mon Sep 17 00:00:00 2001 From: Ahmed Saber Date: Fri, 11 Aug 2023 16:04:06 +0300 Subject: [PATCH] Fix issue related to reassigning value to constant --- src/js/utils/buffer.js | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/js/utils/buffer.js b/src/js/utils/buffer.js index 4443b2f1d..c03c775fa 100644 --- a/src/js/utils/buffer.js +++ b/src/js/utils/buffer.js @@ -29,10 +29,8 @@ export function bufferedPercent(buffered, duration) { for (let i = 0; i < buffered.length; i++) { const start = buffered.start(i); - const end = buffered.end(i); - // buffered end can be bigger than duration by a very small fraction - end = Math.min(end, duration); + const end = Math.min(buffered.end(i), duration); bufferedDuration += end - start; }