Skip to content

Commit

Permalink
Also consider the content as LOADED when it is in fact ended
Browse files Browse the repository at this point in the history
  • Loading branch information
peaBerberian committed Dec 21, 2023
1 parent f071352 commit 043d69f
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions src/core/init/utils/get_loaded_reference.ts
Original file line number Diff line number Diff line change
Expand Up @@ -67,11 +67,13 @@ export default function getLoadedReference(

const minReadyState = shouldWaitForHaveEnoughData() ? 4 :
3;
if (observation.readyState >= minReadyState && observation.currentRange !== null) {
if (!shouldValidateMetadata() || mediaElement.duration > 0) {
isLoaded.setValue(true);
listenCanceller.cancel();
return;
if (observation.readyState >= minReadyState) {
if (observation.currentRange !== null || observation.ended) {
if (!shouldValidateMetadata() || mediaElement.duration > 0) {
isLoaded.setValue(true);
listenCanceller.cancel();
return;
}
}
}
}, { includeLastObservation: true, clearSignal: listenCanceller.signal });
Expand Down

0 comments on commit 043d69f

Please sign in to comment.