Skip to content

Commit

Permalink
fix(player): store pending load script requests
Browse files Browse the repository at this point in the history
  • Loading branch information
mihar-22 committed Sep 15, 2024
1 parent fa65337 commit 4734549
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ export class ThumbnailsLoader {
cache.set(src, cues);

if (cache.size > 99) {
const firstKey = cache.keys().next().value;
const firstKey = cache.keys().next().value!;
cache.delete(firstKey);
}

Expand Down
2 changes: 2 additions & 0 deletions packages/vidstack/src/utils/network.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,8 @@ export function loadScript(src: string): Promise<void> {
return promise.promise;
}

pendingRequests[src] = promise;

const script = document.createElement('script');
script.src = src;

Expand Down

0 comments on commit 4734549

Please sign in to comment.