From 0ebf3b2905e9a80cf4176656b0d29edf6c883492 Mon Sep 17 00:00:00 2001 From: Florent Date: Tue, 15 Oct 2024 12:08:27 +0200 Subject: [PATCH] chore: improve comment readibility so it betters describe the actual behavior --- src/main_thread/init/utils/initial_seek_and_play.ts | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/src/main_thread/init/utils/initial_seek_and_play.ts b/src/main_thread/init/utils/initial_seek_and_play.ts index f2cd21f2f2..7d4919b290 100644 --- a/src/main_thread/init/utils/initial_seek_and_play.ts +++ b/src/main_thread/init/utils/initial_seek_and_play.ts @@ -121,13 +121,9 @@ export default function performInitialSeekAndPlay( obs.readyState < HTMLMediaElement.HAVE_CURRENT_DATA ) { /** - * On browser, such as Safari, the HTMLMediaElement.duration - * and HTMLMediaElement.buffered may not be initialized at readyState 1, leading - * to cases where it can be equal to `Infinity`. - * If so, the range in which it is possible to seek is not yet known. - * To solve this, the seek should be done after readyState HAVE_CURRENT_DATA (2), - * at that time the previously mentioned attributes are correctly initialized and - * the range in which it is possible to seek is correctly known. + * The starting position may not be known yet. + * Postpone the seek to a moment where the starting position should be known, + * assumely it's when readyState is greater or equal to HAVE_CURRENT_DATA (2). * If the initiallySeekedTime is still `undefined` when the readyState is >= 2, * let assume that the initiallySeekedTime will never be known and continue * the logic without seeking.