From c9b920cea600b5fbe84ad7ab0b279275243faacb Mon Sep 17 00:00:00 2001 From: RblSb Date: Mon, 1 Jan 2024 07:31:02 +0300 Subject: Flashback time per item, improve webm/webp support --- src/client/Main.hx | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'src/client/Main.hx') diff --git a/src/client/Main.hx b/src/client/Main.hx index 69450d9..b1e0eb6 100644 --- a/src/client/Main.hx +++ b/src/client/Main.hx @@ -720,7 +720,8 @@ class Main { }); } for (emote in config.emotes) { - final tag = emote.image.endsWith("mp4") ? 'video autoplay="" loop="" muted=""' : "img"; + final isVideoExt = emote.image.endsWith("mp4") || emote.image.endsWith("webm"); + final tag = isVideoExt ? 'video autoplay="" loop="" muted=""' : "img"; filters.push({ regex: new EReg("(^| )" + escapeRegExp(emote.name) + "(?!\\S)", "g"), replace: '$1<$tag class="channel-emote" src="${emote.image}" title="${emote.name}"/>' @@ -739,7 +740,8 @@ class Main { } smilesList.textContent = ""; for (emote in config.emotes) { - final tag = emote.image.endsWith("mp4") ? "video" : "img"; + final isVideoExt = emote.image.endsWith("mp4") || emote.image.endsWith("webm"); + final tag = isVideoExt ? "video" : "img"; final el = document.createElement(tag); el.className = "smile-preview"; el.dataset.src = emote.image; -- cgit v1.2.3