mirror of
https://github.com/PR0M3TH3AN/bitvid.git
synced 2026-10-27 07:52:24 +00:00
Seed subscription videos map and reuse playback handler
This commit is contained in:
1 parent
fe0b89697f
commit
0e0249ff91
1 file changed
+9
@@ -261,6 +261,10 @@ class SubscriptionsManager {
|
||||
return;
|
||||
}
|
||||
|
||||
// Keep the global videos map up to date so delegated playback handlers
|
||||
// can reuse the already fetched metadata for this event.
|
||||
window.app?.videosMap?.set(video.id, video);
|
||||
|
||||
localAuthorSet.add(video.pubkey);
|
||||
|
||||
const nevent = window.NostrTools.nip19.neventEncode({ id: video.id });
|
||||
@@ -398,6 +402,11 @@ class SubscriptionsManager {
|
||||
|
||||
container.appendChild(fragment);
|
||||
|
||||
if (window.app) {
|
||||
window.app.videoList = container;
|
||||
window.app.attachVideoListHandler?.();
|
||||
}
|
||||
|
||||
// Lazy-load
|
||||
const lazyEls = container.querySelectorAll("[data-lazy]");
|
||||
lazyEls.forEach((el) => window.app?.mediaLoader.observe(el));
|
||||
|
||||
Reference in new issue
Block a user