Ensure channel grid cards trigger playback

This commit is contained in:
thePR0M3TH3AN committed 2025-10-07 19:12:48 -04:00
1 parent 814bb65ffe
commit 7070eea35e
1 file changed
+13
+13
View File
@@ -1824,6 +1824,11 @@ async function loadUserVideos(pubkey) {
} else if (cardEl.dataset.ownerPubkey) {
delete cardEl.dataset.ownerPubkey;
}
if (typeof video.id === "string" && video.id) {
cardEl.dataset.videoId = video.id;
} else if (cardEl.dataset.videoId) {
delete cardEl.dataset.videoId;
}
const rawMagnet =
typeof video.magnet === "string" ? video.magnet : "";
@@ -1933,6 +1938,14 @@ async function loadUserVideos(pubkey) {
delete cardEl.dataset.magnet;
}
if (trimmedUrl) {
cardEl.dataset.playUrl = encodeURIComponent(trimmedUrl);
} else if (cardEl.dataset.playUrl) {
delete cardEl.dataset.playUrl;
}
cardEl.dataset.playMagnet = playbackMagnet || "";
// Leave the data-play-* attributes empty in the template markup so the raw
// URL/magnet strings can be assigned after parsing without HTML entity
// escaping, keeping this renderer consistent with app.js. The stored URL is