From a6193c13fb0d08c6282153bb87c04b1a1ac851b1 Mon Sep 17 00:00:00 2001 From: Kibi Kelburton Date: Fri, 17 Jul 2026 11:45:46 +0200 Subject: [PATCH] video comments on profile comment page --- public/s/js/user_comments.js | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/public/s/js/user_comments.js b/public/s/js/user_comments.js index 63b2c9a..d61b08b 100644 --- a/public/s/js/user_comments.js +++ b/public/s/js/user_comments.js @@ -35,6 +35,7 @@ if (!window.UserCommentSystem) { const contentEl = el.querySelector('.comment-content'); if (contentEl) { contentEl.innerHTML = this.renderCommentContent(data.content, data.item_id); + this.playEmojiVideos(contentEl); el.classList.remove('new-item-fade'); void el.offsetWidth; el.classList.add('new-item-fade'); @@ -118,6 +119,7 @@ if (!window.UserCommentSystem) { const html = this.renderComment(c); this.container.insertAdjacentHTML('beforeend', html); }); + this.playEmojiVideos(this.container); this.page++; } else { this.finished = true; @@ -133,9 +135,22 @@ if (!window.UserCommentSystem) { } } + playEmojiVideos(container) { + if (!container) return; + container.querySelectorAll('video.emoji').forEach(v => { + v.play().catch(() => { + v.addEventListener('canplay', () => v.play().catch(() => {}), { once: true }); + }); + }); + } + renderEmoji(match, name) { if (this.customEmojis && this.customEmojis[name]) { - return `${match}`; + const url = this.customEmojis[name]; + if (url.endsWith('.webm')) { + return ``; + } + return `${match}`; } return match; }